bio-duplicate-handling
Mark and remove PCR/optical duplicates using samtools fixmate and markdup. Use when preparing alignments for variant calling or when duplicate reads would bias analysis.
npx skills add BioTender-max/awesome-bio-agent-skills --skill duplicate-handling --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
## Version Compatibility Reference examples tested with: picard 3.1+, pysam 0.22+, samtools 1.19+ Before using code patterns, verify installed versions match. If versions differ: - Python: `pip show <package>` then `help(module.function)` to check signatures - CLI: `<tool> --version` then `<tool> --help` to confirm flags If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying. # Duplicate Handling **"Remove PCR duplicates from my BAM file"** → Mark or remove duplicate reads using the fixmate-sort-markdup pipeline to prevent duplicate bias in variant calling. - CLI: `samtools fixmate`, `samtools markdup` (samtools) - Python: `pysam.fixmate()`, `pysam.markdup()` (pysam) Mark and remove PCR/optical duplicates using samtools. ## Why Remove Duplicates? PCR duplicates are identical copies of the same original molecule, created during library preparation. They inflate coverage, bias allele frequencies, and create false positive variant calls. Optical duplicates are flowcell-proximity artifacts of bridge amplification (especially on patterned NovaSeq / NovaSeq X / NextSeq 1000 flowcells).
- Version Compatibility
- Why Remove Duplicates?
- When to Mark Duplicates -- and When NOT To
- Tool Selection: markdup vs Picard vs UMI-aware
- Optical Distance Is Platform-Specific
- Multi-Library Pooled Marking
- Duplicate Marking Workflow
- Pipeline Version (Optimized)
- samtools fixmate
- Basic Usage
- Add Mate Score Tag (-m)
- Multi-threaded
- Remove Secondary/Unmapped
- samtools markdup
samtools markdup -d 2500 -t -f stats.txt input.bam marked.bam Count optical (SQ) vs library/PCR (LB) duplicates samtools view -f 1024 marked.bam | grep -o 'dt:Z:[A-Z][A-Z]' | sort | uniq -c samtools markdup --use-read-groups -d 2500 -t in.bam out.bam samtools sort -n -o namesort.bam input.bam samtools fixmate -m namesort.bam fixmate.bam samtools sort -o coordsort.bam fixmate.bam samtools markdup coordsort.bam marked.bam samtools index marked.bam collate is faster than sort -n; -u/-O between piped tools skips BGZF round-trips
What does the bio-duplicate-handling skill do?
Mark and remove PCR/optical duplicates using samtools fixmate and markdup. Use when preparing alignments for variant calling or when duplicate reads would bias analysis.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill duplicate-handling --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
