vimalinx/bio-agent / .claude/skills/plot-roh-py
plot-roh-py
UnverifiedUse when plotting runs of homozygosity from `run-roh.pl` style output directories into PNG tracks, optionally filtered by region, sample list, or group contrast.
plot-roh-py
Python plotting script for ROH visualization. It scans a directory of *.txt.gz files, reads both GT and RG records, and renders per-sample ROH tracks to plot.png or a user-specified output file.
Quick Start
- Command:
plot-roh.py <dir> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/plot-roh.py - Default output:
plot.png
When To Use This Tool
- Visualizing ROH calls that have already been converted into the
GT/RGtext format expected by the script - Rendering static PNG ROH track plots without writing custom matplotlib code
- Filtering ROH calls by minimum length, marker count, quality, or genomic region
- Comparing grouped samples with
--highlight +group1,-group2
Common Patterns
# Basic non-interactive plot
plot-roh.py roh_dir -o roh.png
# Restrict plotted calls by region and quality/length filters
plot-roh.py roh_dir -r chr1:1-5000000 -l 100000 -n 20 -q 30 -o chr1.png
# Use a sample/group file and highlight calls enriched in one group
plot-roh.py roh_dir -s samples.tsv -H +cases,-controls -o grouped.png
Recommended Workflow
- Feed the script a directory containing gzipped text files with both
GTgenotype rows andRGregion rows. - Use
-ofor batch output or-ifor interactive plotting, but not both. - Add
-swhen you need renaming or grouping, then layer-Hon top for between-group highlighting. - Tighten
-l,-n,-q, and-rbefore plotting large cohorts so the rendered track view stays readable.
Guardrails
- The script does not accept raw
bcftools rohoutput by itself; the source explicitly says it expects extraGTlines such as those produced byrun-roh.pl. - A directory with only
RGrows failed in live testing withIndexError: list index out of rangebecauseRGrows must include at least eight columns, including quality. - A minimal gzipped file containing two
GTrows plus oneRGrow successfully produced a PNG (3000 x 150) in local testing. --versionis not a real metadata path; running it without a valid data directory falls through toNo data files found in "--version".-i/--interactiveand-o/--outfileare mutually exclusive, and the script will exit with a usage error if both are provided.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |