In recalibrating base quality scores step, I am trying to create a calibration table using BaseRecalibrator tool of GATK. Firstly, I have generated fai file by samtools faidx and dictionary by GATK CreateSequenceDictionary from the reference genome hg38.fa.
However, when I run the BaseCalibrator it says java.lang.IllegalArgumentException: Something went wrong with sequence dictionary detection, check that reference has a valid sequence dictionary. To be more specific, I get this:
17:01:16.440 WARN NativeLibraryLoader - Unable to find native library: native/gkl_compression.dll
17:01:16.448 WARN NativeLibraryLoader - Unable to find native library: native/gkl_compression.dll
17:01:16.558 INFO BaseRecalibrator - ------------------------------------------------------------
17:01:16.559 INFO BaseRecalibrator - The Genome Analysis Toolkit (GATK) v4.2.6.1
17:01:16.560 INFO BaseRecalibrator - For support and documentation go to https://software.broadinstitute.org/gatk/
17:01:16.563 INFO BaseRecalibrator - Executing as Arda@DESKTOP-SVMGMAP on Windows 10 v10.0 x86
17:01:16.564 INFO BaseRecalibrator - Java runtime: Java HotSpot(TM) Client VM v1.8.0_341-b10
17:01:16.564 INFO BaseRecalibrator - Start Date/Time: 09 Austos 2022 Sal² 17:01:16 EET
17:01:16.565 INFO BaseRecalibrator - ------------------------------------------------------------
17:01:16.566 INFO BaseRecalibrator - ------------------------------------------------------------
17:01:16.567 INFO BaseRecalibrator - HTSJDK Version: 2.24.1
17:01:16.567 INFO BaseRecalibrator - Picard Version: 2.27.1
17:01:16.568 INFO BaseRecalibrator - Built for Spark Version: 2.4.5
17:01:16.568 INFO BaseRecalibrator - HTSJDK Defaults.COMPRESSION_LEVEL : 2
17:01:16.569 INFO BaseRecalibrator - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
17:01:16.569 INFO BaseRecalibrator - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
17:01:16.570 INFO BaseRecalibrator - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
17:01:16.570 INFO BaseRecalibrator - Deflater: JdkDeflater
17:01:16.571 INFO BaseRecalibrator - Inflater: JdkInflater
17:01:16.573 INFO BaseRecalibrator - GCS max retries/reopens: 20
17:01:16.574 INFO BaseRecalibrator - Requester pays: disabled
17:01:16.576 INFO BaseRecalibrator - Initializing engine
17:01:16.638 WARN IntelInflaterFactory - IntelInflater is not supported, using Java.util.zip.Inflater
17:01:16.643 WARN IntelInflaterFactory - IntelInflater is not supported, using Java.util.zip.Inflater
17:01:17.278 INFO FeatureManager - Using codec VCFCodec to read file file:///D:/--/gatk-4.2.6.1/known-sites/resources_broad_hg38_v0_1000G_phase1.snps.high_confidence.hg38.vcf
17:01:17.322 INFO FeatureManager - Using codec VCFCodec to read file file:///D:/--/gatk-4.2.6.1/known-sites/resources_broad_hg38_v0_Homo_sapiens_assembly38.dbsnp138.vcf
17:01:17.383 INFO FeatureManager - Using codec VCFCodec to read file file:///D:/--/gatk-4.2.6.1/known-sites/resources_broad_hg38_v0_Mills_and_1000G_gold_standard.indels.hg38.vcf
17:01:17.442 INFO BaseRecalibrator - Shutting down engine
[09 Ağustos 2022 Salı 17:01:17 EET] org.broadinstitute.hellbender.tools.walkers.bqsr.BaseRecalibrator done. Elapsed time: 0.02 minutes.
Runtime.totalMemory()=34865152
java.lang.IllegalArgumentException: Something went wrong with sequence dictionary detection, check that reference has a valid sequence dictionary
at org.broadinstitute.hellbender.utils.Utils.nonNull(Utils.java:643)
at org.broadinstitute.hellbender.utils.SequenceDictionaryUtils.validateDictionaries(SequenceDictionaryUtils.java:149)
at org.broadinstitute.hellbender.utils.SequenceDictionaryUtils.validateDictionaries(SequenceDictionaryUtils.java:98)
at org.broadinstitute.hellbender.engine.GATKTool.validateSequenceDictionaries(GATKTool.java:796)
at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:731)
at org.broadinstitute.hellbender.engine.ReadWalker.onStartup(ReadWalker.java:51)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:138)
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)
I thought something might be wrong with dictionary file and realized it only includes this line:
@HD VN:1.6
I don't think this is what it should look like. Repeating the generating dict file yielded the same output. Now, I am not sure if I should really use hg38.fa as reference. Because the lack of documentation, there is no clear statements regarding to choice of reference. I couldn't sort out what's the wrong with my code.
If it's required, this is what I run:
java -jar gatk-package-4.2.6.1-local.jar BaseRecalibrator -I data/markdup1.bam -R ref/hg38.fa --known-sites known-sites/resources_broad_hg38_v0_1000G_phase1.snps.high_confidence.hg38.vcf --known-sites known-sites/resources_broad_hg38_v0_Homo_sapiens_assembly38.dbsnp138.vcf --known-sites known-sites/resources_broad_hg38_v0_Mills_and_1000G_gold_standard.indels.hg38.vcf -O data/recal_data1.table
1 answer
Running the command on Linux terminal instead of Windows command line solved the problem.
Log in to answer this question.
how did you generate the file hg38.fa ? what is the output of
grep ">" hg38.fa | head?The output is:
Downloaded hg38.fa from here https://hgdownload.cse.ucsc.edu/goldenpath/hg38/bigZips/latest/
UPDATE: Downloaded latest hg38 from NCBI and generated a dict file, the result is the same. It yields a file with single line. I recorded the output of CreateSequenceDictionary. Although it executes the function, it produces this warning and Java exception: