Commit Graph
4 Commits
Author SHA1 Message Date
Timothy Kassis ce67928122 Add genomic-coordinates skill
Covers the conventions that produce silent off-by-one and wrong-assembly
errors: 0-based half-open vs 1-based inclusive across BED/GFF/VCF/SAM and
friends, VCF indel anchoring and left-alignment, GRCh37 vs hg19 vs GRCh38
vs T2T, and genomic-to-transcript-to-CDS-to-protein positions.

Four standard-library scripts, no network:

- convert_coords.py    intervals between 21 conventions
- normalize_variant.py trim and left-align against a reference, compare
                       two representations for equivalence
- check_contigs.py     identify the assembly, report why two files
                       will not join
- audit_intervals.py   scan a BED/GTF/GFF3/VCF for convention violations

Build signatures are read from the UCSC chrom.sizes files and the NCBI
GRCh37.p13 assembly report; region-string semantics follow the samtools
manual, including that REF:START runs to the end of the contig and that
GRCh38 HLA contig names need htslib brace quoting.
2026-07-26 15:33:36 -07:00
Timothy Kassis cca1e05ddf Add uncertainty-and-units skill under skills/uncertainty-and-units
Metrology skill covering units and measurement uncertainty, with six
standard-library-first CLIs that run offline:

- propagate_uncertainty.py: GUM framework and Monte Carlo on the same
  model, with the JCGM 101 clause 8 linearization check
- uncertainty_budget.py: components stated the way certificates state
  them, Welch-Satterthwaite effective dof, coverage factor from t
- format_result.py: round the uncertainty first, then the value to the
  same decimal place; plus-minus, concise, and ASCII forms
- convert_units.py: pint conversion including context-only relations,
  with the uncertainty carried through the local derivative
- audit_units.py: static scan for silent unit and uncertainty defects
  (UNIT001-004, UNC001-004, CONST001) with suppression directives
- check_plausibility.py: 14 dimensionless groups, 8 characteristic
  scales, and 22 cited magnitude bands, each dimensionality-checked
  before any number is reported

Measurement models are parsed to an AST and reduced by an explicit walk;
nothing is compiled or executed. Physical constants come from
scipy.constants at run time rather than from literals.

Tests in tests/uncertainty-and-units/ (85 cases) verify the metrology
against published values and assert every bundled script passes the
skill's own auditor with no findings.
2026-07-26 15:08:29 -07:00
Timothy Kassis 87b598a51a Add ontology-term-resolution skill
Resolve free-text scientific labels to ontology term IDs and validate
existing CURIEs against the EBI Ontology Lookup Service (OLS4). Covers the
concepts whose identifiers are routinely invented rather than looked up:
tissue, cell type, disease, phenotype, assay, chemical, organism, sex, and
developmental stage.

Two stdlib-only scripts, one per direction:

  resolve_terms.py   text -> ID, escalating exact -> token -> fulltext and
                     labelling every hit exact_label / exact_synonym /
                     partial, so a fuzzy guess cannot pass as a match
  validate_terms.py  ID -> verdict (not_found, obsolete + replacement,
                     label_mismatch, wrong_ontology, wrong_branch), exiting
                     non-zero so it works as a CI gate on a metadata file

Behaviour verified against the live service, and the reason the skill ships
scripts rather than a recipe:

- exact=true is exact *token* matching, not exact label: "liver" returns 161
  hits in UBERON, 1 once queryFields is restricted to label
- /search never returns is_obsolete or term_replaced_by, even when they are
  named in fieldList, so only term detail can answer whether an ID is current
- ontology=efo returns MONDO and CL hits, because ontologies import each other
- the obo_id index has holes: MONDO:0000001 is live and defined by MONDO but
  unindexed, so an IRI fallback is needed to avoid a false not_found
- IRIs are not all OBO PURLs; EFO and Orphanet use their own namespaces
- OxO is retired and serves HTML with HTTP 200
- a branch check does not exclude cell types from anatomy, since CARO places
  cell under anatomical structure

Tests: 59 in tests/ontology-term-resolution, 53 offline with stubbed network
plus 6 live smoke tests gated behind OLS_LIVE_TESTS=1 that pin the API
behaviour above.
2026-07-26 14:45:44 -07:00
Timothy Kassis b80fcda721 Enhance skill environment management and documentation
- Updated AGENTS.md and CONTRIBUTING.md to clarify the use of isolated environments for each skill, addressing dependency conflicts and ensuring proper testing setups.
- Modified tests/run_all.py to implement the `--isolated` flag, allowing for the creation of throwaway environments per skill based on `tests/skill-requirements.toml`.
- Improved handling of unavailable packages and added detailed instructions for contributors on managing skill dependencies.
2026-07-26 13:58:18 -07:00