Treat "NaN" and "nan" as equivalents (VariantFiltration)
open | Created 2019-01-16 | Last updated 2019-01-29| Posted by jemunro | See in Github


bug


Feature request

Tool(s) or class(es) involved

VariantFiltration

Description

While running variantFiltration, I have encountered the following error:

java.lang.NumberFormatException: For input string: "nan"
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
        at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
        at java.lang.Double.parseDouble(Double.java:538)
        at org.apache.commons.jexl2.JexlArithmetic.toDouble(JexlArithmetic.java:1016)
        at org.apache.commons.jexl2.JexlArithmetic.compare(JexlArithmetic.java:699)
        at org.apache.commons.jexl2.JexlArithmetic.lessThan(JexlArithmetic.java:774)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:967)
        at org.apache.commons.jexl2.parser.ASTLTNode.jjtAccept(ASTLTNode.java:18)
        at org.apache.commons.jexl2.Interpreter.interpret(Interpreter.java:232)
        at org.apache.commons.jexl2.ExpressionImpl.evaluate(ExpressionImpl.java:65)
        at htsjdk.variant.variantcontext.JEXLMap.evaluateExpression(JEXLMap.java:186)
        at htsjdk.variant.variantcontext.JEXLMap.get(JEXLMap.java:95)
        at htsjdk.variant.variantcontext.JEXLMap.get(JEXLMap.java:15)
        at htsjdk.variant.variantcontext.VariantContextUtils.match(VariantContextUtils.java:338)
        at org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration.matchesFilter(VariantFiltration.java:379)
        at org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration.filter(VariantFiltration.java:338)
        at org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration.apply(VariantFiltration.java:298)
        at org.broadinstitute.hellbender.engine.VariantWalkerBase.lambda$traverse$0(VariantWalkerBase.java:153)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at org.broadinstitute.hellbender.engine.VariantWalkerBase.traverse(VariantWalkerBase.java:151)
        at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:966)
        at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:139)
        at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:192)
        at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:211)
        at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:160)
        at org.broadinstitute.hellbender.Main.mainEntry(Main.java:203)
        at org.broadinstitute.hellbender.Main.main(Main.java:289)
Using GATK jar /opt/conda/share/gatk4-4.0.11.0-0/gatk-package-4.0.11.0-local.jar defined in environment variable GATK_LOCAL_JAR
Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=8 -Xms4G -Xmx6G -Djava.io.tmpdir=. -jar /opt/conda/share/gatk4-4.0.11.0-0/gatk-package-4.0.11.0-local.jar VariantFiltration -V indels.vcf.gz -O indels.flt.vcf.gz --filter-expression QD < 2.0 --filter-name lowQD --filter-expression MQ < 20.0 --filter-name lowMQ --filter-expression FS > 200.0 --filter-name highFS --filter-expression SOR > 10.0 --filter-name highSOR --filter-expression ReadPosRankSum < -20.0 --filter-name lowReadPosRankSum --filter-expression InbreedingCoeff < -0.8 --filter-name lowInbreedingCoeff

In an upstream stage I have passed my VCF through bcftools. Some digging led me to find that bcftools (view, norm, etc) will apparently convert fields such as "MQ=NaN" to "MQ=nan" when writing VCF.

This issue has been reported to the bcftools team but has been closed as "wontfix", see here.


Return to top