claude/skills/igv-screenshots/SKILL.md
This skill generates IGV screenshots using igver for genomic visualization. Use when user asks to "take IGV screenshot", "IGV snapshot", "visualize BAM in IGV", "igver screenshot", "show me the reads at", "screenshot genomic region", "visualize methylation in IGV", "IGV plot of BAM", "generate IGV images", "look at this region in IGV", "screenshot structural variant", "haplotype visualization in IGV", or any mention of IGV/igver with BAM files. Handles Singularity/Docker execution, chromosome naming mismatches, methylation coloring (ONT/PacBio), and batch generation for large region sets.
npx skillsauth add sahuno/llm_configs igv-screenshotsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate publication-quality IGV screenshots programmatically from BAM files across genomic regions using igver.
Gather from user before generating:
Input files (required):
.txt file with one path per line.bai indexRegions (required):
.bed — BED3 or BED6), region text file (.txt), or inline chr:start-endGenome (default: hg19):
hg38, hg19, mm10, mm39GRCh38 -> hg38, GRCm38 -> mm10, etc.references/genome-aliases.mdVisualization type (ask user):
colorBy BASE_MODIFICATION)colorBy TAG HP + group TAG HP)Output directory — follow naming convention: IGV_{genome}_{description}
IGV_hg38_L1HS_methylation, IGV_mm10_structural_variants, IGV_hg38_tumor_normal_comparisonBefore generating the script, ALWAYS verify:
# Check BAM chromosome names
samtools view -H sample.bam | grep @SQ | head -3
# Look for: SN:chr1 (UCSC) vs SN:1 (Ensembl/NCBI)
# Check BED chromosome names
head -3 regions.bed
If they don't match, add a preprocessing step:
# Add 'chr' prefix to BED
awk 'BEGIN{OFS="\t"} { if ($1 !~ /^chr/) $1 = "chr" $1; print }' regions.bed > regions_chrPrefix.bed
# Remove 'chr' prefix from BED
sed 's/^chr//' regions.bed > regions_noChr.bed
ls sample.bam.bai # or sample.bai
wc -l regions.bed
# If >500 regions: warn user it will take a while, suggest screen/tmux/SLURM
#!/bin/bash
set -euo pipefail
BAM="<BAM_PATH>"
REGIONS="<REGIONS_PATH>"
OUTDIR="<OUTPUT_DIR>" # Convention: IGV_{genome}_{description}
GENOME="<GENOME>" # hg38, hg19, mm10, etc.
IGVER_IMAGE="docker://sahuno/igver:latest"
mkdir -p "${OUTDIR}"
singularity exec \
--bind <BIND_PATHS> \
"${IGVER_IMAGE}" \
igver \
--input "${BAM}" \
--regions "${REGIONS}" \
--output "${OUTDIR}" \
--genome "${GENOME}" \
--dpi 600 \
--overlap-display squish \
--max-panel-height 200 \
--no-singularity \
--format png
#!/bin/bash
set -euo pipefail
BAM="<BAM_PATH>" # Must contain MM/ML tags from dorado/guppy
REGIONS="<REGIONS_PATH>"
OUTDIR="<OUTPUT_DIR>" # Convention: IGV_{genome}_{description}
GENOME="hg38"
IGVER_IMAGE="docker://sahuno/igver:latest"
# Create methylation config
IGV_CONFIG="${OUTDIR}/igv_methylation_prefs.txt"
mkdir -p "${OUTDIR}"
echo "colorBy BASE_MODIFICATION" > "${IGV_CONFIG}"
singularity exec \
--bind <BIND_PATHS> \
"${IGVER_IMAGE}" \
igver \
--input "${BAM}" \
--regions "${REGIONS}" \
--output "${OUTDIR}" \
--genome "${GENOME}" \
--dpi 600 \
--overlap-display expand \
--max-panel-height 1000 \
--no-singularity \
--format png \
--igv-config "${IGV_CONFIG}"
Methylation colors: Red = methylated CpG (5mC), Blue = unmethylated CpG.
# Create haplotype config
cat > "${OUTDIR}/igv_haplotype_prefs.txt" << 'EOF'
group TAG HP
colorBy TAG HP
sort READNAME
EOF
# Then pass: --igv-config "${OUTDIR}/igv_haplotype_prefs.txt"
| Flag | Description | Default |
|------|-------------|---------|
| -i, --input | BAM/BEDPE/VCF/bigWig file(s), or .txt with paths | required |
| -r, --regions | Regions: chr1:100-200, .txt file, or .bed file | required |
| -o, --output | Output directory | /tmp |
| -g, --genome | Reference genome (aliases supported) | hg19 |
| --dpi | DPI resolution | 300 |
| -p, --max-panel-height | Max pixel height per track panel | 200 |
| -d, --overlap-display | expand, collapse, or squish | squish |
| -c, --igv-config | IGV batch commands file (injected before each snapshot) | none |
| -f, --format | png, svg, or pdf | png |
| --no-singularity | Required when running inside a container | false |
| --singularity-image | Container image path | docker://sahuno/igver:latest |
| --singularity-args | Extra Singularity args (bind mounts) | -B /home |
| Data Type | -d | -p | --dpi | --igv-config |
|-----------|------|------|---------|-----------------|
| Short-read WGS/WES | squish | 200 | 300 | none |
| Long-read ONT/PacBio | expand | 1000 | 600 | none |
| ONT methylation | expand | 1000 | 600 | colorBy BASE_MODIFICATION |
| Haplotagged reads | squish | 500 | 600 | group TAG HP + colorBy TAG HP |
| Structural variants | squish | 200 | 300 | none |
All directories containing input files, output, and config must be bind-mounted:
--bind /data1/project,/data1/references,/home
igver auto-binds BAM directories and output, but additional paths (BED files, igv-config) may need explicit mounting.
| Problem | Solution |
|---------|----------|
| Empty screenshots | Chromosome names don't match — check chr prefix |
| "Region not found" | Wrong genome build or chr naming convention |
| Nested container error | Add --no-singularity flag |
| OOM on large region sets | Use load_figures=False (CLI does this automatically since v1.1) |
| Missing BAM index | Create with samtools index sample.bam |
| Slow on many regions | Run via SLURM or screen/tmux |
references/genome-aliases.mdreferences/igv-batch-commands.mdexamples//data1/greenbab/users/ahunos/apps/igver/development
Decide whether and how to scatter genomics workloads across chromosomes or region tiles, then gather the per-shard outputs back together correctly. Use proactively whenever the user mentions parallelizing per-chromosome, sharding by chrom, tiling the genome, splitting a BAM/VCF/BED by region, merging per-chrom outputs, or has a workflow with obvious per-chromosome parallelism (variant calling, methylation pileup/DMR, coverage, liftover, peak calling, SV calling). Also triggers on /scatter-gather, "scatter X across chromosomes", "shard this", "chunked variant calling", "merge per-chrom VCFs", "gather these bedmethyl files", "concat these bigwigs", or any per-region parallelism question. **Trigger even when the user is also using Snakemake or Nextflow** — those skills handle DAG plumbing while this one defines *what* to scatter, *whether* it's even safe to scatter (some computations like DSS DMLtest pool globally and break under naive sharding), and *how* to gather each output format without silent corruption. Especially trigger on questions about merging per-chromosome BAM / VCF / BED / bedMethyl / bigwig outputs, or whether a scatter-gather is equivalent to running on the whole genome.
tools
Build self-contained, offline HTML genomic-region reports with igv-reports (create_report). Each HTML bundles igv.js viewers per region with embedded BAM/VCF data slices and default tracks (CpG islands, gencode, RepeatMasker); a reviewer clicks the variant table to inspect read-level evidence with no internet, no server, no IGV install. USE this skill whenever the user wants an HTML, clickable, or browseable viewer of genomic data — phrases like "HTML IGV report", "offline IGV", "self-contained HTML", "clickable viewer", "create_report", "igv-reports", "email this viewer", or any browseable HTML of reads at variants, fusion breakpoints, SV junctions, viral integrations, ChIP peaks, or ROIs. Trigger even when the user doesn't say "igv-reports" — giveaway is HTML/clickable/offline plus genomic regions. Also fire on /igv-reports. DO NOT use for static PNG/PDF/SVG IGV screenshots — use the igv-screenshots skill. Supports hg38, mm10, mm39, T2T. Defaults: --flanking 300, --standalone, genome-tagged output.
development
Verify that structural-variant / breakpoint calls are actually real by checking the chimeric reads that support them. Use whenever the user has caller output (Severus, Manta, Sniffles2, Delly, GRIDSS, MELT, Arriba, SvABA) and wants to validate / audit / QC / double-check their calls — viral integrations (HTLV-1, HBV, HPV, EBV), gene fusions (BCR-ABL, IGH translocations), mobile element insertions (L1, Alu, SVA), translocations. Trigger on phrasings like "is this integration real?", "should I trust this fusion call?", "are these false positives?", "are these PASS calls actually supported by reads?", "QC my SV calls", or any per-call chimeric-read / contamination / bimodality / T-vs-N read overlap question. Also fires on BAM @PG -Y / SA-tag questions on chimeric BAMs, and on /chimeric-read-validation. Output is a per-call TSV with pass / needs_review / fail verdicts. Do not use for calling SVs (use the caller), IGV screenshots (use igv-reports), or RNA-level fusion FDR (use Arriba).
tools
Run a stage-gated runtime/resource optimization study for any bioinformatics tool or command-line program on a SLURM HPC cluster. Walks through preflight, OFAT factor scan, 2^k confirmation factorial, build-mode + alternative-implementation comparison, input-size scan, out-of-sample validation, and produces a fitted predictive resource model (wall_s and peak_rss as functions of input size), a machine-readable model.yaml with caveats, a full REPORT.md, and a one-page exec summary PDF. Trigger PROACTIVELY whenever the user asks to "benchmark", "optimize", "tune", "characterize runtime/memory", "find best config", "build a resource model", "how does X scale", or "what should I put in my Snakemake resources directive for tool Y" — for any compute-bound bioinformatics step (sort, dedup, alignment, variant calling, methylation calling, basecalling, indexing, pileup, liftover). Also triggers on /runtime-resource-study or /benchmark-tool. Skip only for one-off quick timing where a single number suffices and no model is needed.