This is a test version of Biostars. For the public version, visit https://www.biostars.org.
picard CreateSequenceDictionary errors when trying to make a .dict file

I'm trying to use picard to index my reference file, but I get the error below. I can't seem to find a solution online by searching the errors.

REF=~/refs/hg38/chr4.fa
ACC=chr4
picard CreateSequenceDictionary REFERENCE="$REF" OUTPUT="~/refs/hg38/${ACC}.dict"

Throws this error:

[Fri Feb 23 11:32:26 GMT 2024] picard.sam.CreateSequenceDictionary done. Elapsed time: 0.01 minutes.
Runtime.totalMemory()=538968064
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" picard.PicardException: File /Users/michaelflower/~/refs/hg38/chr4.dict not found
    at picard.sam.CreateSequenceDictionary.doWork(CreateSequenceDictionary.java:221)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:305)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
picard dict

1 answer

Try using a full path, I think the tilde ~ is confusing the tool.

#instead of this
picard CreateSequenceDictionary REFERENCE="$REF" OUTPUT="~/refs/hg38/${ACC}.dict"
#use
picard CreateSequenceDictionary REFERENCE="$REF" OUTPUT="/my/home/refs/hg38/${ACC}.dict"

Log in to answer this question.