I am using a function called Funcotator (here) in GATK4. The code I am trying to run is:
gatk Funcotator \
--variant chr21.vcf \
--reference hg38.fa.fai \
--ref-version hg38 \
--data-sources-path funcotator_dataSources.v1.2.20180329 \
--output chr21.funcotated.maf \
--output-file-format MAF
However, it gives me an error message like this:
java.lang.IllegalArgumentException: File is not a supported reference file type: /Users/data/Bam/hg38.fa.fai
at htsjdk.samtools.reference.ReferenceSequenceFileFactory.lambda$getFastaExtension$0(ReferenceSequenceFileFactory.java:253)
at java.util.Optional.orElseGet(Optional.java:267)
at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getFastaExtension(ReferenceSequenceFileFactory.java:253)
at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getDefaultDictionaryForReferenceSequence(ReferenceSequenceFileFactory.java:223)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.checkFastaPath(CachingIndexedFastaSequenceFile.java:180)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.<init>(CachingIndexedFastaSequenceFile.java:143)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.<init>(CachingIndexedFastaSequenceFile.java:125)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.<init>(CachingIndexedFastaSequenceFile.java:110)
at org.broadinstitute.hellbender.engine.ReferenceFileSource.<init>(ReferenceFileSource.java:35)
at org.broadinstitute.hellbender.engine.ReferenceDataSource.of(ReferenceDataSource.java:27)
at org.broadinstitute.hellbender.engine.GATKTool.initializeReference(GATKTool.java:439)
at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:722)
at org.broadinstitute.hellbender.engine.VariantWalker.onStartup(VariantWalker.java:45)
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)
Does anyone know how to solve this problem? I tried to use the reference file downloaded from the GATK cloud, but it still doesn't work and has the same error message.
Also, I wonder if the reference files must be the version provided by the GATK team? The one I am using now is not from the GATK team, and as they force me to provide --data-sources-path
, I just copied the one they used on their post. Could that cause any problem in the further analysis?
Thanks a lot ~~~
Here is an update:
I first tried hg38.fa
as my reference and got this error:
A USER ERROR has occurred: Fasta dict file file:///Users/data/Bam/hg38.dict for reference file:///Users/data/Bam/hg38.fa does not exist. Please see http://gatkforums.broadinstitute.org/discussion/1601/how-can-i-prepare-a-fasta-file-to-use-as-reference for help creating it.
So I generated the hg38.fa.fai
, then I got the error message shown above.
Then, I tried the reference file downloaded from the GATK cloud, resources-broad-hg38-v0-Homo_sapiens_assembly38.fasta.fai
, but the same error appeared again.
Another update:
I tried to use the hg38.dict
as the reference and used the same code:
gatk Funcotator \
--variant chr21.vcf \
--reference hg38.dict \
--ref-version hg38 \
--data-sources-path funcotator_dataSources.v1.2.20180329 \
--output chr21.funcotated.maf \
--output-file-format MAF
However, I got the same error message again:
java.lang.IllegalArgumentException: File is not a supported reference file type: /Users/data/hg38.dict