Skip to content

Commit

Permalink
Fix a few issues detecting when coverage is too low (or zero). Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Jul 23, 2024
1 parent 5e923bf commit ee6d277
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/pipelines/canu.pl
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,8 @@ ($$)
my $mincov = getGlobal("stopOnLowCoverage");
my $curcov = getExpectedCoverage($asm, $tag);

if ($curcov < $mincov) {
if (($curcov == 0) ||
($curcov < $mincov)) {
print STDERR "--\n";
print STDERR "-- ERROR: Read coverage ($curcov) lower than allowed.\n";
print STDERR "-- ERROR: stopOnLowCoverage = $mincov\n";
Expand Down Expand Up @@ -934,7 +935,7 @@ ($$)
my $exist2 = ((getNumberOfBasesInStore($asm, "obt") > 0) ||
(getNumberOfBasesInStore($asm, "utg") > 0));

$reason = "no raw reads exist in $asm.seqStore" if ((fileExists("$asm.seqStore/info")) &&
$reason = "no reads for correction exist in $asm.seqStore" if ((fileExists("$asm.seqStore/info")) &&
(getNumberOfBasesInStore($asm, "cor") == 0));
$reason = "$cr in $asm.correctedReads.*.gz" if ($exist1);
$reason = "$cr in $asm.seqStore" if ($exist2);
Expand Down Expand Up @@ -975,7 +976,7 @@ ($$)
fileExists("$asm.trimmedReads.fastq.gz"));
my $exist2 = (getNumberOfBasesInStore($asm, "utg") > 0);

$reason = "no corrected reads exist in $asm.seqStore" if ((fileExists("$asm.seqStore/info")) &&
$reason = "no reads for trimming exist in $asm.seqStore" if ((fileExists("$asm.seqStore/info")) &&
(getNumberOfBasesInStore($asm, "obt") == 0));
$reason = "$tr in $asm.trimmedReads.*.gz" if ($exist1);
$reason = "$tr in $asm.seqStore" if ($exist2);
Expand Down Expand Up @@ -1011,13 +1012,12 @@ ($$)
my $mode = shift @_;
my $reason = undef;

$reason = "no corrected reads to assemble" if (fileExists("$asm.seqStore/info") &&
(getNumberOfBasesInStore($asm, "obt") == 0) &&
(getNumberOfBasesInStore($asm, "utg") == 0));
$reason = "contigs exist in $asm.contigs.fasta" if (fileExists("$asm.contigs.fasta"));
$reason = "not enabled" if (($mode ne "assemble") &&
($mode ne "trim-assemble") &&
($mode ne "run"));
$reason = "no reads for assembly exist in $asm.seqStore" if ((fileExists("$asm.seqStore/info")) &&
(getNumberOfBasesInStore($asm, "utg") == 0));
$reason = "contigs exist in $asm.contigs.fasta" if (fileExists("$asm.contigs.fasta"));
$reason = "not enabled" if (($mode ne "assemble") &&
($mode ne "trim-assemble") &&
($mode ne "run"));

if (defined($reason)) {
print STDERR "--\n";
Expand Down
11 changes: 7 additions & 4 deletions src/pipelines/canu/Meryl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -435,20 +435,23 @@ sub merylConfigure ($$) {
# results in the smallest number of batches.
#

my $merylMemory;
my $merylSegments;
my $merylMemory = 0;
my $merylSegments = 0;
my $merylBatches = 1048576;

printf(STDERR "-- segments memory batches\n");
printf(STDERR "-- -------- -------- -------\n");

foreach my $ss (qw(01 02 04 06 08 12 16 20 24 32 40 48 56 64 96)) {
next if ($ss > $maxSplit);

my $mem = undef;
my $bat = undef;

if ($ss > $maxSplit) {
printf(STDERR "-- %3s -.-- GB - (segment size too small)\n", $ss);
next;
}
if (! -e "$path/$name.config.$ss.out") {
printf(STDERR "-- %3s -.-- GB - (no configure output)\n", $ss);
next;
}

Expand Down

0 comments on commit ee6d277

Please sign in to comment.