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. |