The following code allows you to download a protein sequence from Genbank and store it in a fasta file.
use Bio::DB::GenBank; my $gb=new Bio::DB::GenBank; my $seq= $gb->get_Seq_by_id ("asdadasda"); write_sequence (">roar.fa", 'fasta',$seq );
But what if i want to make Perl download all the sequences given a file with protein Ids and then store it to a fasta. I assume that I want to read the sec.txt into an array @lines and I try the following code:
The problem is that in my file roar.fa it is still printed the same result as with the first code: Only the first sequence derived from 'asdadasda' .Below is the sec.txt file:use Bio::DB::GenBank; open my $handle, '<', 'sec.txt'; my @lines = <$handle>; close $handle; print @lines; my $gb=new Bio::DB::GenBank; my $seq= $gb->get_Seq_by_id ("@lines"); write_sequence (">roar.fa", 'fasta',$seq );
asdadasda eeeeerrrr vfffvvvfv raerrrrrr
Thanks!
In reply to Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl by dimitris852
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |