> This page is for version v4.8.0 (default).
> For other versions, use one of these documentation indexes:
> - v4.8.0 (default): https://docs.nvidia.com/clara/parabricks/v4.8.0/llms.txt
> - v4.7.1: https://docs.nvidia.com/clara/parabricks/v4.7.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/clara/parabricks/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/clara/parabricks/_mcp/server.

# FQ2BAM Tutorial

This tutorial will show you how to run our core alignment tool, FQ2BAM, which allows you to align
a FASTQ file according to GATK best practices at blazing speeds. This includes the gold-standard
alignment tool BWA-MEM with inbuilt co-ordinate sorting of the output file, and optionally application
of base-quality-score-recalibration and marking of duplicate reads.

The `fq2bam` tool aligns, sorts (by coordinate), and marks duplicates in paired-end FASTQ
file data. The data files used in this example are taken from the sample data downloaded in
the previous section.

> **Note**
>
> By default, [fq2bam](/clara/parabricks/v4.8.0/tool-reference/tools/fq2bam) selects the number of GPU streams based on total GPU memory. If a run exceeds GPU memory, see
> [Useful Options for Performance](/clara/parabricks/v4.8.0/tool-reference/tools/fq2bam#useful-options-for-performance) for how to tune `--bwa-nstreams` or use `--low-memory`.

If you execute the following command using the NVIDIA Parabricks sample data, you should
get the same results as shown here.

Before executing this command, make sure your current directory is where you extracted
the sample data; it should have a **parabricks_sample** sub-directory.

```text
$ docker run \
      --gpus all \
      --rm \
      --volume $(pwd):/workdir \
      --volume $(pwd):/outputdir \
    nvcr.io/nvidia/clara/clara-parabricks:4.8.0-1 \
    pbrun fq2bam \
      --ref /workdir/parabricks_sample/Ref/Homo_sapiens_assembly38.fasta \
      --in-fq /workdir/parabricks_sample/Data/sample_1.fq.gz /workdir/parabricks_sample/Data/sample_2.fq.gz \
      --out-bam /outputdir/fq2bam_output.bam

Please visit https://docs.nvidia.com/clara/#parabricks for detailed documentation

[Parabricks Options Mesg]: Checking argument compatibility
[Parabricks Options Mesg]: Auto mode: Setting --bwa-nstreams and device memory parameters automatically based on
available GPU memory. These settings are optimized for the GRCh38 reference genome and may need manual adjustment for
other references or optimal performance. For manual configuration guidance, see the fq2bam documentation.
[Parabricks Options Mesg]: Set --bwa-options="-K #" to produce compatible pair-ended results with previous versions of
fq2bam or BWA MEM.
[Parabricks Options Mesg]: Automatically generating ID prefix
[Parabricks Options Mesg]: Read group created for /workdir/parabricks_sample/Data/sample_1.fq.gz and
/workdir/parabricks_sample/Data/sample_2.fq.gz
[Parabricks Options Mesg]: @RG\tID:HK3TJBCX2.1\tLB:lib1\tPL:bar\tSM:sample\tPU:HK3TJBCX2.1
[PB Info 2026-Oct-06 15:23:53] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:23:53] ||                 Parabricks accelerated Genomics Pipeline                 ||
[PB Info 2026-Oct-06 15:23:53] ||                           Version 4.8.0-1                                ||
[PB Info 2026-Oct-06 15:23:53] ||                      GPU-PBBWA mem, Sorting Phase-I                      ||
[PB Info 2026-Oct-06 15:23:53] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:23:53] Mode = pair-ended-gpu
[PB Info 2026-Oct-06 15:23:53] Processing reads filtered between: 1 <= L <= 480 base pairs
[PB Info 2026-Oct-06 15:23:53] Running with 1 GPU(s), using 4 stream(s) per device with 16 group(s) of 1 CPU worker thread(s)
[PB Info 2026-Oct-06 15:24:03] #  0  0  0  0  0   0 pool:  0 0 bases/GPU/minute: 0.0 
[PB Info 2026-Oct-06 15:24:13] # 10  3 10  0  0   0 pool:  1 716193151 bases/GPU/minute: 4297158906.0 
[PB Info 2026-Oct-06 15:24:23] # 10  0  9  0  0   0 pool:  3 3158786317 bases/GPU/minute: 14655558996.0 
[PB Info 2026-Oct-06 15:24:33] # 10  0 12  0  0   0 pool:  3 5548601785 bases/GPU/minute: 14338892808.0 
[PB Info 2026-Oct-06 15:24:34] Time spent reading: 8.709017 seconds
[PB Info 2026-Oct-06 15:24:43] Rate stats (based on sampling every 10 seconds):
	min rate: 0.0 bases/GPU/minute
	max rate: 14655558996.0 bases/GPU/minute
	avg rate: 8322902677.5 bases/GPU/minute
[PB Info 2026-Oct-06 15:24:43] Time spent monitoring (multiple of 10): 50.001
[PB Info 2026-Oct-06 15:24:43] bwalib run finished in 43.884 seconds
[PB Info 2026-Oct-06 15:24:43] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:43] ||        Program:                    GPU-PBBWA mem, Sorting Phase-I        ||
[PB Info 2026-Oct-06 15:24:43] ||        Version:                                           4.8.0-1        ||
[PB Info 2026-Oct-06 15:24:43] ||        Start Time:                       Tue Oct  6 15:23:53 2026        ||
[PB Info 2026-Oct-06 15:24:43] ||        End Time:                         Tue Oct  6 15:24:43 2026        ||
[PB Info 2026-Oct-06 15:24:43] ||        Total Time:                                     50 seconds        ||
[PB Info 2026-Oct-06 15:24:43] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:45] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:45] ||                 Parabricks accelerated Genomics Pipeline                 ||
[PB Info 2026-Oct-06 15:24:45] ||                           Version 4.8.0-1                                ||
[PB Info 2026-Oct-06 15:24:45] ||                             Sorting Phase-II                             ||
[PB Info 2026-Oct-06 15:24:45] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:45] progressMeter - Percentage
[PB Info 2026-Oct-06 15:24:45] 0.0
[PB Info 2026-Oct-06 15:24:50] Sorting and Marking: 5.001 seconds
[PB Info 2026-Oct-06 15:24:50] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:50] ||        Program:                                  Sorting Phase-II        ||
[PB Info 2026-Oct-06 15:24:50] ||        Version:                                           4.8.0-1        ||
[PB Info 2026-Oct-06 15:24:50] ||        Start Time:                       Tue Oct  6 15:24:45 2026        ||
[PB Info 2026-Oct-06 15:24:50] ||        End Time:                         Tue Oct  6 15:24:50 2026        ||
[PB Info 2026-Oct-06 15:24:50] ||        Total Time:                                      5 seconds        ||
[PB Info 2026-Oct-06 15:24:50] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:50] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:50] ||                 Parabricks accelerated Genomics Pipeline                 ||
[PB Info 2026-Oct-06 15:24:50] ||                           Version 4.8.0-1                                ||
[PB Info 2026-Oct-06 15:24:50] ||                         Marking Duplicates, BQSR                         ||
[PB Info 2026-Oct-06 15:24:50] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:24:50] Using PBBinBamFile for BAM writing
[PB Info 2026-Oct-06 15:24:50] progressMeter -	Percentage
[PB Info 2026-Oct-06 15:25:00] 57.2
[PB Info 2026-Oct-06 15:25:07] BQSR and writing final BAM:  16.697 seconds
[PB Info 2026-Oct-06 15:25:07] ------------------------------------------------------------------------------
[PB Info 2026-Oct-06 15:25:07] ||        Program:                          Marking Duplicates, BQSR        ||
[PB Info 2026-Oct-06 15:25:07] ||        Version:                                           4.8.0-1        ||
[PB Info 2026-Oct-06 15:25:07] ||        Start Time:                       Tue Oct  6 15:24:50 2026        ||
[PB Info 2026-Oct-06 15:25:07] ||        End Time:                         Tue Oct  6 15:25:07 2026        ||
[PB Info 2026-Oct-06 15:25:07] ||        Total Time:                                     17 seconds        ||
[PB Info 2026-Oct-06 15:25:07] ------------------------------------------------------------------------------
```

This run was performed on a local workstation with an NVIDIA RTX PRO 6000 Blackwell Workstation Edition and 128 GB of RAM.
On other hardware, runtimes will differ, as will the settings Parabricks selects automatically based on GPU memory, such as the number of GPU streams shown in the log.

If you get an out-of-memory error make sure your computer has enough RAM, and that large
amounts of memory aren't being used by other programs.

This `fq2bam` command produces three output files:

```text
$ ls -l
-rw-r--r-- 1 root    root          4861055062 Oct  6 11:25 fq2bam_output.bam
-rw-r--r-- 1 root    root             3205016 Oct  6 11:25 fq2bam_output.bam.bai
-rw-r--r-- 1 root    root               87692 Oct  6 11:25 fq2bam_output_chrs.txt

(input files not shown)
```

The first line of `fq2bam_output.bam` (as viewed with the `samtools view fq2bam_output.bam` command) is as follows:

```text
HWI-D00127:570:HK3TJBCX2:1:1202:9643:76055	99	chr1	10027	26	24M5I86M	=	10178	231	ACCCTAACCCTAACCCTAACCCGACCCCGACCCCGACCCAAACCCAAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTACCCTAACCCTAACCCTAACCCTAACC	DDDDDHGHIIIIIHIIHHIHHHIHIIIIIIHDHHIHHHIHIHIIIIFHIEHHIIHHIIIIEHIIIIHHIHIIICHE@1FHH?1GEFE1111D11<FH11<FD11<<FFE111<11	MD:Z:22T5T0A4T5T41A27	PG:Z:MarkDuplicates	RG:Z:HK3TJBCX2.1	NM:i:11	AS:i:69	XS:i:72	MC:Z:34S11M1I69M
....
```