<p>You need to pass the fasta file instead of fa.fai or dict file as reference</p>
<pre><code>    gatk Funcotator \
    --variant chr21.vcf \
    --reference hg38.fa \  
    --ref-version hg38 \
    --data-sources-path funcotator_dataSources.v1.2.20180329 \
    --output chr21.funcotated.maf \
    --output-file-format MAF
</code></pre>
<p>The directory where you have hg38.fa must contain also the hg38.fa.fai and hg38.dict</p>
<p>Hope this helps</p>
<p>Zhan</p>

CC BY-SA 4.0
2023-02-15T08:41:19.913Z
2023-02-15T08:41:19.913Z
yinxiu Zhan
<p>I am using a function called Funcotator (<a href="https://gatk.broadinstitute.org/hc/en-us/articles/360035889931-Funcotator-Information-and-Tutorial#1.2" rel="nofollow noreferrer">here</a>) in GATK4. The code I am trying to run is:</p>
<pre><code>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
</code></pre>
<p>However, it gives me an error message like this:</p>
<pre><code>java.lang.IllegalArgumentException: File is not a supported reference file type: /Users/data/Bam/hg38.fa.fai
at htsjdk.samtools.reference.ReferenceSequenceFileFactory.lambda<span class="math-container">$getFastaExtension$</span>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.&lt;init&gt;(CachingIndexedFastaSequenceFile.java:143)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.&lt;init&gt;(CachingIndexedFastaSequenceFile.java:125)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.&lt;init&gt;(CachingIndexedFastaSequenceFile.java:110)
at org.broadinstitute.hellbender.engine.ReferenceFileSource.&lt;init&gt;(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)
</code></pre>
<p>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 <code>--data-sources-path</code>, I just copied the one they used on their post. Could that cause any problem in the further analysis?
Thanks a lot ~~~</p>
<p>Here is an update:
I first tried <code>hg38.fa</code> as my reference and got this error:</p>
<pre><code>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.
</code></pre>
<p>So I generated the <code>hg38.fa.fai</code>, then I got the error message shown above.
Then, I tried the reference file downloaded from the GATK cloud, <code>resources-broad-hg38-v0-Homo_sapiens_assembly38.fasta.fai</code>, but the same error appeared again.</p>
<p>Another update:
I tried to use the <code>hg38.dict</code> as the reference and used the same code:</p>
<pre><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
</code></pre>
<p>However, I got the same error message again:</p>
<pre><code>java.lang.IllegalArgumentException: File is not a supported reference file type: /Users/data/hg38.dict
</code></pre>

CC BY-SA 4.0
2022-03-16T22:27:31.257Z
Are all the files .fai, .dict and .fa in the same directory and have the same names?
Avamys
CC BY-SA 4.0
2022-03-17T15:48:52.877Z
Yeah, I think so.
Scott XU
<gatk>
Funcotator reference file error in GATK4
# Funcotator reference file error in GATK4

(Asked by: username_0 on 2022-03-16)

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.(CachingIndexedFastaSequenceFile.java:143)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.(CachingIndexedFastaSequenceFile.java:125)
at org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile.(CachingIndexedFastaSequenceFile.java:110)
at org.broadinstitute.hellbender.engine.ReferenceFileSource.(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

**Tags:** gatk
> **Comments:**
> **username_1**: Are all the files .fai, .dict and .fa in the same directory and have the same names?  
> **username_0**: Yeah, I think so.  

---

## 1 answers

### Answer by username_2 on 2023-02-15. Score: 1

You need to pass the fasta file instead of fa.fai or dict file as reference
    gatk Funcotator \
    --variant chr21.vcf \
    --reference hg38.fa \  
    --ref-version hg38 \
    --data-sources-path funcotator_dataSources.v1.2.20180329 \
    --output chr21.funcotated.maf \
    --output-file-format MAF

The directory where you have hg38.fa must contain also the hg38.fa.fai and hg38.dict
Hope this helps
Zhan


---

