[Bioperl-l] problem with a script
    Robert Buels 
    rmb32 at cornell.edu
       
    Wed Sep 16 15:05:16 UTC 2009
    
    
  
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
> 
    
    
More information about the Bioperl-l
mailing list