2
$\begingroup$

I ran the following code in bash (I added print statements for ease):

# Module loading

echo "I am loading the specified modules"

module load Singularity/version_number

# Define the path to the singularity:

singularity_image="/path/to/folder/GATK/gatk_latest.sif"

echo "I am going to make the `.dict ` file"

singularity exec $singularity_image /gatk/gatk --java-options -Xms8000m \
  CreateSequenceDictionary \
  -R /path/to/my/primary_assembly.fa \
  -O /path/to/the/primary_assembly.dict

echo "I am all done"

However, I get the following out file:

I am loading the specified modules
job_scripts_number: line 23:
.dict: command not found I am going to make the  file 
INFO  NativeLibraryLoader - Loading libgkl_compression.so from
jar:file:/gatk/gatk-package-4.4.0.0-local.jar!/path/to/libgkl_compression.so [Today's date] CreateSequenceDictionary --OUTPUT
path/to/my/primary_assembly.dict
--REFERENCE /path/to/my/primary_assembly.fa
--TRUNCATE_NAMES_AT_WHITESPACE true --NUM_SEQUENCES 2147483647 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 2 --MAX_RECORDS_IN_RAM 999999 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false [Today's date] Executing as user@node_number on Linux version
; OpenJDK 64-Bit Server VM version;
Deflater: A; Inflater: A; Provider is available; Picard
version: Version:4.4.0.0 [Today's date]
picard.sam.CreateSequenceDictionary done. Elapsed time: 0.53 minutes.
Runtime.totalMemory()=8388608000 Tool returned: 0 Using GATK jar
/gatk/gatk-package-4.4.0.0-local.jar Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xms8000m -jar /gatk/gatk-package-4.4.0.0-local.jar CreateSequenceDictionary -R
/path/to/primary_assembly.fa
-O /path/to/primary_assembly.dict
I am all done

Why would I get the error ".dict: command not found I am going to make the file " especially when I look at the head of the .dict file and it seems to look the way it should?

$\endgroup$
1
  • $\begingroup$ To make debugging easier, ensure you include #!/bin/bash and set -eo pipefail as the first and second lines of your script. The former specifies the interpreter and the latter fails the entire script the moment one command fails. If you'd had that line, your script would have stopped executing at .dict: command not found and the last line of your STDERR would tell you where the problem was. $\endgroup$
    – Ram RS
    Apr 13 at 14:27

1 Answer 1

5
$\begingroup$

This has nothing to do with Singularity/Docker or GATK. You get the error .dict: command not found because you've used backticks to perform a command substitution in a prior echo command:

echo "I am going to make the `.dict ` file"

Backticks are legacy syntax, you could have also written:

echo "I am going to make the $(.dict) file"

But neither of these makes any sense - there is no .dict command. Of course single quotes would prevent the command substitution:

echo 'I am going to make the `.dict` file'

But this might cause some confusion when the output is displayed. A better choice would be to use double quotes, but without the backticks. For example:

echo "I am going to make the '.dict' file"
$\endgroup$
1
  • $\begingroup$ It worked! Thank you I used the echo "I am going to make the '.dict' file" $\endgroup$
    – Indira
    Apr 11 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.