Agent skill

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.

BioTender-maxgithub.com/BioTender-maxGitHub ↗
claude-codeships scriptsNOASSERTION
Install
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.

Facts
Files in the skill folder: 3
SKILL.md size: 14 KB
Bundled scripts: yes
Path: skills/bioskills/duplicate-handling/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 135
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

## 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).

What's inside
Steps it walks through
  1. Version Compatibility
  2. Why Remove Duplicates?
  3. When to Mark Duplicates -- and When NOT To
  4. Tool Selection: markdup vs Picard vs UMI-aware
  5. Optical Distance Is Platform-Specific
  6. Multi-Library Pooled Marking
  7. Duplicate Marking Workflow
  8. Pipeline Version (Optimized)
  9. samtools fixmate
  10. Basic Usage
  11. Add Mate Score Tag (-m)
  12. Multi-threaded
  13. Remove Secondary/Unmapped
  14. samtools markdup
Ships with 2 files
  • examples/markdup_pipeline.sh
  • usage-guide.md
Commands it runs
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
More from awesome-bio-agent-skills
All skills →
About this skill
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.

Keep going