just_dna_enricher.cli.gene_reference_commands¶
just_dna_enricher.cli.gene_reference_commands ¶
Gene-level reference snapshots: gnomad constraint and mane (RM260 split this out of the former
single-file cli.py).
constraint_build_ ¶
constraint_build_(
tsv: Path | None = typer.Option(
None,
"--tsv",
exists=True,
dir_okay=False,
help="Local gnomAD constraint metrics TSV. Omit and pass --download to fetch it.",
),
download: bool = typer.Option(
False,
"--download",
help="Download the lane's gnomAD constraint release (4.1.2, 574.5 MB bgzipped) into --out first.",
),
out: Path = typer.Option(
repro_out("gnomad_constraint"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/gnomad_constraint.parquet + release.json).",
),
) -> None
Reduce the per-transcript constraint TSV to the gene-level parquet the resolver reads.
Source code in enricher/src/just_dna_enricher/cli/gene_reference_commands.py
constraint_publish_ ¶
constraint_publish_(
snapshot_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Built snapshot directory (data/*.parquet + release.json).",
),
repo_id: str | None = typer.Option(
None,
"--repo",
help=f"Target HF dataset (owner/name). Default: {DEFAULT_CONSTRAINT_REPO_ID}.",
),
commit_message: str | None = typer.Option(
None, "--message", "-m", help="Commit message."
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Show what would be uploaded, after the checks the publish runs. Reads the repo's file list; uploads nothing.",
),
) -> None
Create-or-update the dataset repo and upload the built constraint snapshot (publisher/dev).
Source code in enricher/src/just_dna_enricher/cli/gene_reference_commands.py
mane_build_ ¶
mane_build_(
download: bool = typer.Option(
False,
"--download",
help="Fetch the release from NCBI. Without --release the newest version is discovered from current/README_versions.txt and then pinned to its versioned directory.",
),
release: str | None = typer.Option(
None,
"--release",
help="MANE version to pin, e.g. 1.5. Resolves to release_<version>/, never current/.",
),
summary: Path | None = typer.Option(
None,
"--summary",
exists=True,
dir_okay=False,
help="Local MANE.GRCh38.v<ver>.summary.txt.gz. Use instead of --download to build offline.",
),
changed: Path | None = typer.Option(
None,
"--changed",
exists=True,
dir_okay=False,
help="Local MANE.GRCh38.v<ver>.changed_select_accessions.txt.gz.",
),
not_in_mane: Path | None = typer.Option(
None,
"--not-in-mane",
exists=True,
dir_okay=False,
help="Local MANE.GRCh38.v<ver>.protein_coding_genes_not_in_mane.txt.gz.",
),
versions: Path | None = typer.Option(
None,
"--versions",
exists=True,
dir_okay=False,
help="Local README_versions.txt. Optional, and the only way an offline build can name its release: a filename is never parsed for one.",
),
out: Path = typer.Option(
repro_out("mane"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/*.parquet + release.json).",
),
) -> None
Reduce one pinned MANE release to the three parquet tables the numbering frame needs.
All three files, in one pass. The summary is the frame; changed_select_accessions is the
currency check and Update_Affects_CDS is the numbering-frame axis stated by the source; the
negative roster is what makes "MANE has no answer for this gene" distinguishable from "nobody
asked", with the reason attached. Shipping the cache without the thing that notices it going
stale is the defect this command exists to close.
There is no --offline flag: the off-switch is passing the local files instead of
--download. And there is no --use flag, because NCBI states a policy rather than a licence —
every gating axis is unknown, and check_declared_use returns a skip for an unknown whatever
the declaration says, so the gate would silently skip every build. A flag feeding a gate that
never gates is a flag that does nothing (@acquisition-gate-is-not-a-read-gate).
MANE is the default, not the answer. A gene with two rows carries two CDS numbering frames
and MANE_status says which; a gene with one row says nothing about the isoforms MANE does not
carry, so a pass treating this table as an oracle would be wrong in a way the table cannot report.
Source code in enricher/src/just_dna_enricher/cli/gene_reference_commands.py
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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |