Agent skill · research science · k-dense-ai

genomic-coordinates

Convert genomic intervals between coordinate conventions, normalise and compare variant representations, and detect assembly or contig-naming mismatches before they corrupt an analysis. Use whenever coordinates cross a format, tool, or assembly boundary - converting between BED, GFF/GTF, VCF, SAM/BAM, WIG, PSL, genePred, Picard interval_list, or region strings; reconciling 0-based half-open with 1-based inclusive; left-aligning or trimming indels; checking whether two variant records describe the same change; mapping genomic to transcript, CDS, or protein positions; auditing a BED/GTF/VCF for convention violations; or diagnosing GRCh37 vs hg19 vs GRCh38 vs T2T, chr-prefix, and liftover problems. Triggers include "off by one", "0-based", "1-based", "half-open", "coordinate system", "left-align", "normalize variant", "bcftools norm", "chr prefix", "wrong genome build", "liftover", "REF mismatch", and "HGVS".

Why this skill is useful

Adds executable scripts for converting genomic coordinates across multiple formats and conventions, which are not commonly found in public documentation.

What it needs

Requires python installed locally. About 6k tokens when loaded. Last updated 2026-08-03. 32,849 stars on the source repository.

What this skill does

Genomic Coordinates When to use Any time a coordinate crosses a boundary: between two file formats, between two tools, between two assemblies, or between the genome and a transcript. The rule A coordinate is three facts, not one: the number, the convention it is written in, and the assembly it was measured against. Carry all three or the number is not interpretable. Coordinate errors are the quietest class of bug in genomics. An off-by-one BED file parses, sorts, and intersects without complaint. A GRCh37 VCF joined against a GRCh38 annotation returns rows. A right-shifted indel simply fails to match its entry in ClinVar, and the result is a variant reported as novel. Nothing raises an error; the answer is just wrong, and it is wrong in a direction that looks plausible. So: convert with the table, not from memory, and verify against the reference whenever a reference is available. The two conversions The end coordinate never moves. If a conversion changed both numbers, it is wrong. Which format is which 0-based, half-open 1-based, inclusive --- --- BED, bedGraph, bigWig, narrowPeak GFF3, GTF, VCF BAM/CRAM (binary POS) SAM (text POS) PSL, genePred, refFlat WIG, Picard intervallist MAF (UCSC multiple alignment) MAF (TCGA mutation annotation) PyRanges, pybedtools GRanges/IRanges, samtools & UCSC & Ensembl region strings Both "MAF" formats exist, they mean different things, and they disagree. UCSC serves 0-based files through a 1-based browser box. references/format-conventions.md has the full table with per-format detail. Zero-length BED features (chromStart == chromEnd, a legal insertion point) are reported as unrepresentable rather than converted to end = start - 1. Exit code is 1 when any interval is degenerate or invalid. Variants are not intervals A VCF POS for an indel is the anchor base — the base before the event, itself unchanged. And the same change can be written many ways: chr1:7:CAC:C, chr1:3:CAC:C and chr1:2:GCA:G are one deletion. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills k-dense-ai/genomic-coordinates

View the source on GitHub

Browse the @skills marketplace