or sorry..i have code down..im just struggling..
!/usr/bin/perl -w
use strict;
my $filename; my $accessionid; my $sequenceid;
print "Please enter in the filename: "; chomp($filename = <STDIN>);
print "Please enter in the accessionID: "; chomp($accessionid = <STDIN>);
open(FILENAME, $filename) or die "cannot open file: $! "; while(<FILENAME>){ if($_ =~ /$accessionid/i) { $sequenceid = $; print "$sequenceid\n"; } my $seq = ''; foreach($) { last if ($ =~ />gi/);
print "$seq\n"; } }
And where is this sequence to be "extracted" from? A local database? A remote database? I suggest you use your initiative and started reading the Bioperl HOW-TOs: http://www.bioperl.org/wiki/HOWTOs. What you want to do is very easy.
Can you only do what your prof. has shown you, or are you an independent mind?