gatk4/gatk4_markduplicates
Description
Identifies duplicate reads in a SAM/BAM/CRAM file.
This tool locates and tags duplicate reads in a coordinate-sorted SAM,
BAM or CRAM file, where duplicate reads are defined as originating from
a single fragment of DNA. Duplicates can arise during sample preparation
(e.g. library construction using PCR) or from a single amplification
cluster incorrectly detected as multiple clusters by the optical sensor
of the sequencing instrument (optical duplicates).
The tool works by comparing sequences in the 5' positions of both reads
and read-pairs. After duplicate reads are collected, the tool
differentiates the primary and duplicate reads using an algorithm that
ranks reads by the sums of their base-quality scores by default.
Duplicate reads are marked with the hexadecimal SAM flag value 0x0400
(decimal 1024).
In addition to the dedup-tagged output file, the tool produces a metrics
file indicating the numbers of duplicates for both single- and
paired-end reads.
Input
Name | Type & Properties | Description |
|---|---|---|
--input -I | file required multiple | Input coordinate-sorted SAM, BAM or CRAM file(s) to analyze. Can be specified multiple times to merge and de-duplicate reads across several input files in a single pass. |
Output
Name | Type & Properties | Description |
|---|---|---|
--output -O | file required output | Output file with duplicate reads marked (or removed, see `--remove_duplicates`). |
--metrics -M | file required output | Output metrics file with duplication metrics, including the estimated library size. |
Options
Name | Type & Properties | Description |
|---|---|---|
--add_pg_tag_to_reads | boolean | Add a `PG` tag to each read in a SAM or BAM file. Default: true. |
--assume_sort_order -ASO | string | If provided, assume that the input file has this sort order even if the header says otherwise. |
--barcode_tag | string | Barcode SAM tag (e.g. `BC` for 10x Genomics) used to facilitate duplicate marking using molecular barcodes. |
--clear_dt | boolean | Clear the `DT` tag from input SAM records. Should be set to `false` if the input SAM file doesn't have this tag. Default: true. |
--comment -CO | string multiple | Comment(s) to include in the output file's header. May be specified more than once. |
--create_index | boolean_true | If set, create an index when writing a coordinate-sorted BAM output file. |
--duplex_umi | boolean_true | Treat UMIs as being duplex stranded. This option requires that the UMI consist of two equal-length strings separated by a hyphen (e.g. `ATC-GTC`). Reads are considered duplicates if, in addition to the standard definition, they have identical normalized UMIs. Requires `--barcode_tag` to hold non-normalized UMIs. |
--duplicate_scoring_strategy -DS | string | The scoring strategy for choosing the non-duplicate among duplicate candidates. Default: 'SUM_OF_BASE_QUALITIES'. |
--max_file_handles_for_read_ends_map -MAX_FILE_HANDLES | integer | Maximum number of file handles to keep open when spilling read ends to disk. Set this number a little lower than the per-process maximum number of files that may be open (find this with the `ulimit -n` command on a Unix system). Default: 8000. |
--max_optical_duplicate_set_size | long | The maximum size of a set of duplicate reads for which to attempt to determine which are optical duplicates. Raising this value too high for a very large set of duplicate reads will severely affect the runtime of this tool. Set to `-1` to completely disable this check. Default: 300000. |
--max_records_in_ram | integer | When writing files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort the file, and increases the amount of RAM needed. Default: 500000. |
--molecular_identifier_tag | string | SAM tag used to uniquely identify the molecule from which a read was derived. Requires `--barcode_tag` to also be set. |
--optical_duplicate_pixel_distance | integer | The maximum offset between two duplicate clusters in order to consider them optical duplicates. A value of `100` is appropriate for non-patterned flowcells. For patterned flowcell models (e.g. NovaSeq, HiSeqX), `2500` is more appropriate. For other platforms and models, experiment to find what works best. Default: 100. |
--program_group_command_line -PG_COMMAND | string | Value of the `CL` tag of the `PG` record to be created. If not supplied, the command line is detected automatically. |
--program_group_name -PG_NAME | string | Value of the `PN` tag of the `PG` record to be created. Default: 'MarkDuplicates'. |
--program_group_version -PG_VERSION | string | Value of the `VN` tag of the `PG` record to be created. If not supplied, the version is detected automatically. |
--program_record_id -PG | string | The program record ID for the `PG` record(s) created by this tool. A suffix may be appended to this string to avoid collision with other program record IDs. Set to `null` to disable `PG` record creation. Default: 'MarkDuplicates'. |
--read_name_regex | string | MarkDuplicates can use the tile and cluster positions to estimate the rate of optical duplication in addition to the dominant source of duplication, PCR, to provide a more accurate estimation of library size. By default (with no `--read_name_regex` specified), MarkDuplicates will attempt to extract coordinates using a split on `:`. Set `--read_name_regex` to `null` to disable optical duplicate detection. Note that without optical duplicate counts, library size estimation will be less accurate. |
--read_one_barcode_tag | string | Read one barcode SAM tag (e.g. `BX` for 10x Genomics). |
--read_two_barcode_tag | string | Read two barcode SAM tag (e.g. `BX` for 10x Genomics). |
--reference_sequence -R | file | Reference sequence FASTA file. Only required when the input file is CRAM format. |
--remove_duplicates | boolean_true | If set, do not write duplicates to the output file instead of writing them with the appropriate SAM flags set. |
--remove_sequencing_duplicates | boolean_true | If set, remove 'optical' duplicates and other duplicates that appear to have arisen from the sequencing process instead of the library preparation process, even if `--remove_duplicates` is not set. If `--remove_duplicates` is set, all duplicates are removed and this option is ignored. |
--sorting_collection_size_ratio | double | This number, plus the maximum RAM available to the JVM, determine the memory footprint used by some of the sorting collections. If you are running out of memory, try reducing this number. Default: 0.25. |
--tag_duplicate_set_members | boolean_true | If set, for a read that appears in a duplicate set, add two tags. The first tag, `DS`, indicates the size of the duplicate set. The second tag, `DI`, represents a unique identifier for the duplicate set to which the record belongs. |
--tagging_policy | string | Determines how duplicate types are recorded in the `DT` optional attribute. Default: 'DontTag'. |
--validation_stringency | string | Validation stringency for all SAM files read by this program. Setting stringency to `SILENT` can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. Default: 'STRICT'. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.bam"
metrics: "$id.$key.metrics.txt"
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/biobox.git \
-revision v0.5.0 \
-main-script target/nextflow/gatk4/gatk4_markduplicates/main.nf \
-params-file params.yaml Relationships
Used by
No components use this component.
Current component
Uses
No component dependencies found.