Agent skill

Bio Alignment Filtering

by majiayu000 in majiayu000/claude-skill-registry

Filter alignments by flags, mapping quality, and regions using samtools view and pysam.

MITAuto-check passedResearch & Science

Install Bio Alignment Filtering

skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill bio-alignment-filtering -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/claude-skill-registry bio-alignment-filtering --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/alignment-filtering .claude/skills/bio-alignment-filtering && rm -rf skills-src

Use ~/.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/

Facts

Skill name
bio-alignment-filtering
GitHub stars
666
Used in
3 other repos
Token cost
~1.9k tokens
SKILL.md length
395 words
Files
2
Skills in repo
1,273
Repo updated
First seen
Licence
MIT

At a glance

Filter alignments by flags, mapping quality, and regions using samtools view and pysam.

  • Extracting specific reads
  • SKILL.md covers Filter Flags, Common FLAG Values, Filter by FLAG and Filter by Mapping Quality, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Removing low-quality alignments

What it does

Bio Alignment Filtering is an agent skill from majiayu000/claude-skill-registry. Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).

It sits in Research & Science, covering Bioinformatics. It works with pysam. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.

When your agent uses it

  • Extracting specific reads
  • Removing low-quality alignments
  • Subsetting to target regions

Example prompts

  • “/bio-alignment-filtering”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 2d14a69. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bio Alignment Filtering loads about 1.9k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 395 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from majiayu000/claude-skill-registry at commit 2d14a69, republished under its MIT licence (© majiayu000). 395 words, ~1,882 tokens.

Download SKILL.mdSave it as .claude/skills/bio-alignment-filtering/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bio-alignment-filtering
description
Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.
tool_type
cli
primary_tool
samtools

Alignment Filtering

Filter alignments by flags, quality, and regions using samtools and pysam.

Filter Flags

OptionDescription
-f FLAGInclude reads with ALL bits set
-F FLAGExclude reads with ANY bits set
-G FLAGExclude reads with ALL bits set
-q MAPQMinimum mapping quality
-L BEDInclude reads overlapping regions

Common FLAG Values

FlagHexMeaning
10x1Paired
20x2Proper pair
40x4Unmapped
80x8Mate unmapped
160x10Reverse strand
320x20Mate reverse strand
640x40First in pair (read1)
1280x80Second in pair (read2)
2560x100Secondary alignment
5120x200Failed QC
10240x400Duplicate
20480x800Supplementary

Filter by FLAG

Keep Only Mapped Reads
bash
samtools view -F 4 -o mapped.bam input.bam
Keep Only Unmapped Reads
bash
samtools view -f 4 -o unmapped.bam input.bam
Keep Only Properly Paired
bash
samtools view -f 2 -o proper.bam input.bam
Remove Duplicates
bash
samtools view -F 1024 -o nodup.bam input.bam
Remove Secondary and Supplementary
bash
samtools view -F 2304 -o primary.bam input.bam
Keep Only Primary Alignments
bash
samtools view -F 256 -F 2048 -o primary.bam input.bam
# Or combined: -F 2304
Keep Read1 Only
bash
samtools view -f 64 -o read1.bam input.bam
Keep Read2 Only
bash
samtools view -f 128 -o read2.bam input.bam
Forward Strand Only
bash
samtools view -F 16 -o forward.bam input.bam
Reverse Strand Only
bash
samtools view -f 16 -o reverse.bam input.bam

Filter by Mapping Quality

Minimum MAPQ
bash
samtools view -q 30 -o highqual.bam input.bam
MAPQ and Mapped
bash
samtools view -F 4 -q 30 -o filtered.bam input.bam
Common MAPQ Thresholds
MAPQMeaning
0Mapped to multiple locations equally well
20~1% chance of wrong mapping
30~0.1% chance of wrong mapping
40~0.01% chance of wrong mapping
60Unique mapping (BWA max)

Filter by Region

Single Region
bash
samtools view -o region.bam input.bam chr1:1000000-2000000
Multiple Regions
bash
samtools view -o regions.bam input.bam chr1:1000-2000 chr2:3000-4000
Regions from BED File
bash
samtools view -L targets.bed -o targets.bam input.bam
Combine Region and Quality
bash
samtools view -q 30 -L targets.bed -o filtered.bam input.bam

Combined Filters

Standard Quality Filter
bash
# Primary, mapped, non-duplicate, MAPQ >= 30
samtools view -F 3332 -q 30 -o filtered.bam input.bam
# 3332 = 4 (unmapped) + 256 (secondary) + 1024 (duplicate) + 2048 (supplementary)
Variant Calling Prep
bash
# Properly paired, primary, no duplicates, MAPQ >= 20
samtools view -f 2 -F 3328 -q 20 -o clean.bam input.bam
# 3328 = 256 (secondary) + 1024 (duplicate) + 2048 (supplementary)
# Note: -f 2 (proper pair) implies mapped, so -F 4 is not strictly needed
ChIP-seq Filter
bash
# Remove duplicates and low MAPQ
samtools view -F 1024 -q 30 -o filtered.bam input.bam

Subsample Reads

Random Subsample
bash
# Keep ~10% of reads
samtools view -s 0.1 -o subset.bam input.bam

# With seed for reproducibility
samtools view -s 42.1 -o subset.bam input.bam
Subsample to Target Count
bash
# Calculate fraction needed
total=$(samtools view -c input.bam)
frac=$(echo "scale=4; 1000000 / $total" | bc)
samtools view -s "$frac" -o subset.bam input.bam

pysam Python Alternative

Basic Filtering
python
import pysam

with pysam.AlignmentFile('input.bam', 'rb') as infile:
    with pysam.AlignmentFile('filtered.bam', 'wb', header=infile.header) as outfile:
        for read in infile:
            if read.is_unmapped:
                continue
            if read.mapping_quality < 30:
                continue
            if read.is_duplicate:
                continue
            outfile.write(read)
Filter with Function
python
import pysam

def passes_filter(read):
    if read.is_unmapped:
        return False
    if read.is_secondary or read.is_supplementary:
        return False
    if read.is_duplicate:
        return False
    if read.mapping_quality < 30:
        return False
    return True

with pysam.AlignmentFile('input.bam', 'rb') as infile:
    with pysam.AlignmentFile('filtered.bam', 'wb', header=infile.header) as outfile:
        for read in infile:
            if passes_filter(read):
                outfile.write(read)
Filter by Region
python
import pysam

with pysam.AlignmentFile('input.bam', 'rb') as infile:
    with pysam.AlignmentFile('region.bam', 'wb', header=infile.header) as outfile:
        for read in infile.fetch('chr1', 1000000, 2000000):
            outfile.write(read)
Filter from BED File
python
import pysam

def read_bed(bed_path):
    regions = []
    with open(bed_path) as f:
        for line in f:
            if line.startswith('#'):
                continue
            parts = line.strip().split('\t')
            regions.append((parts[0], int(parts[1]), int(parts[2])))
    return regions

regions = read_bed('targets.bed')

with pysam.AlignmentFile('input.bam', 'rb') as infile:
    with pysam.AlignmentFile('targets.bam', 'wb', header=infile.header) as outfile:
        for chrom, start, end in regions:
            for read in infile.fetch(chrom, start, end):
                outfile.write(read)
Subsample
python
import pysam
import random

random.seed(42)
fraction = 0.1

with pysam.AlignmentFile('input.bam', 'rb') as infile:
    with pysam.AlignmentFile('subset.bam', 'wb', header=infile.header) as outfile:
        for read in infile:
            if random.random() < fraction:
                outfile.write(read)
Show full SKILL.md (158 more words)Show less

Quick Reference

Tasksamtools command
Mapped onlyview -F 4
Unmapped onlyview -f 4
Properly pairedview -f 2
Primary onlyview -F 2304
No duplicatesview -F 1024
High MAPQview -q 30
Regionview file.bam chr1:1-1000
BED regionsview -L file.bed
Subsample 10%view -s 0.1
Standard filterview -F 3332 -q 30

Common Filter Combinations

PurposeFlags
Clean reads-F 3332 -q 30 (mapped, primary, no dups, high qual)
Variant calling-f 2 -F 3328 -q 20 (proper pair, primary, no dups)
Coverage analysis-F 1284 -q 1 (mapped, primary, no dups)
Count unique-F 2304 (primary only)

Flag breakdowns:

  • 2304 = 256 + 2048 (secondary + supplementary)
  • 3328 = 256 + 1024 + 2048 (secondary + duplicate + supplementary)
  • 3332 = 4 + 256 + 1024 + 2048 (unmapped + secondary + duplicate + supplementary)
  • 1284 = 4 + 256 + 1024 (unmapped + secondary + duplicate)
  • sam-bam-basics - View and understand alignment files
  • alignment-sorting - Sort before/after filtering
  • alignment-indexing - Required for region filtering
  • duplicate-handling - Mark duplicates before filtering
  • bam-statistics - Check filter effects

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/analysis/alignment-filtering of majiayu000/claude-skill-registry.

  • SKILL.md
  • metadata.json

Open the folder on GitHubat commit 2d14a69

Used in 3 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bio Alignment Filtering 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.

Bio Alignment Filtering compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bio Alignment Filtering this skillmajiayu000/claude-skill-registry6663 repos~1.9kAutomated safety check: PassMIT
Amplicon Primer ClippingGPTomics/bioSkills1.2k2 repos~2.2kAutomated safety check: PassMIT
Bio Alignment IndexingGPTomics/bioSkills1.2k2 repos~2.4kAutomated safety check: PassMIT
Pysamdavila7/claude-code-templates32k11 repos~2.5kAutomated safety check: PassMIT
Bio Alignment SortingGPTomics/bioSkills1.2k2 repos~2.6kAutomated safety check: PassMIT
PysamK-Dense-AI/scientific-agent-skills48k1 repos~3.4kAutomated safety check: NotesMIT

Similar skills

  • Amplicon Primer Clipping

    GPTomics/bioSkills

    Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.

    1.2k GitHub starsUsed in 2 repos~2.2k tokens
    Research & ScienceAuto-check passed
  • Bio Alignment Indexing

    GPTomics/bioSkills

    Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.4k tokens
    Research & ScienceAuto-check passed
  • Pysam

    davila7/claude-code-templates

    Genomic file toolkit. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 11 repos~2.5k tokens
    Research & ScienceAuto-check passed
  • Bio Alignment Sorting

    GPTomics/bioSkills

    Sort alignment files by coordinate or read name using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.6k tokens
    Research & ScienceAuto-check passed
  • Pysam

    K-Dense-AI/scientific-agent-skills

    Provides Python/HTSlib workflows for genomic files. An agent skill from K-Dense-AI/scientific-agent-skills.

    48k GitHub starsUsed in 1 repo~3.4k tokens
    Research & ScienceAuto-check: notes
  • Omics Tools

    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.

    125 GitHub stars~1.1k tokensUpdated 6 mo ago
    Research & ScienceAuto-check passed

More from majiayu000/claude-skill-registry

All 1,273 skills in this repo
  • Deep Research

    majiayu000/claude-skill-registry

    Multi-source deep research using firecrawl and exa MCPs. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 6 repos~1.1k tokens
    Auto-check passed
  • Exa Search

    majiayu000/claude-skill-registry

    Neural search via Exa MCP for web, code, and company research.

    666 GitHub starsUsed in 5 repos~856 tokens
    Auto-check passed
  • Fal AI Media

    majiayu000/claude-skill-registry

    Unified media generation via fal.ai MCP — image, video, and audio.

    666 GitHub starsUsed in 5 repos~1.7k tokens
    Auto-check passed
  • Pyzotero

    majiayu000/claude-skill-registry

    Interact with Zotero reference management libraries using the pyzotero Python client.

    666 GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check: notes
  • Bgpt Paper Search

    majiayu000/claude-skill-registry

    Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server.

    666 GitHub starsUsed in 4 repos~619 tokens
    Auto-check: notes
  • Bio Alignment Pairwise

    majiayu000/claude-skill-registry

    Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.

    666 GitHub starsUsed in 4 repos~1.7k tokens
    Auto-check passed

Works with

Questions about Bio Alignment Filtering

What does Bio Alignment Filtering do?

Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Bio Alignment Filtering is an agent skill from majiayu000/claude-skill-registry. Filter alignments by flags, mapping quality, and regions using samtools view and pysam.

When should I use Bio Alignment Filtering?

Bio Alignment Filtering fits situations like: extracting specific reads; removing low-quality alignments; subsetting to target regions.

How do I install Bio Alignment Filtering in Claude Code?

Run `npx skills add majiayu000/claude-skill-registry --skill bio-alignment-filtering -a claude-code`. Or copy the skill folder (skills/analysis/alignment-filtering in majiayu000/claude-skill-registry) into .claude/skills/bio-alignment-filtering in your project. Claude Code loads it when a task matches its description.

How do I install Bio Alignment Filtering in Codex?

Run `npx skills add majiayu000/claude-skill-registry --skill bio-alignment-filtering -a codex`. Or copy the skill folder (skills/analysis/alignment-filtering in majiayu000/claude-skill-registry) into .agents/skills/bio-alignment-filtering in your project. Codex loads it when a task matches its description.

Can I use Bio Alignment Filtering in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill bio-alignment-filtering -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-filtering, .gemini/skills/bio-alignment-filtering, .github/skills/bio-alignment-filtering and .opencode/skills/bio-alignment-filtering in your project.

What does Bio Alignment Filtering need to run?

SKILL.md names no scripts, command-line tools or credentials: Bio Alignment Filtering is instructions for the agent only. Our summary lists: Python 3.

Does Bio Alignment Filtering access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bio Alignment Filtering safe to install?

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.

What licence does Bio Alignment Filtering use?

Bio Alignment Filtering is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bio Alignment Filtering use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bio Alignment Filtering?

Skills that share tags, products or a category with Bio Alignment Filtering: Amplicon Primer Clipping (GPTomics/bioSkills, 1.2k stars), Bio Alignment Indexing (GPTomics/bioSkills, 1.2k stars), Pysam (davila7/claude-code-templates, 32k stars) and Bio Alignment Sorting (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bio Alignment Filtering?

majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 1,273 skills in this directory. The repository was last updated on October 7, 2026.

Source: majiayu000/claude-skill-registry on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.