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.

In reply to Re^3: Bio::Search::Hit::BlastHit unreturned results misformats csv output by jrsimmon
in thread Bio::Search::Hit::BlastHit unreturned results misformats csv output by hansoffate

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.