[Bioperl-l] problem with a script

Robert Buels rmb32 at cornell.edu
Wed Sep 16 19:04:16 UTC 2009


You should also 'use warnings' at the top of all code.  That would have 
caught THIS error.

You are missing a comma after ....nr.out'

Rob

Joonas Jämsen wrote:
> Thanks. Im still getting errors. I have no idea what the error means. It 
> says:
> 
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Could not open 0: No such file or directory
> STACK: Error::throw
> STACK: Bio::Root::Root::throw 
> /v/linux26_x86_64/appl/molbio/bioperl/perl/lib/site_perl/5.8.9/Bio/Root/Root.pm:357 
> 
> STACK: Bio::Root::IO::_initialize_io 
> /v/linux26_x86_64/appl/molbio/bioperl/perl/lib/site_perl/5.8.9/Bio/Root/IO.pm:310 
> 
> STACK: Bio::Root::IO::new 
> /v/linux26_x86_64/appl/molbio/bioperl/perl/lib/site_perl/5.8.9/Bio/Root/IO.pm:223 
> 
> STACK: Bio::SearchIO::new 
> /v/linux26_x86_64/appl/molbio/bioperl/perl/lib/site_perl/5.8.9/Bio/SearchIO.pm:145 
> 
> STACK: Bio::SearchIO::new 
> /v/linux26_x86_64/appl/molbio/bioperl/perl/lib/site_perl/5.8.9/Bio/SearchIO.pm:177 
> 
> STACK: parser.pl:7
> -----------------------------------------------------------
> 
> And the code im using seems ok now:
> 
> #!/v/linux26_x86_64/appl/molbio/bioperl/perl/bin/
> 
> use strict;
> use Bio::SearchIO;
> 
> my $searchio = Bio::SearchIO->new(-format => 'hmmer', -file => 
> '/wrk/xxxx/hmm/hmmsearch_nr.out' -verbose=>1);
> while ( my $result = $searchio->next_result ) {
>     while ( my $hit = $result->next_hit ) {
>         while ( my $hsp = $hit->evalue<=10 ) {
>                 while ( my $hsp = $hit->next_hsp ) {
>                         print $hit->accession(), "\n";
>             }
>         }
>     }
> }
> 
> -J.
> 
> Robert Buels wrote:
>> 1.) You need to use strict.  Always have use strict at the top of your 
>> code.  That would have caught this error.
>> 2.) The proximate problem here is that your searchio object is call 
>> $searchio, while you are calling $in->next_result.  You want 
>> $searchio->next_result instead.
>>
>> Rob
>>
>> Joonas Jämsen wrote:
>>> Hi,
>>>
>>> Im trying to run the script below and I get an error: "Can't call 
>>> method "next_result" on an undefined value at parser.pl line 5."
>>>
>>>
>>> #!/v/linux26_x86_64/appl/molbio/bioperl/perl/bin/
>>> use Bio::SearchIO
>>> my $searchio = Bio::SearchIO->new(-format => 'hmmer', -file   => 
>>> '/wrk/xxxx/hmm/hmmsearch_nr.out');
>>> while ( my $result = $in->next_result ) {
>>>      while ( my $hit = $result->next_hit ) {
>>>          while ( my $hsp-evalue<=10 ) {
>>>              while ( my $hsp = $hit->next_hsp ) {
>>>                  print $hit->accession(), "\n";
>>>          }
>>>      }
>>>  }
>>>
>>> Could someone tell me what is wrong?
>>>
>>> Thanks.
>>>
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
>>


-- 
Robert Buels
Bioinformatics Analyst, Sol Genomics Network
Boyce Thompson Institute for Plant Research
Tower Rd
Ithaca, NY  14853
Tel: 503-889-8539
rmb32 at cornell.edu
http://www.sgn.cornell.edu



More information about the Bioperl-l mailing list