Pysam
davila7/claude-code-templates
Genomic file toolkit. An agent skill from davila7/claude-code-templates.
Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clipping --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .claude/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .claude/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clippingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clipping --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .agents/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .agents/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clipping --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .cursor/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .cursor/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/GPTomics/bioSkills.git --path alignment-files/alignment-amplicon-clipping--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clipping --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .gemini/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .gemini/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clippingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .github/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .github/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .github/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-amplicon-clipping --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/alignment-files/alignment-amplicon-clipping .opencode/skills/bio-alignment-amplicon-clipping && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bio-alignment-amplicon-clipping" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment-files/alignment-amplicon-clipping into .opencode/skills/bio-alignment-amplicon-clipping/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-amplicon-clipping", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bio-alignment-amplicon-clippingSoft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.
Primer-derived bases at a read's 5' end reflect the PCR primer, not the biological sample, so leaving them in causes false reference confirmation at primer sites, suppressed variant allele frequency under primers, and strand-bias artifacts. The skill also warns that standard amplicon BAMs should never go through markdup, because every read anchored at a primer site looks like a coordinate duplicate by design.
A tool-selection table compares options: samtools ampliconclip as the default since version 1.11, which clips from a primer BED file and invalidates MD and NM tags in the process, iVar trim for the Illumina SARS-CoV-2 PrimalSeq route, BAMClipper for capture or hybrid panels with primer overlap, fgbio ClipBam when mate-aware end adjustment matters, and cutadapt for trimming before alignment. Soft-clipping is the safe default, kept reversible in the BAM, with hard-clipping reserved for archiving under real storage constraints.
Read from SKILL.md and the folder at commit d91ed3d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Shell), which the agent can run.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Amplicon Primer Clipping loads about 2.2k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 959 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 959 words, ~2,249 tokens.
.claude/skills/bio-alignment-amplicon-clipping/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Reference examples tested with: samtools 1.19+, pysam 0.22+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signatures<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Trim primer-derived bases from amplicon BAM" -> Soft- or hard-clip the 5' primer footprint after alignment using a primer BED, then repair fixmate/MD/NM tags.
samtools ampliconclip -b primers.bed input.bam -o clipped.bam (since samtools 1.11)iVar trim, BAMClipper, fgbio ClipBamAmplicon panels (SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, fusion panels, 16S rRNA) use designed PCR primers for enrichment. Primer-derived bases at read 5' ends do NOT reflect biological sequence -- they reflect the primer template. Without trimming:
Standard amplicon BAMs should NEVER be processed by samtools markdup -- by design every read at a primer location is a "duplicate" by coordinate. See duplicate-handling for the assay-aware decision.
| Tool | When | Notes |
|---|---|---|
samtools ampliconclip | Default for amplicon panels (since 1.11) | Soft- or hard-clip from BED; modifies CIGAR; invalidates MD/NM |
iVar trim | Illumina SARS-CoV-2 / PrimalSeq route (Andersen lab) | Coordinates by primer name/position; soft-clips only + quality sliding-window |
BAMClipper | Capture / hybrid panels with primer overlap | 5'-end clipping with overlap handling |
fgbio ClipBam | When read-pair coordination matters | Soft/hard-clip with mate-aware end adjustment |
cutadapt (pre-alignment) | Legacy / when alignment is downstream | Trims at FASTQ stage; less precise for amplicon |
Goal: Decide whether trimmed bases are kept in the BAM (reversible) or discarded (irreversible).
Approach: Soft-clip is the safe default; hard-clip only when archiving and disk is constrained.
| Mode | Flag | What it does | Reversible? |
|---|---|---|---|
| Soft-clip | (default) / --soft-clip | Bases kept in SEQ; CIGAR uses S; bases not aligned | Yes (CIGAR can be re-extended) |
| Hard-clip | --hard-clip | Bases removed from SEQ; CIGAR uses H | No (bases lost) |
Soft-clip is the recommended default. Hard-clip is irreversible -- once applied, the trimmed bases cannot be recovered for re-analysis with different primer coordinates.
Goal: Trim primers from a coordinate-sorted, indexed amplicon BAM and produce a downstream-ready BAM.
Approach: Run ampliconclip with primer BED, choosing either --strand (5' strand-aware) or --both-ends (read-through amplicons; note --both-ends overrides --strand), then re-fixmate (CIGAR changed) and re-calmd (MD/NM tags invalidated by clip).
# 1. Soft-clip primers (default; reversible). --strand clips only the designed strand.
samtools ampliconclip --strand --soft-clip \
-b primers.bed input.bam -o clipped.bam
# 2. Re-pair tags (CIGARs changed -- mate info needs refresh)
samtools sort -n clipped.bam | \
samtools fixmate -m - - | \
samtools sort -o sorted.bam -
# 3. Repair MD/NM tags (invalidated by clip; required by mpileup BAQ and IGV)
samtools calmd -b sorted.bam reference.fa > clipped_final.bam
samtools index clipped_final.bam--strand clips primer bases only on the strand the primer is designed for. Without --strand, both strands are clipped at the primer site, removing valid biological sequence on the off-strand.
--both-ends allows clipping at both 5' and 3' positions of the read (some primers can appear at either end after alignment). Necessary for amplicon designs where reads can read through the entire amplicon. When --both-ends is set, --strand is ignored -- primer sites at both ends are clipped regardless of the BED strand column:
samtools ampliconclip --both-ends --soft-clip -b primers.bed input.bam -o clipped.bam# tab-separated, 0-based half-open like all BED
chr1 100 125 primer_1_F +
chr1 500 525 primer_1_R -
chr1 600 625 primer_2_F +
chr1 1000 1025 primer_2_R -Tools that consume the BED: column 1-3 (region), column 6 (strand) is required for --strand. ARTIC primer schemes ship pre-built BEDs (e.g., primer.bed from artic-network/primer-schemes).
| Tool | Approach | When |
|---|---|---|
samtools ampliconclip | Soft-clip from BED, post-alignment | General amplicon panels; modern ARTIC workflows |
iVar trim | Soft-clip with primer-position parsing + quality trim | nf-core/viralrecon; Illumina PrimalSeq route (Andersen lab) |
Note: the ARTIC network's own nanopore field-bioinformatics pipeline (artic minion) trims primers with its align_trim tool, not iVar; iVar (Grubaugh et al. 2019, Genome Biol 20:8) is the Illumina/PrimalSeq route. Modern viral consensus pipelines tend to use ampliconclip then samtools consensus --config hiseq --ambig (Illumina preset) for IUPAC heterozygote handling. See reference-operations for consensus generation.
Clipping invalidates several tags and CIGAR-derived fields:
| Field | Impact | Repair |
|---|---|---|
| CIGAR | New S or H operations added | Automatic from ampliconclip |
| MD:Z | Mismatch positions now wrong | samtools calmd -b in.bam ref.fa |
| NM:i | Edit distance recomputed | samtools calmd |
| TLEN | Template length changes when both mates clipped | samtools fixmate -m |
| ms, MC:Z | Mate score (lowercase per SAMtags) / mate CIGAR | samtools fixmate -m |
A clipped BAM that bypasses fixmate + calmd causes silent failures in bcftools mpileup BAQ (which depends on MD), IGV mismatch coloring, and any tool using NM for filtering.
Amplicon reads at primer locations are by design coordinate-degenerate -- every read mapped to the same amplicon shares the same start/end coordinates because they all come from the same primer pair. samtools markdup would mark essentially every read as a duplicate and erase the dataset. For amplicon panels:
fgbio GroupReadsByUmi -> CallMolecularConsensusReads instead of markdup. See duplicate-handling.| Error | Cause | Solution |
|---|---|---|
MD tag mismatch after clipping | calmd not run | Run samtools calmd -b clipped.bam ref.fa |
| Variant calls with strand bias at every amplicon end | Forgot --strand | Re-run with strand-aware clipping |
| Markdup output shows ~100% duplicates | Amplicon BAM was processed with markdup | Restart from raw alignment; use ampliconclip; skip markdup |
| Unexpected reference confirmation at primer-overlapping variants | ampliconclip not run | Run before variant calling |
| Task | Command |
|---|---|
| Soft-clip primers (strand-aware) | samtools ampliconclip --strand -b primers.bed in.bam -o clipped.bam |
| Soft-clip primers (read-through amplicons) | samtools ampliconclip --both-ends -b primers.bed in.bam -o clipped.bam |
| Hard-clip (irreversible) | samtools ampliconclip --strand --hard-clip -b primers.bed in.bam -o clipped.bam |
| Repair MD/NM after clip | samtools calmd -b clipped.bam ref.fa > final.bam |
| Repair mate info | samtools sort -n - | samtools fixmate -m - - | samtools sort -o out.bam - |
-aa -A -d 600000 -B)© GPTomics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files in alignment-files/alignment-amplicon-clipping of GPTomics/bioSkills.
Open the folder on GitHubat commit d91ed3d
We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.
Amplicon Primer Clipping next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Amplicon Primer Clipping this skillGPTomics/bioSkills | 1.2k | 2 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Pysamdavila7/claude-code-templates | 33k | 10 repos | ~2.5k | Automated safety check: Pass | MIT | |
| PysamK-Dense-AI/scientific-agent-skills | 48k | 1 repos | ~3.4k | Automated safety check: Notes | MIT | |
| Omics ToolsDrugClaw/DrugClaw | 126 | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Tooluniverse Epigenomicswu-yc/LabClaw | 1.1k | 2 repos | ~14k | Automated safety check: Pass | None | |
| Biopython Sequence Analysisjaechang-hits/SciAgent-Skills | 374 | 1 repos | ~8.5k | Automated safety check: Pass | BSD-3-Clause |
davila7/claude-code-templates
Genomic file toolkit. An agent skill from davila7/claude-code-templates.
K-Dense-AI/scientific-agent-skills
Provides Python/HTSlib workflows for genomic files. An agent skill from K-Dense-AI/scientific-agent-skills.
DrugClaw/DrugClaw
Omics and single-cell workflow guide for AnnData, Scanpy-style dataset profiling, PyDESeq2-oriented count checks, pysam alignment inspection, and pyOpenMS mass-spectrometry summaries.
wu-yc/LabClaw
Production-ready genomics and epigenomics data processing for BixBench questions.
jaechang-hits/SciAgent-Skills
Biopython sequence analysis: parse FASTA/FASTQ/GenBank/GFF (SeqIO), NCBI Entrez (esearch/efetch/elink), remote/local BLAST, pairwise/MSA alignment (PairwiseAligner, MUSCLE/ClustalW), phylogenetic…
jaechang-hits/SciAgent-Skills
CLI toolkit for SAM/BAM/CRAM: sort, index, convert, filter, QC alignments.
GPTomics/bioSkills
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.
GPTomics/bioSkills
Installs the bioSkills collection of 425 bioinformatics skills in one step, or only chosen categories, so sequencing, RNA-seq, single-cell and variant tasks get specialized help.
GPTomics/bioSkills
Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.
GPTomics/bioSkills
Filters BAM alignments by FLAG bits, mapping quality and regions with samtools view or pysam, with recipes for common keep and drop cases.
GPTomics/bioSkills
Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.
GPTomics/bioSkills
Sort alignment files by coordinate or read name using samtools and pysam.
Works with
Categories
Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence. Primer-derived bases at a read's 5' end reflect the PCR primer, not the biological sample, so leaving them in causes false reference confirmation at primer sites, suppressed variant allele frequency under primers, and strand-bias artifacts. The skill also warns that standard amplicon BAMs should never go through markdup, because every read anchored at a primer site looks like a coordinate duplicate by design.
Amplicon Primer Clipping fits situations like: processing SARS-CoV-2 ARTIC amplicon sequencing data; trimming primers from hereditary cancer or ctDNA hot-spot panel BAMs; choosing between soft-clip and hard-clip for an amplicon assay.
Run `npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a claude-code`. Or copy the skill folder (alignment-files/alignment-amplicon-clipping in GPTomics/bioSkills) into .claude/skills/bio-alignment-amplicon-clipping in your project. Claude Code loads it when a task matches its description.
Run `npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a codex`. Or copy the skill folder (alignment-files/alignment-amplicon-clipping in GPTomics/bioSkills) into .agents/skills/bio-alignment-amplicon-clipping in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GPTomics/bioSkills --skill bio-alignment-amplicon-clipping -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bio-alignment-amplicon-clipping, .gemini/skills/bio-alignment-amplicon-clipping, .github/skills/bio-alignment-amplicon-clipping and .opencode/skills/bio-alignment-amplicon-clipping in your project.
Going by SKILL.md and its folder, Amplicon Primer Clipping needs a shell for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: samtools 1.19 or newer (ampliconclip itself needs 1.11+); A primer BED file matching the amplicon panel.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Amplicon Primer Clipping is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Amplicon Primer Clipping: Pysam (davila7/claude-code-templates, 33k stars), Pysam (K-Dense-AI/scientific-agent-skills, 48k stars), Omics Tools (DrugClaw/DrugClaw, 126 stars) and Tooluniverse Epigenomics (wu-yc/LabClaw, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
GPTomics (a GitHub organization) maintains it in GPTomics/bioSkills, which has 1,218 GitHub stars. The repository holds 559 skills in this directory. The repository was last updated on August 15, 2026.
Source: GPTomics/bioSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.