lib-pysam

Read, manipulate, and write genomic data files via a Python interface.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/biomaps-infra/blender-opencode --skill lib-pysam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lib-pysam
Source: https://github.com/biomaps-infra/blender-opencode/tree/main/.opencode/skills/lib-pysam
Command: npx skills add https://github.com/biomaps-infra/blender-opencode --skill lib-pysam

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill simplifies complex bioinformatics tasks by providing a Pythonic interface to manipulate and analyze genomic data files like alignments (BAM/CRAM), variants (VCF/BCF), and sequences (FASTA/FASTQ).

Core Features & Use Cases

  • Alignment File Operations: Read, write, and query SAM/BAM/CRAM files for analyzing sequencing alignments.
  • Variant File Operations: Process VCF/BCF files for variant analysis, filtering, and annotation.
  • Sequence File Operations: Extract sequences from FASTA or process raw reads from FASTQ.
  • Integrated Workflows: Combine multiple file types for comprehensive genomic analyses, such as quality control, coverage calculation, and variant validation.
  • Use Case: Analyze sequencing data to identify genetic variants by reading BAM alignment files, filtering variants in a VCF file, and comparing them against a reference genome in FASTA format.

Quick Start

Use the lib-pysam skill to read the first 1000 bases from the reference sequence file 'hg19.fasta' on chromosome 1.

Frequently Asked Questions about lib-pysam

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

FAQPage Schema
How do I read and query genomic regions from a BAM file in Python?

You can read and query SAM/BAM/CRAM alignments in Python to extract specific genomic regions, calculate coverage, and perform pileup analysis for next-generation sequencing data pipelines.

What is the best way to process VCF variant files for filtering and annotation?

Processing VCF and BCF files in Python enables efficient variant analysis, filtering, and annotation by providing a programmatic interface to execute underlying bcftools commands.

Can I extract sequences directly from a FASTA reference genome using Python?

Yes, you can extract sequences directly from FASTA files and process raw reads from FASTQ files, allowing you to pull specific genomic intervals like the first 1000 bases of a chromosome.

Does this Python genomics library support executing samtools commands directly?

Yes, the Python interface supports executing samtools and bcftools commands directly, enabling seamless integration of command-line operations into genomic data processing workflows.

How do I combine alignment, variant, and sequence files for comprehensive genomic analysis?

You can combine BAM alignments, VCF variants, and FASTA sequences within integrated workflows to validate variants against a reference genome, perform quality control, and calculate coverage.