[Bioperl-l] use threads to get seq file error.

Chris Fields cjfields at illinois.edu
Mon Mar 1 20:37:18 UTC 2010


I get much nastier ones than that; a small taste:

--------------------- WARNING ---------------------
MSG: exception while parsing location line [1..680] in reading
EMBL/GenBank/SwissProt, ignoring feature source (seqid=AF031249):
Eval-group not allowed at runtime, use re 'eval' in regex
m/(.*?)\(((?x-ism:
                (?>
                [^()]+
                |
                \(
                (??{.../
at /home/cjfields/bioperl/live/Bio/Factory/FTLocationFactory.pm line
161, <GEN1> line 36.

---------------------------------------------------
Thread 2 terminated abnormally: Can't call method "primary_tag" on an
undefined value at /home/cjfields/bioperl/live/Bio/SeqIO/genbank.pm line
662, <GEN1> line 36.


Could you report this as a bug?

chris


On Mon, 2010-03-01 at 13:10 +0800, forrest wrote:
> Hi all,
> 
> When I use threads to get Genbank format file, show some error. It is
> shown as:
> 
> "Can't call method "get_taxon" on unblessed reference at
> /opt/local/lib/perl5/site_perl/5.8.9/Bio/Taxon.pm line 671."
> 
> =========================================
> #!/usr/bin/perl -w
> use strict;
> use Bio::SeqIO;
> use Bio::Seq;
> use Bio::DB::GenBank;
> use threads;
> 
> 
> my @id = ("AK287649","AF031249","EZ238383","BLYDHN5","AY895908","EF409493","AY895886","AF181455","AY895930","EF409498");
> 
> 
> my $seq_out = Bio::SeqIO->new(-format => "genbank",
>                               -file => ">dhn_all.gb");
> my @seq;
> 
> my $number = @id;
> 
> my $max_threads = 6;
> 
> for (my $thread_number=0;$thread_number<$number;){
>         my %threads_seq_hash;
>         
>         if ($number - $thread_number > $max_threads){
>             for (my $thread=0;$thread<$max_threads;){
>                 $threads_seq_hash{$thread} = threads->new(sub {
>                                         my $gb = Bio::DB::GenBank->new;
>                                         my $seq = $gb->get_Seq_by_acc($id[$thread_number]);
>                                     });
>                 $thread_number++;
>                 $thread++;
> 
>             }
>         }else{
>             my $else_number = $number % $max_threads;
>             for (my $thread=0;$thread<$else_number;){
>                 $threads_seq_hash{$thread} = threads->new(sub {
>                                         my $gb = Bio::DB::GenBank->new;
>                                         my $seq = $gb->get_Seq_by_acc($id[$thread_number]);
>                                     });
>                 $thread_number++;
>                 $thread++;
>                 
>             }
>             
>             
>         }
>     
>     foreach my $thread (sort keys %threads_seq_hash){
>         my ($seq) = $threads_seq_hash{$thread}->join;
>         push (@seq,$seq);
>     } 
> }
> 
> foreach (@seq){
>     $seq_out->write_seq($_);
> }
> =========================================
> 
> 
> How can I fix this error?
> Thanks.
> 
> 
> Zhang Tao
> 
> 
> 
> 
> 
> _______________________________________________
> 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