This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Building Dict File for GATK

I'm going through the instructions page on https://gatkforums.broadinstitute.org/gatk/discussion/1601/how-can-i-prepare-a-fasta-file-to-use-as-reference

Specifically, the command I don't see how to do is:

java -jar CreateSequenceDictionary.jar R= Homo_sapiens_assembly18.fasta O= Homo_sapiens_assembly18.dict
[Fri Jun 19 14:09:11 EDT 2009] net.sf.picard.sam.CreateSequenceDictionary R= Homo_sapiens_assembly18.fasta O= Homo_sapiens_assembly18.dict
[Fri Jun 19 14:09:58 EDT 2009] net.sf.picard.sam.CreateSequenceDictionary done.
Runtime.totalMemory()=2112487424
44.922u 2.308s 0:47.09 100.2%   0+0k 0+0io 2pf+0w

I think that CreateSequenceDictionary.jar comes from Picard, so I downloaded that from https://broadinstitute.github.io/picard/, but I don't see CreateSequenceDictionary.jar anywhere in the directory. However, I do see

CreateSequenceDictionary.java

I assume that .jar files are analogous to C executables, and .java files are analogous to .c human-readable code.

Going through the Picard readme file, I see that I should execute ./gradlew shadowJar but this build fails on two different computers that I'm on.

So I can't make/get CreateSequenceDictionary.jar

I'm at a loss, how do I generate this dict file?

java gatk

4 answers

Picard is a wrapper command that will run the subcommands. There is no single executable for each subcommand. Simply run picard.jar and then check the output printed to screen for the subcommand you want. Then run java -jar picard.jar <subcommand>

this was a comedy of errors on my part, I seemed to have clicked every wrong button and done everything wrong on the way. Thanks for your help ATpoint!

You're very welcome, and don't worry. In general, whenever I want to learn sth. about a tool simply running the main application without any arguments often helps since most tools then print some kind of help message that can get you started :)

Change your command to the following:

java -jar picard.jar CreateSequenceDictionary R=Homo_sapiens_assembly18.fasta O=Homo_sapiens_assembly18.dict

Run GATK command gatk command if gatk is installed, you can run gatk CreateSequenceDictionary in your case. Or java -jar gatk.jar command like java -jar gatk-package-4.1.4.1-local.jar CreateSequenceDictionary. You don't have to always follow the gatk example command, picard is inside gatk.

I run it 'java -jar picard.jar CreateSequenceDictionary R=GCF_000001405.25_GRCh37.p13_genomic.fna.gz O=reference.dict' in my gatk conda. The output is 'Unable to access jarfile.picard.jar'

How to fix it?

Thanks

run it with gatk CreateSequenceDictionary

Make sure that you have installed GATK in your system.

Then follow the commands: For example, to generate .dict for Homo_sapiens_assembly38.fasta file run

GATK CreateSequenceDictionary \
    -R Homo_sapiens_assembly38.fasta\
    -O Homo_sapiens_assembly38.dict

Log in to answer this question.