Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed debug log severity for read threading messages. #8419

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ List<Haplotype> findBestPaths(final Collection<T> graphs, final Map<T, AssemblyR
resultSet.add(h);
}

logger.log(debug ? Level.INFO : Level.OFF, () -> "Adding haplotype " + h.getCigar() + " from graph with kmer " + assemblyResult.getKmerSize());
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Adding haplotype " + h.getCigar() + " from graph with kmer " + assemblyResult.getKmerSize());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the issue is that calling logger.log(Level.OFF, message) will print that message in every case if you turn the logger off? If thats true I actually want you to revert these to the way they were before they were recently refactored (which i reviewed and didn’t catch here)… replace them with the previous statements

if(debug) {
            logger.info( "Not using kmer size of " + kmerSize + " in read threading assembler because reference contains non-unique kmers");
}

}
}

Expand Down Expand Up @@ -623,7 +623,7 @@ private AssemblyResult createGraph(final Iterable<GATKRead> reads,
if ( !allowNonUniqueKmersInRef && !ReadThreadingGraph.determineNonUniqueKmers(
new ReadThreadingGraph.SequenceForKmers("ref", refHaplotype.getBases(), 0,
refHaplotype.getBases().length, 1, true), kmerSize).isEmpty() ) {
logger.log(debug ? Level.INFO : Level.OFF, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because reference contains non-unique kmers");
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because reference contains non-unique kmers");

return null;
}
Expand Down Expand Up @@ -655,13 +655,13 @@ private AssemblyResult createGraph(final Iterable<GATKRead> reads,

// sanity check: make sure there are no cycles in the graph, unless we are in experimental mode
if ( generateSeqGraph && rtgraph.hasCycles() ) {
logger.log(debug ? Level.INFO : Level.OFF, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because it contains a cycle");
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because it contains a cycle");
return null;
}

// sanity check: make sure the graph had enough complexity with the given kmer
if ( ! allowLowComplexityGraphs && rtgraph.isLowQualityGraph() ) {
logger.log(debug ? Level.INFO : Level.OFF, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because it does not produce a graph with enough complexity");
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Not using kmer size of " + kmerSize + " in read threading assembler because it does not produce a graph with enough complexity");
return null;
}

Expand Down Expand Up @@ -705,7 +705,7 @@ private AssemblyResult getAssemblyResult(final AbstractReadThreadingGraph rtgrap
return new AssemblyResult(AssemblyResult.Status.ASSEMBLED_SOME_VARIATION, initialSeqGraph, null);
}

logger.log(debug ? Level.INFO : Level.OFF, () -> "Using kmer size of " + rtgraph.getKmerSize() + " in read threading assembler");
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Using kmer size of " + rtgraph.getKmerSize() + " in read threading assembler");

initialSeqGraph.cleanNonRefPaths(); // TODO -- I don't this is possible by construction

Expand All @@ -719,7 +719,7 @@ private AssemblyResult getAssemblyResult(final AbstractReadThreadingGraph rtgrap
return new AssemblyResult(AssemblyResult.Status.ASSEMBLED_SOME_VARIATION, null, rtgraph);
}

logger.log(debug ? Level.INFO : Level.OFF, () -> "Using kmer size of " + rtgraph.getKmerSize() + " in read threading assembler");
logger.log(debug ? Level.INFO : Level.TRACE, () -> "Using kmer size of " + rtgraph.getKmerSize() + " in read threading assembler");

final AssemblyResult cleaned = getResultSetForRTGraph(rtgraph);
final AssemblyResult.Status status = cleaned.getStatus();
Expand Down