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 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?


1 Answer 1


Assuming you've pulled the latest broadinstitute/picard container, your first attempt should have produced the expected result:

$ singularity exec picard_latest.sif find / -name "picard.jar" 2>/dev/null

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 of Picard, which uses a much newer version of Java. There's no tag 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 as part of the Biocontainers project.

  • $\begingroup$ 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 \ $\endgroup$
    – Indira
    Commented Apr 14, 2023 at 0:45
  • $\begingroup$ @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 ... $\endgroup$
    – Steve
    Commented Apr 14, 2023 at 1:05
  • $\begingroup$ I wrote it wrong in the comment - the path for the dir is to the picard_latest.sif $\endgroup$
    – Indira
    Commented Apr 14, 2023 at 1:07
  • 1
    $\begingroup$ @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 $\endgroup$
    – Steve
    Commented Apr 14, 2023 at 1:17
  • 1
    $\begingroup$ Thank you. The above worked. It seems like I have multiple small errors but they should be fixable. $\endgroup$
    – Indira
    Commented Apr 14, 2023 at 11:42

Your Answer

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

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