annotate scripts/get_sequences_based_on_ids.pl @ 22:7997c93ee479
last attempt to install perl as part of linkyx
| author |
biomonika <biomonika@psu.edu> |
| date |
Thu, 11 Sep 2014 19:40:01 -0400 |
| parents |
1955f03f092e |
| children |
|
| rev |
line source |
|
0
|
1 use Bio::DB::Fasta;
|
|
|
2
|
|
|
3 my $fastaFile = shift;
|
|
|
4 my $queryFile = shift;
|
|
|
5
|
|
|
6 my $db = Bio::DB::Fasta->new( $fastaFile );
|
|
|
7 open (IN, $queryFile);
|
|
|
8 while (<IN>){
|
|
|
9 chomp;
|
|
|
10 $seq = $_;
|
|
|
11 my $sequence = $db->seq($seq);
|
|
|
12 if (!defined( $sequence )) {
|
|
|
13 die "Sequence $seq not found. \n"
|
|
|
14 }
|
|
|
15 print ">$seq\n", "$sequence\n";
|
|
|
16 } |