Skip to content

Strict colon loci: colon keys, peaks converted at import - #21

Merged
YPARK merged 1 commit into
mainfrom
colon-only-loci
Oct 1, 2026
Merged

YPARK merged 1 commit into
mainfrom
colon-only-loci

Conversation

@YPARK

@YPARK YPARK commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Loci are recognized only in colon form, chr:start-end, through legume-genomic-types 0.5.0. Outside spellings are converted once where names enter, and everything inside works on colon keys.

Keys

  • Canonical key {chr}:{start}-{end}: chr prefix dropped in any case, the rest's case kept (chrX:0-100, CHRX:0-100 and X:0-100 all give X:0-100).
  • feature_names::locus_key (re-exported from genomic-types) is the one answer to "is this a locus, and under which key". The overlap map and every per-name path now key a row the same way.

Matching

  • The gene rule never cuts a locus (tagged with a feature-type suffix or not) and keeps names whose symbol would be all digits (chr1_100_200), so such rows cannot collapse onto one key.
  • auto_detect warns when an axis reads as intervals only in a non-colon spelling.
  • GeneIndex resolves a locus query only against locus rows by key, case kept, including rows whose /-core is a locus. Gene queries never land on locus rows.

Import boundary

  • colon_peak_names rewrites peak rows to chr:start-end (from chr1-100-200, chr1_100_200, chr1:100_200). Rows count as peaks by feature type (peak / ATAC) for 10x h5/zarr, features.tsv and h5ad, or for an untyped list when every row reads as an interval.

Breaking (0.7.0)

  • Keys change from X_0_100 to X:0-100. Names like chr1_100_200 stored in existing backends are no longer loci.
  • parse_locus accepts colon form only.

Version 0.7.0.

Loci are recognized only in colon form, chr:start-end, through
legume-genomic-types 0.5.0; keys become {chr}:{start}-{end}, chr prefix
dropped in any case and case kept. Outside spellings are converted once
where names enter.

- feature_names: locus_key re-exported from genomic-types as the one
  answer to "is this a locus, and under which key"; the overlap map and
  every per-name path key a row the same way.
- The gene rule never cuts a locus (tagged or not) and keeps names whose
  symbol would be all digits (chr1_100_200), so such rows cannot
  collapse onto one key.
- auto_detect warns when an axis reads as intervals only in a non-colon
  spelling.
- GeneIndex resolves a locus query only against locus rows by key, case
  kept, including rows whose '/'-core is a locus; gene queries never land
  on locus rows.
- colon_peak_names rewrites peak rows to chr:start-end at import: by
  feature type for 10x h5/zarr, features.tsv and h5ad, or for an untyped
  list when every row reads as an interval.

Release 0.7.0.
@YPARK
YPARK merged commit 0701908 into main Oct 1, 2026
5 checks passed
@YPARK
YPARK deleted the colon-only-loci branch October 1, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant