pysam-genomic-files

Access and manipulate genomic data files via a Pythonic htslib interface.

298|27|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill pysam-genomic-files
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pysam-genomic-files
Source: https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/pysam-genomic-files
Command: npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill pysam-genomic-files

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 querying standard genomic file formats like BAM, VCF, and FASTA, enabling efficient bioinformatics analysis directly within your Python environment.

Core Features & Use Cases

  • Alignment File Handling: Read, filter, and write SAM, BAM, and CRAM alignment files.
  • Variant File Processing: Parse, filter, and analyze VCF and BCF variant files.
  • Sequence Access: Efficiently retrieve sequences from indexed FASTA files.
  • Coverage & Pileup: Calculate per-base coverage and detailed read pileups.
  • CLI Integration: Seamlessly call samtools and bcftools commands from Python.

Quick Start

Use the pysam-genomic-files skill to read the first 10 reads from the 'sample.bam' file in the region chr1:10000-20000.

Frequently Asked Questions about pysam-genomic-files

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

FAQPage Schema
How do I read and filter BAM files within a specific genomic region using Python?

To read and filter BAM files in Python, you can use a Pythonic interface to htslib for region-based querying. This allows you to directly fetch alignment data, such as extracting reads from a BAM file within specified chromosomal coordinates.

Can I run samtools and bcftools commands directly in my Python scripts?

Yes, you can run samtools and bcftools commands directly in your Python scripts. This integration facilitates advanced command-line operations for genomic data manipulation without leaving your Python environment.

What is the best way to calculate per-base coverage and read pileups for SAM files?

The best way to calculate per-base coverage and read pileups for SAM files is by using a Pythonic interface to htslib. It enables detailed pileup analysis and coverage calculation directly from alignment files.

How do I parse and filter VCF variant files programmatically?

You can parse and filter VCF variant files programmatically by utilizing a Python interface to htslib. This approach supports parsing, filtering, and analyzing VCF and BCF variant files efficiently in Python.

Does this Python library support extracting sequences from indexed FASTA files?

Yes, this Python library supports extracting sequences from indexed FASTA files. It provides efficient sequence access, allowing you to retrieve specific genomic sequences directly within your bioinformatics analysis scripts.

Do I need to install htslib separately to process CRAM files in Python?

You do not need to install htslib separately to process CRAM files in Python. The library acts as a Pythonic interface to htslib, inherently supporting the reading and writing of CRAM, BAM, and SAM alignment files.