You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CollectAlignmentSummaryMetrics, and maybe others which use the Histogram class from htsjdk.
Affected version(s)
Latest public release version [3.0.0]
Description
When running this tool on a small bam without good alignments (but properly formatted), the tool throws a NullPointerException. A more useful error message would be appreciated to help users debug what went wrong.
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.Map$Entry.getValue()" because the return value of "java.util.NavigableMap.firstEntry()" is null
at htsjdk.samtools.util.Histogram.getMin(Histogram.java:438)
at picard.analysis.AlignmentSummaryMetricsCollector$IndividualAlignmentSummaryMetricsCollector.finish(AlignmentSummaryMetricsCollector.java:271)
at picard.analysis.AlignmentSummaryMetricsCollector$GroupAlignmentSummaryMetricsPerUnitMetricCollector.finish(AlignmentSummaryMetricsCollector.java:185)
at picard.metrics.MultiLevelCollector$AllReadsDistributor.finish(MultiLevelCollector.java:208)
at picard.metrics.MultiLevelCollector.finish(MultiLevelCollector.java:324)
at picard.analysis.CollectAlignmentSummaryMetrics.finish(CollectAlignmentSummaryMetrics.java:176)
at picard.analysis.SinglePassSamProgram.makeItSo(SinglePassSamProgram.java:177)
at picard.analysis.SinglePassSamProgram.doWork(SinglePassSamProgram.java:94)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:289)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:104)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:114)
Expected behavior
A more useful error message should be given in this case, or an empty metrics file produced (if appropriate).
Actual behavior
An unhelpful stacktrace is given instead.
More Details
The reason this is happening is related to this issue in htsjdk. One fix is to have this Picard tool be careful about how it calls the htsjdk Histogram methods and essentially ensure it never uses them unless it's safe. Another fix is to have the Histogram methods in htsjdk throw an exception in this sort of case, and make the Picard tools affected have to handle them appropriately, though this feels like a lot of trouble to update every tool depending on it.
The text was updated successfully, but these errors were encountered:
Bug Report
Affected tool(s)
CollectAlignmentSummaryMetrics, and maybe others which use the Histogram class from htsjdk.
Affected version(s)
Description
When running this tool on a small bam without good alignments (but properly formatted), the tool throws a
NullPointerException
. A more useful error message would be appreciated to help users debug what went wrong.Steps to reproduce
Save the following sam file to
null.sam
:Then run
to see the error:
Expected behavior
A more useful error message should be given in this case, or an empty metrics file produced (if appropriate).
Actual behavior
An unhelpful stacktrace is given instead.
More Details
The reason this is happening is related to this issue in htsjdk. One fix is to have this Picard tool be careful about how it calls the htsjdk Histogram methods and essentially ensure it never uses them unless it's safe. Another fix is to have the Histogram methods in htsjdk throw an exception in this sort of case, and make the Picard tools affected have to handle them appropriately, though this feels like a lot of trouble to update every tool depending on it.
The text was updated successfully, but these errors were encountered: