samtools-markdup(1)

NAME
samtools markdup - mark duplicate alignments in a coordinate sorted file

SYNOPSIS

samtools markdup [-l length] [-r] [-s] [-T] [-S] [-f file] [-d distance] [-c] [-t] [-m] [--mode] [--include-fails] [--no-PG] in.algsort.bam out.bam

DESCRIPTION

Mark duplicate alignments from a coordinate sorted file that has been run through samtools fixmate with the -m option. This program relies on the MC and ms tags that fixmate provides.

OPTIONS

-l INT
    Expected maximum read length of INT bases. [300]

-r  Remove duplicate reads.

-s  Print some basic stats. See STATISTICS.

-T PREFIX
    Write temporary files to PREFIX.samtools.nnnn.mmmm.tmp

-S  Mark supplementary reads of duplicates as duplicates.

-f file
    Write stats to named file.

-d distance
    The optical duplicate distance. Suggested settings of 100 for HiSeq style platforms or about 2500 for NovaSeq ones. Default is 0 to not look for optical duplicates. When set, duplicate reads are tagged with dt:Z:SQ for optical duplicates and dt:Z:LB otherwise. Calculation of distance depends on coordinate data embedded in the read names produced by the Illumina sequencing machines. Optical duplicate detection will not work on non standard names.

-c  Clear previous duplicate settings and tags.

-t  Mark duplicates with the name of the original in a do tag.

-m, --mode TYPE
    Duplicate decision method for paired reads. Values are t or s. Mode t measures positions based on template start/end (default). Mode s measures positions based on sequence start. While the two methods identify mostly the same reads as duplicates, mode s tends to return more results. Unpaired reads are treated identically by both modes.

--include-fails
    Include quality checked failed reads.

--no-PG
    Do not add a PG line to the output file.

STATISTICS
Entries are:
COMMAND: the command line.
READ: number of reads read in.
WRITTEN: reads written out.
EXCLUDED: reads ignored. See below.
EXAMINED: reads examined for duplication.
PAIRED: reads that are part of a pair.
SINGLE: reads that are not part of a pair.
DUPLICATE PAIR: reads in a duplicate pair.
DUPLICATE SINGLE: single read duplicates.
DUPLICATE PAIR OPTICAL: optical duplicate paired reads.
DUPLICATE SINGLE OPTICAL: optical duplicate single reads.
DUPLICATE NON PRIMARY: supplementary/secondary duplicate reads.
DUPLICATE NON PRIMARY OPTICAL: supplementary/secondary optical duplicate reads.
DUPLICATE PRIMARY TOTAL: number of primary duplicate reads.
DUPLICATE TOTAL: total number of duplicate reads.
ESTIMATED LIBRARY SIZE: estimate of the number of unique fragments in the sequencing library. Estimated library size makes various assumptions e.g. the library consists of unique fragments that are randomly selected (with replacement) with equal probability. This is unlikely to be true in practice. However it can provide a useful guide into how many unique read pairs are likely to be available. In particular it can be used to determine how much more data might be obtained by further sequencing of the library. Excluded reads are those marked as secondary, supplementary or unmapped. By default QC failed reads are also excluded but can be included as an option. Excluded reads are not used for calculating duplicates. They can optionally be marked as duplicates if they have a primary that is also a duplicate.

EXAMPLES
This first command sort can be omitted if the file is already name ordered:
    samtools sort -n -o namesort.bam example.bam
Add ms and MC tags for markdup to use later:
    samtools fixmate -m namesort.bam fixmate.bam
Markdup needs position order:
    samtools sort -o positionsort.bam fixmate.bam
Finally mark duplicates:
    samtools markdup positionsort.bam markdup.bam

AUTHOR

Written by Andrew Whitwham from the Sanger Institute.

SEE ALSO
samtools(1), samtools-sort(1), samtools-fixmate(1)

Samtools website: <http://www.htslib.org/>