gatk4 gatk VariantFiltration 报错

我分染色体执行GATK硬过滤的时候出现发现输出文件显著小于原文件,报错内容如下

(base) [jychu@localhost chr_hardf gatk VariantFiltration  -R /public/jychu/refs/Gallus_gallus.GRCg6a.dna.toplevel.fa  -V chr2-1_typed.snp.vcf  --filter-expression " QUAL < 30.0 || QD < 2.0 || MQ < 40.0 || FS > 60.0 || SOR > 3.0 || MQRankSum < -12.5 || ReadPosRankSum < -8.0"  --filter-name "my_snp_filters"  -O chr2_typed.snp.filter2.vcf
Using GATK jar /public/jychu/soft/gatk-4.1.9.0/gatk-package-4.1.9.0-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=2 -jar /public/jychu/soft/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar VariantFiltration -R /public/jychu/refs/Gallus_gallus.GRCg6a.dna.toplevel.fa -V chr2-1_typed.snp.vcf --filter-expression  QUAL < 30.0 || QD < 2.0 || MQ < 40.0 || FS > 60.0 || SOR > 3.0 || MQRankSum < -12.5 || ReadPosRankSum < -8.0 --filter-name my_snp_filters -O chr2_typed.snp.filter2.vcf
10:32:26.101 INFO  NativeLibraryLoader - Loading libgkl_compression.so from jar:file:/public/jychu/soft/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar!/com/intel/gkl/native/libgkl_compression.so
Apr 12, 2021 10:32:26 AM shaded.cloud_nio.com.google.auth.oauth2.ComputeEngineCredentials runningOnComputeEngine
INFO: Failed to detect whether we are running on Google Compute Engine.
10:32:26.456 INFO  VariantFiltration - ------------------------------------------------------------
10:32:26.456 INFO  VariantFiltration - The Genome Analysis Toolkit (GATK) v4.1.9.0
10:32:26.456 INFO  VariantFiltration - For support and documentation go to https://software.broadinstitute.org/gatk/
10:32:26.457 INFO  VariantFiltration - Executing as jychu@localhost.localdomain on Linux v3.10.0-1062.el7.x86_64 amd64
10:32:26.457 INFO  VariantFiltration - Java runtime: OpenJDK 64-Bit Server VM v1.8.0_152-release-1056-b12
10:32:26.457 INFO  VariantFiltration - Start Date/Time: April 12, 2021 10:32:26 AM CST
10:32:26.457 INFO  VariantFiltration - ------------------------------------------------------------
10:32:26.457 INFO  VariantFiltration - ------------------------------------------------------------
10:32:26.458 INFO  VariantFiltration - HTSJDK Version: 2.23.0
10:32:26.458 INFO  VariantFiltration - Picard Version: 2.23.3
10:32:26.458 INFO  VariantFiltration - HTSJDK Defaults.COMPRESSION_LEVEL : 2
10:32:26.458 INFO  VariantFiltration - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
10:32:26.458 INFO  VariantFiltration - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
10:32:26.458 INFO  VariantFiltration - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
10:32:26.458 INFO  VariantFiltration - Deflater: IntelDeflater
10:32:26.459 INFO  VariantFiltration - Inflater: IntelInflater
10:32:26.459 INFO  VariantFiltration - GCS max retries/reopens: 20
10:32:26.459 INFO  VariantFiltration - Requester pays: disabled
10:32:26.459 INFO  VariantFiltration - Initializing engine
10:32:26.969 INFO  FeatureManager - Using codec VCFCodec to read file file:///public/jychu/chicken_body_size/project/chr_hardfilter/chr2-1_typed.snp.vcf
10:32:27.008 INFO  VariantFiltration - Done initializing engine
10:32:27.076 INFO  ProgressMeter - Starting traversal
10:32:27.076 INFO  ProgressMeter -        Current Locus  Elapsed Minutes    Variants Processed  Variants/Minute
10:32:27.097 INFO  VariantFiltration - Shutting down engine
[April 12, 2021 10:32:27 AM CST] org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration done. Elapsed time: 0.02 minutes.
Runtime.totalMemory()=2081947648
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.visit(Interpreter.java:1283)
        at org.apache.commons.jexl2.parser.ASTOrNode.jjtAccept(ASTOrNode.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1274)
        at org.apache.commons.jexl2.parser.ASTOrNode.jjtAccept(ASTOrNode.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1274)
        at org.apache.commons.jexl2.parser.ASTOrNode.jjtAccept(ASTOrNode.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1274)
        at org.apache.commons.jexl2.parser.ASTOrNode.jjtAccept(ASTOrNode.java:18)
        at org.apache.commons.jexl2.Interpreter.visit(Interpreter.java:1274)
        at org.apache.commons.jexl2.parser.ASTOrNode.jjtAccept(ASTOrNode.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:453)
        at org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration.filter(VariantFiltration.java:407)
        at org.broadinstitute.hellbender.tools.walkers.filters.VariantFiltration.apply(VariantFiltration.java:354)
        at org.broadinstitute.hellbender.engine.VariantWalker.lambda$traverse$0(VariantWalker.java:104)
        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.VariantWalker.traverse(VariantWalker.java:102)
        at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1049)
        at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:140)
        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)

java.lang.NumberFormatException: For input string: "nan" 是关键
我用下面的命令查找了一下nan字符

grep "nan" chr2-1_typed.snp.vcf | less -S
2       52143528        rs736396988     T       C       2.63197e+07     PASS    AC=831;AF=0.85;AN=978;BaseQRankSum=1.44;DB;DP=866067;ExcessHet=-0;FS=0;InbreedingCoeff=0.4636;MLEAC=831;MLEAF=0.85;MQ=nan;MQRankSum=0;QD=31.94;ReadPosRankSum=0.149;SOR=0.652        GT:AD:DP:GQ:PGT:PID:PL:PS       0/1:176,260:436:99:.:.:6698,0,4122:. 0/1:187,292:479:99:.:.:7870,0,4743:.    0/0:139,0:139:99:.:.:0,120,1800:.       0/0:177,0:177:99:.:.:0,120,1800:.       0/0:111,0:111:99:.:.:0,101,1800:.    0/1:130,170:300:99:.:.:4614,0,3301:.    0/1:165,242:407:99:.:.:6602,0,4168:.    0/1:171,235:406:99:.:.:6287,0,4354:.    0/0:46,0:46:99:.:.:0,120,1800:.      1/1:2,424:426:99:.:.:13712,1221,0:.     1/1:4,3109:3115:99:.:.:104093,9185,0:.  1/1:2,3473:3483:99:.:.:115239,10331,0:. 1|1:5,3330:3341:99:1|1:52143462_A_G:113349,9837,0:52143462   1/1:0,3592:3603:99:.:.:118507,10756,0:. 0/1:1337,2419:3764:99:.:.:67702,0,32559:.       0/1:1340,2225:3568:99:.:.:62309,0,32972:.    1/1:0,787:788:99:.:.:28052,2367,0:.     1/1:0,638:639:99:.:.:23114,1919,0:.     1/1:0,898:898:99:.:.:32572,2701,0:.     1/1:2,838:840:99:.:.:30124,2482,0:.  1/1:1,759:761:99:.:.:26779,2245,0:.     1/1:0,839:841:99:.:.:29775,2524,0:.     1/1:0,718:719:99:.:.:25869,2160,0:.     1/1:0,748:751:99:.:.:26837,2250,0:.  1/1:0,857:862:99:.:.:30621,2578,0:.     1/1:1,808:823:99:.:.:28874,2394,0:.     1/1:1,735:739:99:.:.:26633,2176,0:.     1/1:0,699:703:99:.:.:25202,2103,0:.  1/1:0,619:625:99:.:.:22230,1861,0:.     1/1:1,773:780:99:.:.:27609,2319,0:.     1/1:0,681:684:99:.:.:24409,2047,0:.     1/1:1,685:689:99:.:.:24773,2026,0:.  1/1:0,929:932:99:.:.:33397,2793,0:.

我认为是不能识别这个字符,所以我把它替换为0

sed -i "s/nan/0/g" chr2-1_typed.snp.vcf
  • 结果运行成功!
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,186评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,858评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,620评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,888评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,009评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,149评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,204评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,956评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,385评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,698评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,863评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,544评论 4 335
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,185评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,899评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,141评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,684评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,750评论 2 351