just_dna_enricher.cli.alphagenome_commands¶
just_dna_enricher.cli.alphagenome_commands ¶
The AlphaGenome surfaces: the atlas and alphagenome groups (RM260 split this out of the former
single-file cli.py).
atlas_generate_ ¶
atlas_generate_(
refetch: bool = typer.Option(
False,
"--refetch",
help="Re-download the pinned sources even if they are already on disk and match.",
),
) -> None
Fetch the pinned Atlas .proto sources and generate the gRPC bindings from them.
The sources are not vendored: the repository carries a commit id and a sha256 per file, and a
file that does not match its pin is refused rather than used (RM196). Needs grpcio-tools,
which is in \[dev] and deliberately not in \[atlas] — the runtime imports the bindings without
it. A released wheel carries both the sources and the bindings already, so this is a checkout
command.
Source code in enricher/src/just_dna_enricher/cli/alphagenome_commands.py
alphagenome_avi_build_ ¶
alphagenome_avi_build_(
input_: Path = typer.Option(
...,
"--input",
exists=True,
dir_okay=False,
help="The extracted alphagenome_variant_impact_score_snvs.tsv.gz (its .tbi must be beside it). Required, and there is no default URL: acquisition is yours, under your own acceptance of the AlphaGenome Services Additional Terms.",
),
out: Path = typer.Option(
repro_out("alphagenome_avi"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/alphagenome_avi-*.parquet, avi_knots.parquet, release.json, LICENSE.txt).",
),
contig: list[str] = typer.Option(
None,
"--contig",
help="Build only these contigs, repeatable. Omit for every contig the .tbi index knows.",
),
workers: int = typer.Option(
12,
"--workers",
min=1,
help="How many contigs to read at once. Twelve ran 24 contigs in 41-46 minutes; one takes about four times as long.",
),
no_hash: bool = typer.Option(
False,
"--no-hash",
help="Skip the source sha256. It is a few minutes over 88.5 GB; release.json then records null, which is unknown rather than unpinned.",
),
) -> None
Build the AVI snapshot from a local copy of the artifact.
raw_score is stored as Int32 at a scale of 10**5 — exactly lossless, since the artifact
prints at most five decimals — and PHRED is not stored: it is a rank, a function of
raw_score, and the 466 KB knot table beside the data reconstructs it while also carrying the
per-value ambiguity interval a threshold has to be checked against.
Source code in enricher/src/just_dna_enricher/cli/alphagenome_commands.py
alphagenome_check_ ¶
alphagenome_check_(
spec: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
reference: Path | None = typer.Option(
None,
"--reference",
exists=True,
file_okay=False,
help="An AVI snapshot directory. Omit to use $JUST_DNA_ALPHAGENOME_AVI_CACHE.",
),
threshold: float | None = typer.Option(
None,
"--threshold",
help="A PHRED cut to check the module's variants against. Without one the pass is entirely offline: there is no question the local artifact cannot answer.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Never reach the Atlas. Straddling variants are recorded as nobody-asked, not as decided.",
),
refinement_cap: int = typer.Option(
DEFAULT_REFINEMENT_CAP,
"--refinement-cap",
min=1,
help="Refuse rather than refine more than this many variants over the network in one run.",
),
strict: bool = typer.Option(
False,
"--strict",
help="Carried for the report; see the docstring.",
),
) -> None
Cross-check a module's variants against AlphaGenome's AVI scores. Reports, never repairs.
The local snapshot answers most of it. The Atlas is asked only where the knot table says the local data genuinely cannot decide — a threshold falling inside a printed score's PHRED interval — and that set is computed offline, before any request is spent.
Source code in enricher/src/just_dna_enricher/cli/alphagenome_commands.py
alphagenome_expression_ ¶
alphagenome_expression_(
spec: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
gene: str = typer.Option(
...,
"--gene",
help="HGNC symbol. REQUIRED even with an explicit interval: the server-side gene filter is not an optimisation, and an unfiltered interval query is refused before it is sent.",
),
chrom: str | None = typer.Option(
None,
"--chrom",
help="Contig of an explicit interval. Wins over the gene's MANE span.",
),
start: int | None = typer.Option(
None,
"--start",
min=0,
help="1-based start of that interval.",
),
end: int | None = typer.Option(
None,
"--end",
min=0,
help="1-based end of that interval.",
),
min_score: float | None = typer.Option(
None,
"--min-score",
help="Keep only pairs whose magnitude reaches this. Distal scores run ~10x lower than scores at the gene, so a flat bar keeps the proximal rows and looks like it filtered on effect.",
),
max_rows: int = typer.Option(
DEFAULT_MAX_ROWS,
"--max-rows",
min=1,
help="Refuse rather than write more rows than this. Raising it is a deliberate act.",
),
offline: bool = typer.Option(
False,
"--offline",
help="No-op with a warning: this pass reads the Atlas, not a snapshot.",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Report what would be written without writing it.",
),
use: str = typer.Option(
"unstated",
"--use",
help="Declared use recorded on the licence row: unstated|non-commercial|commercial. AlphaGenome Output is NON-COMMERCIAL ONLY, so an undeclared run writes nothing and says so — pass --use non-commercial.",
),
) -> None
Fill expression_effects.csv with AlphaGenome's per-gene expression effects for one gene.
Example — and the --use is not decoration, an undeclared run is a no-op:
just-dna-enricher alphagenome expression ./my_module --gene TBX1 --use non-commercial
One row per (variant, gene): which way the variant moves that gene's predicted expression, how many of the 371 tissue tracks agree, and how far it sits from the gene. The interval is the gene's MANE span widened by the model's measured +/-512 kb attribution horizon, unless --chrom/--start/--end supply one; either way the gene names the server-side filter, and the MANE lane is still consulted for the distance, which an explicit interval cannot supply.
A whole gene is ~3.3 M SNVs at the measured 1,091 SNVs/s — about 50 minutes — and the cost is printed before the query runs rather than discovered during it.
Source code in enricher/src/just_dna_enricher/cli/alphagenome_commands.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
alphagenome_publish_ ¶
alphagenome_publish_(
snapshot: Path | None = typer.Argument(
None,
exists=True,
file_okay=False,
help="The built snapshot directory. Omit to use the resolved cache ($JUST_DNA_ALPHAGENOME_AVI_CACHE, then the cache base), falling back to where `alphagenome build` writes.",
),
repo: str | None = typer.Option(
None,
"--repo",
help=f"Target HF dataset. Default: {DEFAULT_ALPHAGENOME_AVI_REPO_ID}.",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Show what would be uploaded. Reads the repo's file list; sends nothing.",
),
message: str | None = typer.Option(
None, "--message", "-m", help="Commit message."
),
) -> None
Publish the AVI snapshot to HuggingFace.
Its own command because no other one can reach this lane (RM202). cache rebuild --publish
walks lanes that have a rebuild adapter, and this lane cannot have one — its source is behind an
eligibility gate, so there is nothing for an unattended rebuild to fetch. RM198 gave the lane a
publish_repo and left it unreachable.
The upload is two commits and, above 5 GB, goes through the resumable uploader (RM199): the
payload first, then release.json — the description must never arrive before the bytes it
describes.
Source code in enricher/src/just_dna_enricher/cli/alphagenome_commands.py
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 | |