Answers.Body: <p>This has nothing to do with Singularity/Docker or GATK. You get the error <code>.dict: command not found</code> because you've used backticks to perform a <a href="https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html" rel="noreferrer">command substitution</a> in a prior <code>echo</code> command:</p>
  <blockquote>
  <p><code>echo &quot;I am going to make the `.dict ` file&quot;</code></p>
  </blockquote>
  <p>Backticks are legacy syntax, you could have also written:</p>
  <pre><code>echo &quot;I am going to make the $(.dict) file&quot;
  </code></pre>
  <p>But neither of these makes any sense - there is no <code>.dict</code> command. Of course single quotes would prevent the command substitution:</p>
  <pre><code>echo 'I am going to make the `.dict` file'
  </code></pre>
  <p>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:</p>
  <pre><code>echo &quot;I am going to make the '.dict' file&quot;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T13:23:28.810Z
Answers.Text: It worked! Thank you I used the `echo "I am going to make the '.dict' file"`
Answers.UserDisplayName: Indira
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-10T22:44:45.163Z
Answers.LastActivityDate: 2023-04-10T23:12:23.940Z
Answers.LastEditDate: 2023-04-10T23:12:23.940Z
Answers.UserDisplayName: Steve
Body: <p>I ran the following code in bash (I added print statements for ease):</p>
  <pre><code># Module loading
  
  echo &quot;I am loading the specified modules&quot;
  
  module load Singularity/version_number
  
  # Define the path to the singularity:
  
  singularity_image=&quot;/path/to/folder/GATK/gatk_latest.sif&quot;
  
  echo &quot;I am going to make the `.dict ` file&quot;
  
  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 &quot;I am all done&quot;
  </code></pre>
  <p>However, I get the following <code>out</code> file:</p>
  <pre><code>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
  </code></pre>
  <p>Why would I get the error &quot;.dict: command not found I am going to make the  file &quot; especially when I look at the <code>head</code> of the .dict file and it seems to look the way it should?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-13T14:27:01.873Z
Comments.Text: 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.
Comments.UserDisplayName: Ram RS
Tags: <gatk><docker><dictionary><singularity>
Title: Singularity & GATK 4.4.0.0. CreateSequenceDictionary
ThreadText: # Singularity & GATK 4.4.0.0. CreateSequenceDictionary
  
  (Asked by: username_0 on 2023-04-10)
  
  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?
  
  **Tags:** gatk, docker, dictionary, singularity
  
  > **Comments:**
  > **username_1**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-04-10. Score: 5 | Accepted answer
  
  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](https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html) 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"
  
  ```
  
  > **Comments:**
  > **username_0**: It worked! Thank you I used the `echo "I am going to make the '.dict' file"`  
  
  ---
  
  