> For the complete documentation index, see [llms.txt](https://help.dragen.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.dragen.illumina.com/dragen-v4.3/product-guide/dragen-v4.3/dragen-dna-pipeline/downsampling/downsampling.md).

# Effective Coverage Downsampling

## Please note

The effective downsampling module will be deprecated in future versions of DRAGEN in favor of the fractional downsampler.

The effective downsampler described on this page tends to be compute-intensive and may fail on large WGS samples. It has also been shown to introduce uneven coverage profiles when starting from existing BAMs.

In contrast, the fractional downsampler behaves similarly to popular downsampling tools such as `samtools view -s` or `seqtk`. It is computationally efficient, fast, unbiased, and supports FASTQ, BAM, or CRAM input.

## Behavior

DRAGEN can reserve a random subset of fragments that are separate from the normal alignment outputs using downsampling. You can use downsampling to generate data sets for performing comparisons between samples or between replicates. DRAGEN samples fragments after performing any hardware accelerated trimming or filtering functions, which enables DRAGEN to rapidly create analysis-read test data sets.

To enable downsampling, set the `--enable-down-sampler` command line option to `true`.

You can use any valid sequencing data format that is compatible with the DRAGEN Host Software. For more information on compatible input options, see [Input Options](/dragen-v4.3/product-guide/dragen-v4.3/dragen-host-software.md#input-options).

DRAGEN downsampling outputs the reserved subset of data in FASTQ format. If the input is paired-ended, DRAGEN outputs two FASTQ files that contain subsampled data. If the input is unpaired, DRAGEN outputs two FASTQ files.

## Command-line Options

In addition to enabling the downsampling command line option, you must set the quantity of fragments to downsample. To set the quantity of fragments, use either `--down-sampler-fragments` or `--down-sampler-coverage`.

If you specified a coverage level, you must also specify a genome using the `--ref-dir` or manually specify the genome size using `--down-sampler-genome-size`. If you specify both a read and coverage limit, DRAGEN applies both quantity limits and keeps whichever result is smaller.

| Option                       | Description                                                                                                                                                      |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--enable-down-sampler`      | Set to `true` to enable downsampling. The default value is false. If enabled, you must set either `down-sampler-fragments` or `--down-sampler-coverage`.         |
| `--down-sampler-num-threads` | Specify the number of threads to use for down-sampled reads. The default value is 8.                                                                             |
| `--down-sampler-random-seed` | Set random seed for down-sampled fragments. The default value is 42.                                                                                             |
| `--down-sampler-genome-size` | Set target genome size for downsampling coverage. The default value is 0. The `--down-sampler-genome-size` option is not compatible with the `--ref-dir` option. |
| `--down-sampler-fragments`   | Specify the target number of fragments for downsampling. The default value is 0.                                                                                 |
| `--down-sampler-coverage`    | Set target genomic coverage for downsampling. The default value is 0. If enabled, you must set either `-ref-dir` or `--down-sampler-genome-size`.                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.dragen.illumina.com/dragen-v4.3/product-guide/dragen-v4.3/dragen-dna-pipeline/downsampling/downsampling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
