pysam-genomics

Read, modify, filter, and write BAM/CRAM/VCF files via pysam.

6|2|Updated Jun 11, 2026
One-click install
npx skills add https://github.com/pradyumnasagar/open-research-skills --skill pysam-genomics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pysam-genomics
Source: https://github.com/pradyumnasagar/open-research-skills/tree/main/skills/bioinformatics-sequence/pysam-genomics
Command: npx skills add https://github.com/pradyumnasagar/open-research-skills --skill pysam-genomics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pysam, htslib, and includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the manipulation of NGS data by providing a Python interface to htslib, allowing users to read, modify, filter, and write BAM/CRAM/VCF files programmatically.

Core Features & Use Cases

  • NGS Data Manipulation: Read, modify, filter, and write NGS files like BAM/CRAM/VCF using pysam.
  • Python Integration: Seamlessly integrate with Python logic for advanced analysis.
  • Use Case: For example, users can extract variant or coverage data from a BAM file, build custom pipelines, or query regions without loading entire files.

Quick Start

Open the BAM file 'input.bam' and iterate through all alignments using pysam.

Frequently Asked Questions about pysam-genomics

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

FAQPage Schema
How do I read and filter BAM files using Python?

You can read and filter BAM files using Python by interfacing with htslib, which enables programmatic access to iterate through alignments, extract specific data, and write modified NGS outputs.

Can I query specific regions in a CRAM file without loading the entire dataset?

Yes, querying specific regions in a CRAM file without loading the entire dataset is possible by utilizing the Python interface to htslib, enabling efficient data extraction and targeted analysis.

Does pysam support modifying and writing VCF files for custom pipelines?

Pysam supports modifying and writing VCF files by providing a Python interface to htslib, allowing you to manipulate variants and build custom bioinformatics pipelines programmatically.

What is the best way to extract coverage data from a BAM file for NGS analysis?

The best way to extract coverage data from a BAM file is to use a Python interface to htslib, enabling you to iterate through alignments and calculate depth without loading the entire file.

Do I need htslib installed to manipulate NGS data with pysam?

Yes, you need htslib installed because pysam functions as a Python interface to htslib, requiring both dependencies to read, modify, filter, and write BAM/CRAM/VCF files.

Related Skills