Commit fbded075 authored by Sebastien Moretti's avatar Sebastien Moretti
Browse files

Fix when all blast hits fail to be aligned + clean debug prints

parent 1e1122f7
...@@ -387,6 +387,7 @@ for(my $r=0; $r<=$#original_names; $r++){ ...@@ -387,6 +387,7 @@ for(my $r=0; $r<=$#original_names; $r++){
# Align Nt seq with our protein query seq # Align Nt seq with our protein query seq
my ($POS, $BOJ) = runExonerate($cache, $date, $r, $original_seq[$r], $fasta_header, @nt_GIs); my ($POS, $BOJ) = runExonerate($cache, $date, $r, $original_seq[$r], $fasta_header, @nt_GIs);
next HIT_LINK if ( !defined $POS );
my ($POSresult, $bestNucleotide) = prepareResults4CDS($POS, $equivalent_blast_hits[$qq], $original_seq[$r], $fasta_header); my ($POSresult, $bestNucleotide) = prepareResults4CDS($POS, $equivalent_blast_hits[$qq], $original_seq[$r], $fasta_header);
$resultPOS .= $POSresult if ( $bestNucleotide ne '' && $POSresult ne '' && $resultPOS !~ /_G_$bestNucleotide/ ); $resultPOS .= $POSresult if ( $bestNucleotide ne '' && $POSresult ne '' && $resultPOS !~ /_G_$bestNucleotide/ );
...@@ -837,7 +838,7 @@ sub fetch { ...@@ -837,7 +838,7 @@ sub fetch {
return $content; return $content;
} }
} }
print "ERROR: Problem with NCBI eutils, please try again later\n"; print "\n\tERROR: Problem with NCBI eutils, please try again later\n";
exit(40); exit(40);
} }
...@@ -869,7 +870,7 @@ sub fetch_fasta { ...@@ -869,7 +870,7 @@ sub fetch_fasta {
} }
print {*STDERR} "[[$url]]\n" if ( $debug ); print {*STDERR} "[[$url]]\n" if ( $debug );
unlink("$outfile"); unlink("$outfile");
print "ERROR: Problem with NCBI eutils, please try again later.\n"; print "\n\tERROR: Problem with NCBI eutils, please try again later.\n";
exit(45); exit(45);
} }
...@@ -1116,22 +1117,17 @@ sub testPositions{ ...@@ -1116,22 +1117,17 @@ sub testPositions{
my @cles = sort({$a <=> $b} keys(%$best_pos)); my @cles = sort({$a <=> $b} keys(%$best_pos));
if ( !exists($cles[0]) ){ if ( !exists($cles[0]) ){
print {*STDERR} keys(%positions), " 1\n";
return(\%positions); return(\%positions);
} }
else{ else{
print {*STDERR} keys(%positions), " 2\n";
return(\%positions) if ( exists($cles[0]) && $#cles < $#clefs ); return(\%positions) if ( exists($cles[0]) && $#cles < $#clefs );
print {*STDERR} keys(%$best_pos), " 3\n";
return($best_pos) if ( exists($cles[0]) && $#cles >= $#clefs ); return($best_pos) if ( exists($cles[0]) && $#cles >= $#clefs );
} }
} }
elsif ( %$best_pos ne 0 ){ elsif ( %$best_pos ne 0 ){
print {*STDERR} keys(%$best_pos), " 4\n";
return($best_pos); return($best_pos);
} }
else{ else{
print {*STDERR} keys(%positions), " 5\n";
return(\%positions); return(\%positions);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment