[Bioperl-l] problem with a script

Kevin Brown Kevin.M.Brown at asu.edu
Wed Sep 16 15:16:51 UTC 2009


That's because the variable $in isn't defined, just like the error says. You are setting $searchio to be your input object, but not using it.

#!/v/linux26_x86_64/appl/molbio/bioperl/perl/bin/
use strict; #<-- this helps to find those pesky undeclared variables
use Bio::SearchIO;
my $searchio = Bio::SearchIO->new(-format => 'hmmer', -file   => '/wrk/xxxx/hmm/hmmsearch_nr.out');
while ( my $result = $searchio->next_result ) { # <-- changed this line
     while ( my $hit = $result->next_hit ) {
         while ( my $hsp-evalue<=10 ) {
             while ( my $hsp = $hit->next_hsp ) {
                 print $hit->accession(), "\n";
         }
     }
 }


Kevin Brown
Center for Innovations in Medicine
Biodesign Institute
Arizona State University  

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of 
> "Joonas Jämsen"
> Sent: Wednesday, September 16, 2009 3:04 AM
> To: bioperl list
> Subject: [Bioperl-l] problem with a script
> 
> 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
> 




More information about the Bioperl-l mailing list