pysam

Read, manipulate, and write genomic alignment and variant files via Python.

19|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill pysam-tondevrel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pysam
Source: https://github.com/tondevrel/scientific-agent-skills/tree/main/skills/pysam
Command: npx skills add https://github.com/tondevrel/scientific-agent-skills --skill pysam-tondevrel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the complex task of reading, writing, and manipulating genomic data files like SAM, BAM, CRAM, VCF, and BCF, which are essential for high-throughput sequencing analysis.

Core Features & Use Cases

  • Genomic Data Access: Efficiently access and process billions of DNA fragments aligned to a reference genome.
  • Variant Analysis: Analyze genomic variants such as SNPs and indels.
  • Bioinformatics Pipelines: Build custom pipelines for quality control and data processing in next-generation sequencing (NGS).

Quick Start

Use the pysam skill to fetch and print reads from chromosome 1 between positions 10000 and 10100 in the 'aligned_reads.bam' file.

Frequently Asked Questions about pysam

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read and manipulate SAM, BAM, and CRAM alignment files in Python?

To manipulate genomic alignment files like SAM, BAM, and CRAM in Python, this Skill provides a programmatic wrapper around the htslib library for efficient next-generation sequencing data access and processing.

What is the best way to analyze genomic variants from VCF and BCF files?

Analyzing genomic variants such as SNPs and indels from VCF and BCF files is done by programmatically accessing the variant records through the provided htslib wrapper functions.

How do I fetch reads from a specific chromosome region in a BAM file?

Fetching reads from a specific chromosome region in a BAM file requires indexed files for efficient random access, allowing you to query specific coordinates like chromosome 1 positions 10000 to 10100.

Do I need indexed files for random access in next-generation sequencing data processing?

Yes, indexed files are required for efficient random access when processing next-generation sequencing data, enabling targeted retrieval of reads and variants from specific genomic coordinates.

What should I be careful about when handling read attributes and coordinate systems in genomic alignments?

When handling genomic alignments, you need careful handling of read attributes and coordinate systems to avoid errors during quality control and data processing in bioinformatics pipelines.