The documentation for Bio::DB::GenBank states that the set_Seq_by_id method takes only one argument which is the id (as a string) of a sequence. It does not appear that you can supply a list of sequences as the argument.
So, if you want to write multiple sequences you will need to do something like this:
Note that I changed the write mode from > to >> in order to append to the file. So, you should delete any old roar.fa file that may exist before running the script again.foreach my $id (@lines) { my $seq = $gb->get_Seq_by_id($id); write_sequence( ">>roar.fa", 'fasta', $seq ); }
In reply to Re: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
by kevbot
in thread Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl
by dimitris852
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |