alterlab-pysam

Read, process, and write genomic data in SAM/BAM/CRAM, VCF/BCF, and FASTA/FASTQ formats.

58|9|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-pysam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alterlab-pysam
Source: https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/bioinformatics/alterlab-pysam
Command: npx skills add https://github.com/AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-pysam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Genomic data analysis requires robust, consolidated tooling to read, manipulate, and write common genomic formats (SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ) within Python pipelines.

Core Features & Use Cases

  • Read/write SAM/BAM/CRAM alignments and VCF/BCF variants
  • Query reference sequences and perform pileup for coverage
  • Integrate multiple file types in end-to-end bioinformatics workflows
  • Use Case: Build pipelines that extract variant contexts, compute coverage, and validate results across samples.

Quick Start

Install pysam and open a BAM file with AlignmentFile to iterate reads.

Frequently Asked Questions about alterlab-pysam

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

FAQPage Schema
How do I read and write SAM/BAM/CRAM alignments in Python pipelines?

You can read and write SAM/BAM/CRAM alignments in Python by opening the file with AlignmentFile to iterate reads, preserving headers and metadata for bioinformatics pipelines.

Does pysam support indexed region queries for VCF/BCF variant analysis?

Yes, pysam supports indexed region queries for VCF/BCF variant analysis using fetch and pileup functions to extract variant contexts and compute coverage across genomic regions.

What is the best way to integrate multiple genomic file formats in a Python workflow?

The best way to integrate multiple genomic file formats in a Python workflow is using a unified I/O toolkit to process SAM/BAM/CRAM, VCF/BCF, and FASTA/FASTQ files together for data integration across samples.

When do I need to query reference sequences and perform pileup for coverage?

You need to query reference sequences and perform pileup for coverage when building bioinformatics pipelines that compute coverage depth, validate results across samples, and extract variant contexts from alignment data.

Can I use pysam for quality control and sequence extraction from FASTA/FASTQ files?

Yes, you can use pysam for quality control and sequence extraction from FASTA/FASTQ files, as it provides Python tools to read, process, and write genomic data across these formats within bioinformatics pipelines.