just_dna_enricher.cli.strchive_commands¶
just_dna_enricher.cli.strchive_commands ¶
STRchive: the strchive builder group, draft-repeats and check-repeat-bands (RM260 split this
out of the former single-file cli.py).
strchive_build_ ¶
strchive_build_(
out: Path = typer.Option(
repro_out("strchive"),
"--out",
file_okay=False,
help="Output snapshot directory (writes STRchive-loci.json + release.json).",
),
catalogue: Path | None = typer.Option(
None,
"--catalogue",
exists=True,
dir_okay=False,
help="A STRchive-loci.json you already have. Without it the file is downloaded.",
),
release: str | None = typer.Option(
None,
"--release",
help="Upstream release tag to pin, e.g. v2.26.0. Without it, the default branch, unlabelled.",
),
) -> None
Fetch (or copy in) the STRchive catalogue and record its provenance beside it.
Pin a release: the default branch moves, so a comparison whose reference is "whatever was there
that afternoon" cannot be re-run, and only a pinned build gets a dataset label the verification
record can name.
Source code in enricher/src/just_dna_enricher/cli/strchive_commands.py
strchive_publish_ ¶
strchive_publish_(
snapshot_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Built snapshot directory (STRchive-loci.json + release.json).",
),
repo: str = typer.Option(
DEFAULT_STRCHIVE_REPO_ID,
"--repo",
help="Target HuggingFace dataset repo (owner/name).",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Show what would be uploaded; send nothing.",
),
commit_message: str | None = typer.Option(
None, "--message", "-m", help="Commit message."
),
) -> None
Create-or-update the dataset repo and upload the built STRchive catalogue (publisher/dev).
Publishable on the source's own terms: STRchive is MIT, which grants redistribution outright.
This lane had no publish command because it grew from a check rather than from a cache, not
because anything withheld the permission — the same distinction the roster draws between CIViC's
absent ensure_* (a gap) and PharmVar's (a refusal).
Publish a pinned build. An unlabelled snapshot carries no dataset, so whoever pulls it can
run the comparison and cannot say which release they compared against — build with --release
first, and this refuses nothing but says so.
Source code in enricher/src/just_dna_enricher/cli/strchive_commands.py
draft_repeats_ ¶
draft_repeats_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
genes: list[str] = typer.Option(
[],
"--gene",
"-g",
help="Restrict to these genes. Repeatable; omit for every catalogue locus.",
),
catalogue: Path | None = typer.Option(
None,
"--catalogue",
exists=True,
help="Built STRchive snapshot directory (see `strchive build`), or a STRchive-loci.json. Omit it and $JUST_DNA_STRCHIVE_CACHE (or the shared cache base) is used.",
),
use: str = typer.Option(
"unstated",
"--use",
help=f"Declared use: one of {sorted(VALID_DECLARED_USE)}.",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Report what would be added; write nothing.",
),
) -> None
Draft repeat_alleles.csv identity rows from STRchive — appends, never overwrites a row.
The bands are not drafted, and that is the design rather than a limitation. A drafted row
carries the gene, the motif as the catalogue spells it, the trait CURIE where the locus names
exactly one disease, and a conclusion placeholder — so the table cannot compile until a human
has filled in what each band means. measure_min/measure_max stay empty: run
check-repeat-bands once you have written them and it will report where the catalogue disagrees.
The catalogue's coordinates, ref_copies and locus_structure have no authored column to land
in; the run counts them and says so rather than dropping them silently.
Source code in enricher/src/just_dna_enricher/cli/strchive_commands.py
check_repeat_bands_ ¶
check_repeat_bands_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
catalogue: Path | None = typer.Option(
None,
"--catalogue",
exists=True,
help="Built STRchive snapshot directory (see `strchive build`), or a STRchive-loci.json.",
),
strict: bool = typer.Option(
False,
"--strict/--best-effort",
help="Carried into the report. A band difference NEVER fails, in either mode.",
),
) -> None
Compare a module's repeat_alleles.csv bands against STRchive's, and report the differences.
Writes no authored cell and never fails on a difference. Where a catalogue and an expert
author draw a repeat threshold in different places, both are claims by an authority, and a compile
that refused would make this format pick the winner — the rule the ClinVar clin_sig and PGx
allele-function checks already follow. --strict is accepted so the flag means one thing across
the tier, and it changes nothing here but the mode recorded in the report.
The catalogue's pathogenic_max is reported as its own finding and is never written: it is the
longest allele the literature records, not a clinical ceiling, and a module that imported it would
silently answer nothing at all for a longer one.