Mercurial > repos > biomonika > linkyx
diff scripts/get_sequence_based_on_id.pl @ 9:695d28139f3e
toolshed8
| author | biomonika <biomonika@psu.edu> |
|---|---|
| date | Tue, 09 Sep 2014 14:31:02 -0400 |
| parents | 1955f03f092e |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/get_sequence_based_on_id.pl Tue Sep 09 14:31:02 2014 -0400 @@ -0,0 +1,14 @@ +use Bio::DB::Fasta; + +my $fastaFile = shift; +my $queryFile = shift; + +my $db = Bio::DB::Fasta->new( $fastaFile ); + $seq = $queryFile; + chomp($queryFile); + + my $sequence = $db->seq($seq); + if (!defined( $sequence )) { + die "Sequence $seq not found. \n" + } + print ">$seq\n", "$sequence\n"; \ No newline at end of file
