remove-dup
Subread binary for duplicate-read removal. It reads SAM or BAM, groups reads by mapped location, and drops every read at locations whose depth meets or exceeds the configured duplication threshold.
Quick Start
- Command:
removeDup -i <input.sam|bam> -o <output.bam> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/removeDup - Default duplication cutoff:
10
When To Use This Tool
- Removing dense duplicate alignments from mapped read files before downstream counting or QC
- Applying a simple location-based duplication filter to SAM or BAM without marking duplicates first
- Forcing SAM output with
-Swhen a downstream step cannot read BAM - Running a quick Subread-native duplicate purge rather than a more feature-rich deduplication workflow
Common Patterns
# Write BAM output with the default cutoff
removeDup -i alignments.bam -o dedup.bam
# Tighten the removal threshold
removeDup -i alignments.sam -o dedup.bam -r 2
# Emit SAM instead of BAM
removeDup -i alignments.bam -o dedup.sam -S
Recommended Workflow
- Start from a valid SAM or BAM alignment file.
- Decide whether the default cutoff of
10is acceptable; lower it only if you intentionally want aggressive pruning. - Write BAM by default, or add
-Sonly when plain-text SAM is required downstream. - Inspect the summary banner or view the output with
samtools viewto confirm how many reads actually survived.
Guardrails
-hand--versionare not true metadata/help switches; both are treated as invalid options, then the binary prints its usage banner and continues to complain about missing or invalid input.- In live testing, three reads at the same locus with
-r 2caused all three reads to be removed, confirming this tool drops the entire location bucket once the cutoff is reached. - The usage text says output is BAM unless
-Sis specified, even though the-odescription loosely says “output SAM file.” - The tool requires
-iand-o; invoking it without a real SAM/BAM input ends inERROR: The input file is neither a BAM file nor a SAM file. - This is a blunt duplicate filter, not a marker: it does not preserve one representative read at over-threshold loci.