[Bioperl-l] Bio::DB::GenBank question
Chris Fields
cjfields at illinois.edu
Sat Jul 24 13:00:24 EDT 2010
Any reason not to use a stream here?
my $io = $db->get_Stream_by_id(\@ids);
while (my $seq = $stream->next_seq) {
# do stuff here
}
chris
On Jul 24, 2010, at 11:41 AM, Jason Stajich wrote:
> Hi. You should ask questions to the list. There are many who can answer your question there.
>
> In the older versions you can put the retrieve statement in an eval block. I think newer behavior may be only to issue a warning and keep going.
>
> You may be able to also set verbose to -1 (-verbose => -1) in the initialization of the db obj and see whether it skips or fails on missing ID.
> -Jason.
> Sent from my iPod
>
> On Jul 23, 2010, at 6:48, Hongseok Tae <htae at vbi.vt.edu> wrote:
>
>> Hi Jason Stajich,
>>
>> I am using Bioperl and it is very useful. I have a question about Bio::DB::GenBank.
>> This is a simple code.
>>
>> --------------------------
>>
>> $db = Bio::DB::GenBank->new();
>> @ids = ("LOC441435", "X78121");
>> foreach $id (@ids){
>> $seqobj = $db->get_Seq_by_id($id);
>> $seqstr = $seqobj->seq();
>> print "$>id\n$seqstr\n";
>> }
>>
>> --------------------------
>>
>> If there is no entry for an ID, I would like to skip it and to get next one. But this code stops running when an ID does not exist in genbank.
>> How can I solve this problem?
>>
>> Thanks.
>> Hongseok Tae
>>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list