just_dna_enricher.cli.mitomap_commands¶
just_dna_enricher.cli.mitomap_commands ¶
The mitomap group: build, miss and publish (RM260 split this out of the former single-file
cli.py).
mitomap_build_ ¶
mitomap_build_(
out: Path = typer.Option(
repro_out("mitomap"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/mitomap-*.parquet + release.json).",
),
dump: Path | None = typer.Option(
None,
"--dump",
exists=True,
dir_okay=False,
help="A mitomap.dump.sql.gz you already have. Without it the dump is downloaded — the data surface answers plain curl, unlike the web surface. A local dump carries no Last-Modified, so that snapshot is honestly unlabelled.",
),
url: str = typer.Option(
DEFAULT_MITOMAP_URL,
"--url",
help="Source URL for the dump (used only when --dump is absent).",
),
) -> None
Cut the two curated mtDNA variant tables, their citations and the references out of the dump.
602 mmutation rows and 494 rtmutation rows out of 6.76 million lines. The snapshot records
every count this build computes — rows per table, the dump's own per-table edit dates, how much of
reference.nlmid is a PMID, the alleles that cannot be spelled as VCF and the brackets that are
not a documented VCEP class — because a number computed and dropped is one every reader has to
recompute.
Source code in enricher/src/just_dna_enricher/cli/mitomap_commands.py
mitomap_miss_ ¶
mitomap_miss_(
out: Path = typer.Option(
repro_out("mitomap_miss"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/mitomap_miss.parquet + release.json).",
),
mitomap_cache: Path | None = typer.Option(
None,
"--mitomap-cache",
exists=True,
file_okay=False,
help="Built MITOMAP snapshot (see `mitomap build`). Omit it and $JUST_DNA_MITOMAP_CACHE is used.",
),
clinvar_cache: Path | None = typer.Option(
None,
"--clinvar-cache",
exists=True,
file_okay=False,
help="Built ClinVar snapshot (see `clinvar build`). Omit it and $JUST_DNA_CLINVAR_CACHE is used.",
),
) -> None
Join MITOMAP against the ClinVar chrMT parquet and write the increment (RM171).
A derived lane, not a download. Its acquire stage is both parents being on disk, and a parent that is absent is reported as could-not-run rather than as an empty increment — a miss set computed without ClinVar would say MITOMAP publishes a thousand alleles nobody else has, from a comparison that never ran.
Exact (start, ref, alt) on chrMT, upper-cased both sides, no position-level fallback. Four
buckets, and draft-panel --source mitomap-miss writes only one of them.
Source code in enricher/src/just_dna_enricher/cli/mitomap_commands.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
mitomap_publish_ ¶
mitomap_publish_(
snapshot_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Built snapshot directory (data/ + release.json).",
),
repo: str = typer.Option(
DEFAULT_MITOMAP_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 MITOMAP snapshot (publisher/dev).
Publishable on the source's own terms: CC BY 3.0, with commercial and clinical use stated free and
attribution the one condition — which the snapshot's SourceRow carries. Only the parent lane
publishes. The derived miss snapshot pins two parent digests, so a pulled copy would be an
increment whose own currency check cannot be run by whoever pulled it; it is rebuilt locally from
the parents instead, which is cheaper than the download and cannot be stale.