[Bioperl-l] RE:Segmentation fault

stephan rosecker stephan.rosecker at ish.de
Mon Apr 12 11:55:20 EDT 2004


 > If $result->query_name() is indeed the right call to make in
 > the inner loop (according to the Bio::SearchIO documentation,
 > $result is an object with the Bio::Search::Hit::HitI interface,
 > which from what I can see contains no query_name() method), then
 > I would suggest that you try your program with a newer version
 > of Perl.  I believe the latest version is 5.8.3.

Hi,
like i wrote a'm not a perl guru so please correct me.
$result is a "pointer" to my current seq object.
($result = $in->next_result)
$hit is a "pointer" to my current hit object.
(my $hit = $result->next_hit)
So "$result->query_name" has to be visible inside my while-loop.
(I want only the seq object that contains hit's)

old code:
----------------------------------------------
while( my $result = $in->next_result )
         {
                 while( my $hit = $result->next_hit )
                         {
                         print $result->query_name."\n";
                         wait;
                         last;
                         }
         }
----------------------------------------------

After i read your mail i rewrote the code and
it shoud be more conform... but also sementation fault:-( .

new code:
----------------------------------------------

use Bio::Search::Result::HMMERResult;
     my $result = new Bio::Search::Result::HMMERResult
     ( -hmm_name => 'pfam',
           -sequence_file => 'uniprot_sprot.dat',
                 -hits => \@hits);
# I'm not realy understand the args here -
# pfam for hmmpfam ?
# -sequence_file = source hmmpfam file ?

     use Bio::SearchIO;
         my $in = new Bio::SearchIO(-format => 'hmmer',
                 -file   => 'uniprot_sprot_hmmer.out');
      while( my $result = $in->next_result ) {
           $result->num_hits(), " hits\n";
                if ($result->num_hits()>0)
                      {print $result->query_name."\n";}
}

greets,
stephan

























More information about the Bioperl-l mailing list