Python toolkit that reads and writes SAM/BAM/CRAM, VCF/BCF, and FASTA/FASTQ files for NGS pipelines.
- CCM score
- 65 of 100
- skills.sh installs
- 233
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers alignment, variant, and sequence file operations, plus integrated workflows that combine BAM, VCF, and reference data
- Includes reference guides for alignment files, variant files, sequence files, and common workflows, along with a quick start for each file type
- Enforces 0-based, half-open coordinates, with
fetch()region strings following the 1-based samtools convention - Designed for bioinformatics pipelines that need random access to indexed genomic files, coverage calculation, and pileup analysis
Install
$ npx -y skills add davila7/claude-code-templates --skill pysam -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Pysam
Overview
Pysam is a Python module for reading, manipulating, and writing genomic datasets. Read/write SAM/BAM/CRAM alignment files, VCF/BCF variant files, and FASTA/FASTQ sequences with a Pythonic interface to htslib. Query tabix-indexed files, perform pileup analysis for coverage, and execute samtools/bcftools commands.
When to Use This Skill
This skill should be used when:
- Working with sequencing alignment files (BAM/CRAM)
- Analyzing genetic variants (VCF/BCF)
- Extracting reference sequences or gene regions
- Processing raw sequencing data (FASTQ)
- Calculating coverage or read depth
- Implementing bioinformatics analysis pipelines
- Quality control of sequencing data
- Variant calling and annotation workflows
Quick Start
Installation
uv pip install pysam
Basic Examples
Read alignment file:
import pysam
# Open BAM file and fetch reads in region
samfile = pysam.AlignmentFile("example.bam", "rb")
for read in samfile.fetch("chr1", 1000, 2000):
print(f"{read.query_name}: {read.reference_start}")
samfile.close()
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Data Science & Analytics, Research & Academic, Python
- First seen
- Jun 3, 2026
Questions
What does the pysam skill do?
The pysam skill is a genomic file toolkit for reading and writing SAM, BAM and CRAM alignments, VCF and BCF variant files, and FASTA and FASTQ sequences. It can extract regions, calculate coverage and run samtools or bcftools commands for NGS data processing pipelines.
How do I install the pysam skill?
Run npx -y skills add davila7/claude-code-templates --skill pysam -y in your project. After installing, the agent can work with BAM, VCF and FASTA files directly from Python using the pysam module.
Where does pysam stand in its category?
Pysam is listed under Data Science & Analytics on Claude Marketplaces, alongside skills such as azure-kusto and analyze-project. Its focus is genomic sequencing files rather than general analytics.
What does pysam need before I use it?
The skill's SKILL.md installs the pysam Python module with uv pip install pysam. Random access to regions needs index files such as .bai for BAM, .fai for FASTA and .tbi for VCF.gz.
More from davila7/claude-code-templates
All 398- Cross Site Scripting And HTML Injection Testing232
- Pufferlib232
- Cc Skill Strategic Compact231
- Cc Skill Project Guidelines Example230
- Active Directory Attacks228
- Datacommons Client225
- HTML Injection Testing223
- Brenda Database222
- Heygen Best Practices222
- Hmdb Database222
- Umap Learn222
- AWS Penetration Testing220
- Cellxgene Census220
- Clerk Auth220
- Kaizen220
- Lamindb219
- Nosql Expert219
- Pyopenms219
- Capa Officer218
- Ena Database218
- Cosmic Database217
- Histolab217
- Neuropixels Analysis217
- Pydeseq2217
Similar to Pysam
More Data Science & AnalyticsbiopythonSkilldavila7/claude-code-templates354 installsBiopython toolkit for molecular biology covering sequences, NCBI Entrez queries, BLAST, structures, and phylogenetics.
deeptoolsSkillk-dense-ai/scientific-agent-skills2.2K installsCatalog summary for deepTools: NGS toolkit for BAM-to-bigWig conversion, QC, and feature-centered profile plots.
GnomadMCP serverpipeworx-ioPopulation allele frequencies and variant annotations from the gnomAD genome database, keyless.
genomic-coordinatesSkillK-Dense-AI/scientific-agent-skills1.1K installsConvert genomic coordinates across formats, normalise variant representations, and detect assembly or contig-naming mismatches.
gtarsSkilldavila7/claude-code-templates210 installsHigh-performance Rust toolkit for genomic intervals with Python bindings, covering overlaps, coverage, and ML tokenization.
tooluniverse-variant-analysisSkillmims-harvard/tooluniverse381 installsVariant-calling and VCF analysis toolkit with bundled scripts for HaplotypeCaller runs, coding-variant filtering, and VAF-based fraction calculations.