in reply to Re: Bio::Search::Hit::BlastHit unreturned results misformats csv output
in thread Bio::Search::Hit::BlastHit unreturned results misformats csv output

I'm not that sure, however, this is what the next_hit() module does according to cpan.<
Title : next_hit Usage : while( $hit = $result->next_hit()) { ... } Function: Returns the next available Hit object, representing potenti +al matches between the query and various entities from the dat +abase. Returns : a Bio::Search::Hit::HitI object or undef if there are no mo +re. Args : none
The same is true for next_hsp(). Therefore, I thought if I threw I check to see if they are defined, it would only print if they are. Is this incorrect?
  • Comment on Re^2: Bio::Search::Hit::BlastHit unreturned results misformats csv output
  • Download Code

Replies are listed 'Best First'.
Re^3: Bio::Search::Hit::BlastHit unreturned results misformats csv output
by jrsimmon (Hermit) on Jun 30, 2009 at 18:48 UTC
    I'm not in the least familiar with the modules you're using, so I may not be much help...that said, I'd definitely confirm that the behavior of the module you're using. Something like
    open(DBG, ">$some_log_file") or die; while (my $hit = $result->next_hit) { next unless ($v > 0); #print OUT $result->query_name().",".$result->query_description().", +".$hit->name().","; if(defined($hit)) { my $debug_qry = $result->query_name(); my $debug_hit = $hit->name(); print DBG "$debug_qry\t$debug_hit\t$hit\n"; print OUT $result->query_name().",".$hit->name().","; } else { print OUT "\n"; } while (my $hsp = $hit->next_hsp) { #print OUT $hsp->score().",".$hsp->expect()."\n"; if(defined($hsp)) { my $debug_score = $hsp->score(); my $debug_expect = $hsp->expect(); my $debug_qry_desc = $result->query_description(); print DBG "$debug_score\t$debug_expect\t$debug_qry_desc\t$hsp\n" +; print OUT $hsp->score().",".$hsp->expect().",".$result->query_de +scription()."\n"; } else { print OUT "\n"; } } }
    You could use Data::Dumper too, but that's probably overkill for what you need at this point. The point is that you need to verify whether you're getting a bad return from the method or whether you're handling a proper return badly.