Deploy NVIDIA Parabricks
Get started by deploying Parabricks using a Docker image. Then you can run and customize Parabricks.
Getting the Parabricks Docker Image
Run the following command to obtain the image:
To confirm which version of Parabricks the image contains, run pbrun version:
The last line of the output shows the version, in the form pbrun: <version>.
Running NVIDIA Parabricks
You can run Parabricks using either the command line or the base command platform.
Using the Command Line to Run Parabricks
After deploying Parabricks using a Docker image, you can begin customizing it. There are two parts to customizing a Parabricks run:
-
Customizing Docker container specific options: These are the options that are passed to the
dockercommand before the name of the container. For example, the user should mount their data directories within the Docker container by passing the-voption to Docker. Refer to the Tutorials for more detailed examples. -
Parabricks specific options: These options are passed to the Parabricks command line to customize the Parabricks run. For example, you can choose which tool to run and pass tool-specific options.
For example, use the following command to run the Parabricks fq2bam (BWA-MEM + GATK) tool using a Docker container. Refer to the tutorial for more information on how this command works.
Sample data is free and available. Refer to the Getting the Sample Data section in the Tutorials for instructions on obtaining the sample data and a step-by-step guide to using both fq2bam and Haplotype Caller.
Some useful Docker options to consider:
-
--gpus alllets the Docker container use all the GPUs on the system. The GPUs available to Parabricks container can be limited using the--gpus "device=<list of GPUs>"option. Usenvidia-smito see how many GPUs you have, and which one is which. -
--rmtells Docker to terminate the image once the command has finished. -
--volume $(pwd):/workdirand--volume $(pwd):/outputdirmount your current directory (a path on the server) in the Docker container at/workdirand/outputdir(paths inside the Docker container). To use other directories, replace$(pwd)with their paths, for example--volume /path/to/your/data:/workdir. Refer to Container Contract for how the commands in this documentation use the two mounts. -
--workdirtells Docker what working directory to execute the commands from (inside the container). -
The rest of the command is the Parabricks tool you want to run, followed by its arguments. For those familiar with pre-v4.0 versions of Parabricks and its
pbruncommand, this Docker invocation takes the place ofpbrun.
Container Contract
The docker run commands in this documentation share the following conventions and
defaults. Keep them in mind when you adapt a command to your own data.
Mounts: /workdir and /outputdir aren’t directories in the image. The commands
mount host directories at those paths, and most mount your current directory at both,
with --volume $(pwd):/workdir --volume $(pwd):/outputdir, so the two paths are the same
directory. Inputs are read from /workdir and outputs are written to /outputdir.
Multistep examples depend on this: a later step reads from /workdir a file that an
earlier step wrote to /outputdir. If you mount different host directories at the two
paths, update the paths in later steps to match.
File ownership: The container runs as root by default, so the files and directories
it creates in your mounted directories are owned by root. You can’t edit those files, or
remove those directories, without root privileges. To own the output yourself, run the
container as your own user and group by adding --user $(id -u):$(id -g). Parabricks
writes temporary files to the working directory by default, and a non-root user can’t
write to the container’s default working directory, /, so also set --workdir to a
mounted directory, or point --tmp-dir at one. Otherwise, the run stops with
Could not create temporary directory. For example, this runs the fq2bam command from
above as your own user:
Tools in the image: Besides pbrun, the image includes samtools and bcftools,
but not bgzip or tabix. Use bcftools to compress a VCF with BGZF or to index it, for
example when you prepare a panel of normals for prepon or
postpon. To run samtools or bcftools, pass its name
to --entrypoint and put its arguments after the image name:
Running Parabricks Using the Base Command Platform
An example command to launch a BaseCommand container on a single-GPU instance is:
For other Parabricks commands, such as fq2bam, HaplotypeCaller, and DeepVariant, the
ngc batch run command is similar. Make sure to use the correct paths for your workplace or
dataset that contains the data you intend to use.