diff --git a/bin/scale_reads.pl b/bin/scale_reads.pl index 35b36e4..f9b3008 100755 --- a/bin/scale_reads.pl +++ b/bin/scale_reads.pl @@ -327,7 +327,7 @@ =head1 CODE my $c; my $tlen_sum; -my $seqwithtlen; +my $seqwithtlen = 0; while(my $aln = $sp->next_aln()){ @@ -389,7 +389,8 @@ =head1 CODE print "coverage\t", $current_cov, "\n"; print "genome_size\t", $genome_size, "\n"; print "target_coverage\t", $opt{target_coverage}, "\n"; -print "insert_size\t", int($tlen_sum/$seqwithtlen), "\n"; +if ($seqwithtlen > 0){ print "insert_size\t", int($tlen_sum/$seqwithtlen), "\n";} +else {print "insert_size\tNA\n";} print "closest_ref\t", $closest_ref || 'NA', "\n";