Answers.Body: <p>Assuming you've pulled the latest <a href="https://hub.docker.com/r/broadinstitute/picard" rel="nofollow noreferrer">broadinstitute/picard</a> container, your first attempt should have produced the expected result:</p>
  <pre><code>$ singularity exec picard_latest.sif find / -name &quot;picard.jar&quot; 2&gt;/dev/null
  /usr/picard/picard.jar
  </code></pre>
  <p>And then to run Picard and display the usage, you would use:</p>
  <pre><code>$ singularity exec picard_latest.sif java -jar /usr/picard/picard.jar -h
  USAGE: PicardCommandLine &lt;program name&gt; [-h]
  
  ...
  </code></pre>
  <p>Note that there's now a newer <a href="https://github.com/broadinstitute/picard/releases" rel="nofollow noreferrer">release</a> of Picard, which uses a much newer version of Java. There's no <a href="https://hub.docker.com/r/broadinstitute/picard/tags" rel="nofollow noreferrer">tag</a> for this on Docker Hub (yet). So if you wanted the 'latest', you could try using the quay.io biocontainer:</p>
  <pre><code><span class="math-container">$ singularity pull docker://quay.io/biocontainers/picard:3.0.0--hdfd78af_1
  $</span> singularity exec picard_3.0.0--hdfd78af_1.sif picard -h
  USAGE: PicardCommandLine &lt;program name&gt; [-h]
  
  ...
  </code></pre>
  <p>Note that the Bioconda build system also builds Docker containers and these are uploaded to <a href="https://quay.io/" rel="nofollow noreferrer">quay.io</a> as part of the <a href="https://quay.io/organization/biocontainers" rel="nofollow noreferrer">Biocontainers project</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T00:45:33.427Z
Answers.Text: `singularity exec picard_latest.sif /bin/bash -c "ls /usr/picard/"` does show the jar file there however, `singularity exec picard_latest.sif find / -name "picard.jar" 2>/dev/null` does not seem to work. Out of curiosity when I use your `usr/picard/picard.jar` path I get an out file with an error `Error: Invalid or corrupt jarfile /path/to/picard_latest.sif` - the path is correct why would it give this error? The main two lines of my code are ```java -jar ${dir} /usr/picard/picard.jar \
      BedToIntervalList \```
Answers.UserDisplayName: Indira
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T01:05:56.467Z
Answers.Text: @Indira Do you mean where _dir_ is a path to your _picard_latest.sif_? I think you may have pointed to your GATK sif file. When you say the `find` command does not seem to work, what do you mean exactly? If it is just slow, try `find /usr/picard ...`
Answers.UserDisplayName: Steve
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T01:07:23.423Z
Answers.Text: I wrote it wrong in the comment - the path for the `dir` is to the `picard_latest.sif`
Answers.UserDisplayName: Indira
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T01:10:05.017Z
Answers.Text: When I say the `find` command did not work I mean that all it did was not produce a result - it kept running but didn't produce any result.
Answers.UserDisplayName: Indira
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T01:17:40.253Z
Answers.Text: @Indira So did the command complete with a zero exit status or did you end up needing to interrupt it with <ctrl-c>? I see the mistake in your code, it should be: `singularity exec "${sif}" java -jar /usr/picard/picard.jar BedToIntervalList`
Answers.UserDisplayName: Steve
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T11:42:30.690Z
Answers.Text: Thank you. The above worked. It seems like I have multiple small errors but they should be fixable.
Answers.UserDisplayName: Indira
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T00:10:14.167Z
Answers.LastActivityDate: 2023-04-14T00:13:28.940Z
Answers.LastEditDate: 2023-04-14T00:13:28.940Z
Answers.UserDisplayName: Steve
Body: <p>I am trying to run Picard in Singularity and try as I might I cannot seem to find the path to use. For example with GATK 4.4.0.0 I use the following path:</p>
  <pre><code>singularity exec $singularity_image /gatk/gatk --java-options -Xms8000m \
  
  </code></pre>
  <p>where <code>singularity_image</code> is a variable that encodes the path to the gatk.sif. However, I cannot seem to figure out the path I need to use for picard.</p>
  <p>When I look inside the Singularity file with the following code:</p>
  <pre><code>singularity exec picard_latest.sif /bin/bash -c &quot;ls /&quot;
  </code></pre>
  <p>I get the following:</p>
  <pre><code>bin  boot  dev  environment  etc  home  lib  lib32  lib64  libx32  media  mnt  opt  proc  root  run  sbin  singularity  srv  sys  tmp  usr  var
  </code></pre>
  <p><strong>Attempt 1: Using Find</strong></p>
  <pre><code>singularity exec picard_latest.sif find / -name &quot;picard.jar&quot; 2&gt;/dev/null
  </code></pre>
  <p>However, this gave no results.</p>
  <p><strong>Attempt 2: Going Down The Opt Path</strong></p>
  <pre><code>singularity exec picard_latest.sif /bin/bash -c &quot;ls /opt/&quot;
  </code></pre>
  <p>This led to a file called <code>java</code> and that had only one file in it called <code>openjdk</code> so that seemed to be where java was stored.</p>
  <p><strong>Attempt 3: Looking In Boot</strong></p>
  <pre><code>singularity exec picard_latest.sif /bin/bash -c &quot;ls /boot/&quot;
  </code></pre>
  <p>This yielded no results as it seems to be an empty file.</p>
  <p>I have made other attempts but I cannot seem to establish the path I should use. I cannot change the java directly as it is preset on my cluster.</p>
  <p>Does anyone know what the path would be for the latest version of Picard or could point me to how to look for this as I cannot seem to find this?</p>
  
Tags: <picard><singularity>
Title: Singularity & Picard
ThreadText: # Singularity & Picard
  
  (Asked by: username_0 on 2023-04-13)
  
  I am trying to run Picard in Singularity and try as I might I cannot seem to find the path to use. For example with GATK 4.4.0.0 I use the following path:
  
  ```
  singularity exec $singularity_image /gatk/gatk --java-options -Xms8000m \
  
  ```
  
  where `singularity_image` is a variable that encodes the path to the gatk.sif. However, I cannot seem to figure out the path I need to use for picard.
  
  When I look inside the Singularity file with the following code:
  
  ```
  singularity exec picard_latest.sif /bin/bash -c "ls /"
  
  ```
  
  I get the following:
  
  ```
  bin  boot  dev  environment  etc  home  lib  lib32  lib64  libx32  media  mnt  opt  proc  root  run  sbin  singularity  srv  sys  tmp  usr  var
  
  ```
  
  **Attempt 1: Using Find**
  
  ```
  singularity exec picard_latest.sif find / -name "picard.jar" 2>/dev/null
  
  ```
  
  However, this gave no results.
  
  **Attempt 2: Going Down The Opt Path**
  
  ```
  singularity exec picard_latest.sif /bin/bash -c "ls /opt/"
  
  ```
  
  This led to a file called `java` and that had only one file in it called `openjdk` so that seemed to be where java was stored.
  
  **Attempt 3: Looking In Boot**
  
  ```
  singularity exec picard_latest.sif /bin/bash -c "ls /boot/"
  
  ```
  
  This yielded no results as it seems to be an empty file.
  
  I have made other attempts but I cannot seem to establish the path I should use. I cannot change the java directly as it is preset on my cluster.
  
  Does anyone know what the path would be for the latest version of Picard or could point me to how to look for this as I cannot seem to find this?
  
  **Tags:** picard, singularity
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-14. Score: 2 | Accepted answer
  
  Assuming you've pulled the latest [broadinstitute/picard](https://hub.docker.com/r/broadinstitute/picard) container, your first attempt should have produced the expected result:
  
  ```
  $ singularity exec picard_latest.sif find / -name "picard.jar" 2>/dev/null
  /usr/picard/picard.jar
  
  ```
  
  And then to run Picard and display the usage, you would use:
  
  ```
  $ singularity exec picard_latest.sif java -jar /usr/picard/picard.jar -h
  USAGE: PicardCommandLine <program name> [-h]
  
  ...
  
  ```
  
  Note that there's now a newer [release](https://github.com/broadinstitute/picard/releases) of Picard, which uses a much newer version of Java. There's no [tag](https://hub.docker.com/r/broadinstitute/picard/tags) for this on Docker Hub (yet). So if you wanted the 'latest', you could try using the quay.io biocontainer:
  
  ```
  $ singularity pull docker://quay.io/biocontainers/picard:3.0.0--hdfd78af_1
  $ singularity exec picard_3.0.0--hdfd78af_1.sif picard -h
  USAGE: PicardCommandLine <program name> [-h]
  
  ...
  
  ```
  
  Note that the Bioconda build system also builds Docker containers and these are uploaded to [quay.io](https://quay.io/) as part of the [Biocontainers project](https://quay.io/organization/biocontainers).
  
  > **Comments:**
  > **username_0**: `singularity exec picard_latest.sif /bin/bash -c "ls /usr/picard/"` does show the jar file there however, `singularity exec picard_latest.sif find / -name "picard.jar" 2>/dev/null` does not seem to work. Out of curiosity when I use your `usr/picard/picard.jar` path I get an out file with an error `Error: Invalid or corrupt jarfile /path/to/picard_latest.sif` - the path is correct why would it give this error? The main two lines of my code are ```java -jar ${dir} /usr/picard/picard.jar \     BedToIntervalList \```  
  > **username_1**: @username_0 Do you mean where _dir_ is a path to your _picard_latest.sif_? I think you may have pointed to your GATK sif file. When you say the `find` command does not seem to work, what do you mean exactly? If it is just slow, try `find /usr/picard ...`  
  > **username_0**: I wrote it wrong in the comment - the path for the `dir` is to the `picard_latest.sif`  
  > **username_0**: When I say the `find` command did not work I mean that all it did was not produce a result - it kept running but didn't produce any result.  
  > **username_1**: @username_0 So did the command complete with a zero exit status or did you end up needing to interrupt it with <ctrl-c>? I see the mistake in your code, it should be: `singularity exec "${sif}" java -jar /usr/picard/picard.jar BedToIntervalList`  
  > **username_0**: Thank you. The above worked. It seems like I have multiple small errors but they should be fixable.  
  
  ---
  
  