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

# ont_germline

Run the germline variant tool to generate BAM and variants on long read ONT sequences
using minimap2 for alignment as well as the DeepVariant variant caller.

Refer to the [ont\_germline Reference](#options) section for a detailed listing of all available options.

## Quick Start

```sh
# This command assumes all the inputs are in the current working directory and all the outputs go to the same place.
docker run --rm --gpus all --volume $(pwd):/workdir --volume $(pwd):/outputdir \
    --workdir /workdir \
    nvcr.io/nvidia/clara/clara-parabricks:4.7.1-1 \
    pbrun ont_germline \
    --ref /workdir/${REFERENCE_FILE} \
    --in-fq /workdir/${INPUT_FASTQ} \
    --out-bam /outputdir/${OUTPUT_BAM} \
    --out-variants /outputdir/${OUTPUT_VCF}
```

## Compatible CPU-based minimap2, GATK4, and Google DeepVariant Commands

The commands below are the minimap2-v2.30, GATK4, and Google DeepVariant counterpart of the Clara Parabricks command
above. The output from these commands will be identical to the output
from the above command.  Refer to the [Output Comparison](/about-parabricks/comparison-with-baseline-tools) page for
comparing the results.

```sh
# Run minimap2 and pipe the output to create a sorted BAM.
$ minimap2 -ax map-ont \
    <INPUT_DIR>/${REFERENCE_FILE} \
    <INPUT_DIR>/${INPUT_FASTQ} | \
  gatk SortSam \
    --java-options -Xmx30g \
    --MAX_RECORDS_IN_RAM 5000000 \
    -I /dev/stdin \
    -O cpu.bam \
    --SORT_ORDER coordinate

 # Run deepvariant
BIN_VERSION="1.9.0"
sudo docker run \
  -v "${PWD}":"/input" \
  -v "${PWD}/output":"/output" \
  -v "${PWD}/Ref":"/reference" \
  google/deepvariant:"${BIN_VERSION}" \
  /opt/deepvariant/bin/run_deepvariant \
  --model_type ONT_R104 \
  --ref /reference/${REFERENCE_FILE} \
  --reads cpu.bam \
  --output_vcf /output/"${OUTPUT_VCF_FILE}" \
  --num_shards $(nproc) \
  --disable_small_model=true \
  --make_examples_extra_args "ws_use_window_selector_model=true"
```

In Google DeepVariant, the small model is enabled by default and must be explicitly disabled
(with `--disable_small_model=true`). In Parabricks DeepVariant, the small model is opt-in and
must be explicitly enabled (with `--enable-small-model`).

Variants called by the small model will have an additional `MID` field in their VCF record,
which denotes which model called the variant. This is consistent with VCF files produced by
Google DeepVariant.

**Note that a change must be made to the baseline minimap2 code in order to match
the results exactly:**

A fix must be made to the baseline KSW2 code to round the loop fission start and end
points by changing them to `st` and `en` respectively. If the start point (`st0`)
is a number below 16, but greater than 0, its scoring values will not be initialized correctly, but
will still be used later when computing the actual alignment. This can be fixed by rounding the
start and end points to multiples of 16.

To make this fix, change the following code in `ksw2_extd2_sse.c`:

```sh
// loop fission: set scores first
if (!(flag & KSW_EZ_GENERIC_SC)) {
    for (t = st0; t <= en0; t += 16) {
        __m128i sq, st, tmp, mask;
        sq = _mm_loadu_si128((__m128i*)&sf[t]);
        st = _mm_loadu_si128((__m128i*)&qrr[t]);
        mask = _mm_or_si128(_mm_cmpeq_epi8(sq, m1_), _mm_cmpeq_epi8(st, m1_));
        tmp = _mm_cmpeq_epi8(sq, st);
    #ifdef __SSE4_1__
                    tmp = _mm_blendv_epi8(sc_mis_, sc_mch_, tmp);
                    tmp = _mm_blendv_epi8(tmp,     sc_N_,   mask);
    #else
                    tmp = _mm_or_si128(_mm_andnot_si128(tmp,  sc_mis_), _mm_and_si128(tmp,  sc_mch_));
                    tmp = _mm_or_si128(_mm_andnot_si128(mask, tmp),     _mm_and_si128(mask, sc_N_));
    #endif
                    _mm_storeu_si128((__m128i*)((int8_t*)s + t), tmp);
                }
            } else {
                for (t = st0; t <= en0; ++t)
                    ((uint8_t*)s)[t] = mat[sf[t] * m + qrr[t]];
            }
```

Fixed version that uses `lf_start` and `lf_en`:

```sh
// loop fission: set scores first
int lf_start = st, lf_en = en;
if (!(flag & KSW_EZ_GENERIC_SC)) {
    for (t = lf_start; t <= lf_en; t += 16) {
        __m128i sq, st, tmp, mask;
        sq = _mm_loadu_si128((__m128i*)&sf[t]);
        st = _mm_loadu_si128((__m128i*)&qrr[t]);
        mask = _mm_or_si128(_mm_cmpeq_epi8(sq, m1_), _mm_cmpeq_epi8(st, m1_));
        tmp = _mm_cmpeq_epi8(sq, st);
    #ifdef __SSE4_1__
                    tmp = _mm_blendv_epi8(sc_mis_, sc_mch_, tmp);
                    tmp = _mm_blendv_epi8(tmp,     sc_N_,   mask);
    #else
                    tmp = _mm_or_si128(_mm_andnot_si128(tmp,  sc_mis_), _mm_and_si128(tmp,  sc_mch_));
                    tmp = _mm_or_si128(_mm_andnot_si128(mask, tmp),     _mm_and_si128(mask, sc_N_));
    #endif
                    _mm_storeu_si128((__m128i*)((int8_t*)s + t), tmp);
                }
            } else {
                for (t = lf_start; t <= lf_en; ++t)
                    ((uint8_t*)s)[t] = mat[sf[t] * m + qrr[t]];
            }
```

## Models for Additional GPUs

See the DeepVariant [Models for additional GPUs](/tool-reference/tools/deepvariant#models-for-additional-gpus) section
for instructions on downloading and using model files for additional GPUs.

## Options