Mercurial > repos > biomonika > linkyx
annotate scripts/get_sequences_based_on_ids.pl @ 13:ef5c8ed727b0
toolshed12
| author | biomonika <biomonika@psu.edu> |
|---|---|
| date | Wed, 10 Sep 2014 10:49:56 -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 } |
