In my opinion when I see eight consecutive "}"'s in a row, I figure that something is wrong with the code - too many levels of indentation!if( $hsp->length('total') > 1000 ) { if ( $hsp->percent_identity >= 90 ) { if( $hsp->score ){ if( $hsp->gaps ){ if( $hsp->expect ){ print "Hit= ", $hit->name, " Length=", $hsp->length('total'), " Score=", $hsp->score,"\n"; print "Gaps=", $hsp->gaps, " Expect=", $hsp->expect, " Percent_id=", $hsp->percent_identity, "\n"; my $aln = $hsp->get_aln; my $alnIO = Bio::AlignIO->new(-format =>"clustalw", -file +=> $out); $alnIO->write_aln($aln); } } } } } ## better is to reduce the levels of "if" by using "and" or && if ( ($hsp->length('total') > 1000 ) && ($hsp->percent_identity >= 90 ) && ($hsp->score ) && ($hsp->gaps) && ($hsp->expect) ) { #do your print stuff }
I was looking at your while loop and it is hard for me to say exactly how to make that better as there can be a lot of cases here and I am unable to run your current code without installing some modules.
Can you simplify your question?
In reply to Re: parsing blast output
by Marshall
in thread parsing blast output
by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |