BBTools is a suite of fast, multithreaded bioinformatics tools designed for analysis of DNA and RNA sequence data.
The BBTools suite includes programs such as:
• bbduk – filters or trims reads for adapters and contaminants using k-mers
• bbmap – short-read aligner for DNA and RNA-seq data
To run BBTools, you need to have Java 7 or higher installed.
https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/installation-guide/
# Assumes current working directory is the top-level bbtools-docker-singularity directory
docker build -t bbtools:39.01 . # tag should match software version
- Can do this on Google shell
docker run --rm -it bbtools:39.01 java --version # verify java installation
docker run --rm -it bbtools:39.01 bbduk.sh --version # FAIL due to a bug in bbduk.sh when it should calculate memory usage (container only??) (also present in 38.90)
docker run --rm -it bbtools:39.01 bbduk.sh -Xmx500m --version # PASS specifying memory manualy (and may be better on HPC)
docker run --rm -it bbtools:39.01 bbduk.sh --help # PASS but help comes from the shell script and does not use java
docker run --rm -it bbtools:39.01 stats.sh --version # PASS
docker run --rm -it bbtools:38.90 bash -c "stats.sh in=/usr/local/bin/resources/phix174_ill.ref.fa.gz" # TEST with internal data - PASS so does not have same issue with memory calc
See issue here: https://www.biostars.org/p/372460/
(skip if this image is already on your system)
https://github.com/mattgalbraith/singularity-docker
docker images
docker save <Image_ID> -o bbtools39.01-docker.tar && gzip bbtools39.01-docker.tar # = IMAGE_ID of BBTools image
docker run -v "$PWD":/data --rm -it singularity:1.1.5 bash -c "singularity build /data/bbtools39.01.sif docker-archive:///data/bbtools39.01-docker.tar.gz"
NB: On Apple M1/M2 machines ensure Singularity image is built with x86_64 architecture or sif may get built with arm64
Next, transfer the bbtools.sif file to the system on which you want to run BBTools from the Singularity container
# set up path to the BBTools Singularity container
BBTOOLS_SIF=path/to/bbtools39.01.sif
# Test that BBTools can run from Singularity container
singularity run $BBTOOLS_SIF bbduk.sh -Xmx500m --version # depending on system/version, singularity may be called apptainer