executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
pysamRoutes agents using pysam for SAM/BAM/CRAM, VCF/BCF, tabix-indexed tables, FASTA/FASTQ, bundled samtools/bcftools wrappers, and installation or build troubleshooting.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this repo skill when a task involves the Python package pysam: reading or writing high-throughput sequencing files, manipulating alignments or variants, indexing genomic interval files, fetching FASTA/FASTQ records, calling bundled samtools/bcftools commands from Python, or diagnosing install/build/import failures.
references/package-overview.md for the package scope, install options, verified version facts, and route summary.references/troubleshooting.md for cross-cutting setup, coordinate, index, and routing failures.references/repo-provenance.md before deciding whether this skill is current for a specific checkout.scripts/check_pysam_environment.py when you need a source-free import and smoke diagnostic for the active Python environment.Prefer Bioconda when users want the most reliable install path:
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install pysam
PyPI wheels are usually enough for ordinary Python use:
python -m pip install pysam
python -c 'import pysam; print(pysam.__version__)'
For a deeper package check, run:
python scripts/check_pysam_environment.py
| User task | Read |
|---|---|
Open, read, write, index, fetch, count, or pile up SAM/BAM/CRAM data; edit AlignedSegment flags, CIGAR, tags, sequence, or qualities | sub-skills/alignment-io/SKILL.md |
Read, write, filter, subset, or construct VCF/BCF files with VariantFile, VariantHeader, VariantRecord, INFO/FORMAT/sample fields, or indexed fetches | sub-skills/variant-io/SKILL.md |
Compress/index/fetch tabix tables; parse BED/GTF/GFF/VCF rows; use FastaFile, FastxFile, or FASTQ quality arrays | sub-skills/tabix-fasta/SKILL.md |
Translate shell samtools/bcftools commands into Python calls; handle catch_stdout, save_stdout, usage(), get_messages(), or SamtoolsError | sub-skills/command-wrappers/SKILL.md |
Install pysam, build from source, link external htslib, compile Cython extensions, migrate legacy csamtools names, or inspect build helpers | sub-skills/troubleshooting-build/SKILL.md |
alignment-io even when the final solution also calls samtools.variant-io even when the file is tabix-indexed.tabix-fasta.samtools sort, samtools faidx, bcftools view, or bcftools query and wants Python code, start with command-wrappers.import pysam or installation fails before any data workflow can run, start with troubleshooting-build.chr1:101-200 follow samtools-style 1-based inclusive conventions.AlignmentFile.fetch() and VariantFile.fetch() require an appropriate index for random access; use sequential modes only when the workflow supports them..tbi or .csi index..fai indexes; FASTQ streaming uses FastxFile and does not require random-access indexing.scripts/check_pysam_environment.py verifies imports, versions, command wrapper presence, and tiny source-free operations across the major routes.sub-skills/alignment-io/scripts/alignment_smoke.py creates a tiny BAM and exercises alignment reads, indexing, coverage, pileup, and quality helpers.sub-skills/variant-io/scripts/variant_smoke.py writes and reads a tiny VCF with INFO/FORMAT/sample fields.sub-skills/tabix-fasta/scripts/tabix_fasta_smoke.py creates tiny tabix, FASTA, and FASTQ fixtures.sub-skills/command-wrappers/scripts/command_wrapper_smoke.py checks dispatcher usage, stdout handling, and safe samtools command behavior.sub-skills/troubleshooting-build/scripts/inspect_build_config.py prints redacted build/import diagnostics.