just_dna_enricher.cli.lookup_commands¶
just_dna_enricher.cli.lookup_commands ¶
Read-only lookups: the hint and litvar groups (RM260 split this out of the former single-file
cli.py).
hint_variant_ ¶
hint_variant_(
rsid: str | None = typer.Option(
None, "--rsid", help="dbSNP id to look up."
),
chrom: str | None = typer.Option(
None, "--chrom", help="Chromosome (with --start)."
),
start: int | None = typer.Option(
None,
"--start",
help="1-based position (with --chrom).",
),
ref: str | None = typer.Option(
None,
"--ref",
help="Reference allele, for an allele-exact lookup.",
),
alts: str | None = typer.Option(
None,
"--alts",
help="Alt allele(s), comma-separated.",
),
ambiguity: bool = typer.Option(
False,
"--ambiguity",
help="Warn when the answer is not unique.",
),
frequencies: bool = typer.Option(
False,
"--frequencies",
help="Add gnomAD populations (paced: ~6s).",
),
offline: bool = typer.Option(
False,
"--offline",
help="Snapshots only; never touch the network.",
),
ensembl_cache: Path | None = typer.Option(
None,
"--ensembl-cache",
help="Explicit Ensembl cache.",
),
clinvar_cache: Path | None = typer.Option(
None,
"--clinvar-cache",
help="Explicit ClinVar snapshot.",
),
pubmind_cache: Path | None = typer.Option(
None,
"--pubmind-cache",
help="Explicit PubMind snapshot (see `pubmind build`); $JUST_DNA_PUBMIND_CACHE otherwise.",
),
as_json: bool = typer.Option(
False,
"--json",
help="Emit the full machine answer.",
),
) -> None
Validity, coordinates, alleles, populations and clinical calls for one variant.
Nothing is decided for you: a one-to-many rsID returns every locus and a position matching
several rsIDs returns every candidate. The coordinate is reported, never written into
variants.csv — resolution puts it in resolution.csv, which is where it belongs.
Source code in enricher/src/just_dna_enricher/cli/lookup_commands.py
hint_recover_ ¶
hint_recover_(
chrom: str = typer.Option(
...,
"--chrom",
help="Chromosome of the old coordinate.",
),
start: int = typer.Option(
...,
"--start",
help=f"1-based {GRCH37_BUILD} position.",
),
ref: str | None = typer.Option(
None,
"--ref",
help="Reference allele, to narrow the answer.",
),
alts: str | None = typer.Option(
None,
"--alts",
help="Alt allele(s), comma-separated.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Skip the lookup and say so.",
),
as_json: bool = typer.Option(
False,
"--json",
help="Emit the full machine answer.",
),
) -> None
Which rs-number GRCh37 dbSNP records at an hg19/GRCh37 coordinate.
For a paper that predates GRCh38. Author the rs-number, not a converted position: an
rs-number resolves into a coordinate the compiler can cross-examine, where a lifted-over position
becomes the row's only witness to itself. Nothing is written — the rs-number is the row's
identity, and a machine filling one migrates variant_key with no authored edit anywhere.
Source code in enricher/src/just_dna_enricher/cli/lookup_commands.py
hint_citation_ ¶
hint_citation_(
pmid: str | None = typer.Option(
None, "--pmid", help="PubMed id to check."
),
doi: str | None = typer.Option(
None,
"--doi",
help="DOI to check (the one you authored).",
),
pmcid: str | None = typer.Option(
None,
"--pmcid",
help="PubMed Central id (PMC…) to resolve to the PubMed id tables key on.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Skip the check and say so.",
),
as_json: bool = typer.Option(
False,
"--json",
help="Emit the full machine answer.",
),
) -> None
Does this citation exist, and is it the paper you meant?
A paywall hides the fulltext, never the PubMed record, so existence is answerable for paywalled
work; Crossref covers what PubMed does not index at all. Every answer is tri-state — unknown
means the registry could not be asked, which is not the same as "no such paper".
Existence is not identity. PMIDs are densely allocated, so a recalled or invented number is
very likely to be a real record for a different article, and pmid_exists alone cannot catch a
fabricated citation. The title, journal, year and first author come back in the same response and
are printed for exactly that comparison (S12).
--pmcid goes the other way. Every pmid in the schema keys on the PubMed id — studies.csv,
a binning row's and a pharm_variants.csv row's alike — and a curator holding only a PMC… id
had no route to it: the schema refused the cell and named no remedy. This resolves it and then asks PubMed which paper that is. The id is reported,
never written: filling pmid from NCBI would make the existence check compare NCBI with itself.
Source code in enricher/src/just_dna_enricher/cli/lookup_commands.py
hint_trait_ ¶
Is this trait id current, obsolete, or unknown?
hint_gene_ ¶
Is this gene symbol approved or retired?
litvar_coverage_ ¶
litvar_coverage_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
offline: bool = typer.Option(
False,
"--offline",
help="No network; every locus is recorded as unchecked.",
),
quiet: bool = typer.Option(
False,
"--quiet",
help="Only the tier summary, not a line per locus.",
),
) -> None
Report LitVar's literature coverage per locus, naming the tier that answered.
It answers which papers discuss an allele that is already identified. It does not answer which allele a name meant — those read as the same question and are not. Measured against the two hardest records in this repository (CIViC 1955 and 2131, four candidate alleles with registered CAIDs), the index returns no node for any of them, because PubTator3 mines titles and abstracts and those alleles live in a table inside a paywalled paper. Do not reach for this to recover an identity.
Writes no row and no sources.csv entry: nothing here reaches a module's tables, so the module
does not use this source. What it does write is verification.json — an attestation that the
question was put, over how many loci, and at which tier each was answered.
Source code in enricher/src/just_dna_enricher/cli/lookup_commands.py
litvar_gene_ ¶
List every node LitVar holds under a gene symbol, grouped by tier. Writes nothing.
This is the endpoint that serves line-delimited Python repr() rather than JSON, and the tier
split is the reason to look: of 588 HFE nodes on 2026-09-01, 220 are rsID-only, 69 carry a
ClinGen allele id, exactly one is the gene node, and the remaining 298 are unnormalized protein
strings — text a miner saw, not an identity anything should join on.