Skip to content

Instantly share code, notes, and snippets.

@williamrowell
Created April 30, 2020 02:54
Show Gist options
  • Save williamrowell/433224df1858c8e30bf11ea02c85f05d to your computer and use it in GitHub Desktop.
Save williamrowell/433224df1858c8e30bf11ea02c85f05d to your computer and use it in GitHub Desktop.
Simplified DeepVariant singularity wrappers for small PacBio datasets

Simplified DeepVariant singularity wrappers for small PacBio datasets

Adapted from DeepVariant documentation.

CPU-only

# pull docker image (only need to do this once)
BIN_VERSION=0.10.0
singularity pull docker://google/deepvariant:"${BIN_VERSION}"

# run DeepVariant
REF=/path/to/reference.fasta INPUT=ccs.bam bash run_deepvariant.sh

GPU accelerated calling

# pull docker image (only need to do this once)
BIN_VERSION=0.10.0-gpu
singularity pull docker://google/deepvariant:"${BIN_VERSION}"

# run DeepVariant
REF=/path/to/reference.fasta INPUT=ccs.bam bash run_deepvariant_gpu.sh
#!/bin/bash
set -x
BIN_VERSION=0.10.0
OUTPUTDIR=${PWD}/${OUTPUT:-deepvariant}
mkdir "${OUTPUTDIR}"
# BIN_VERSION=0.10.0
# singularity pull docker://google/deepvariant:"${BIN_VERSION}"
time singularity exec --bind $PWD,/scratch:/tmp,/usr/lib/locale/,${REF%/*} \
docker://google/deepvariant:"${BIN_VERSION}" \
/opt/deepvariant/bin/run_deepvariant \
--model_type PACBIO \
--ref "${REF}" \
--reads "${INPUT}" \
--output_vcf "${OUTPUTDIR}/output.vcf.gz" \
--num_shards $(nproc)
set +x
#!/bin/bash
set -x
CUDA_VISIBLE_DEVICES=0 # run on first device
BIN_VERSION=0.10.0-gpu
OUTPUTDIR=${PWD}/${OUTPUT:-deepvariant}
mkdir "${OUTPUTDIR}"
# BIN_VERSION=0.10.0-gpu
# singularity pull docker://google/deepvariant:"${BIN_VERSION}"
time singularity exec --nv --bind $PWD,/scratch:/tmp,/usr/lib/locale/,${REF%/*} \
docker://google/deepvariant:"${BIN_VERSION}" \
/opt/deepvariant/bin/run_deepvariant \
--model_type PACBIO \
--ref "${REF}" \
--reads "${INPUT}" \
--output_vcf "${OUTPUTDIR}/output.vcf.gz" \
--num_shards $(nproc)
set +x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment