just_dna_enricher.cli.opentargets_commands¶
just_dna_enricher.cli.opentargets_commands ¶
The opentargets group: build the Open Targets Platform snapshot lane, and fill a module from it (RM333).
opentargets_build_ ¶
opentargets_build_(
source: Path | None = typer.Option(
None,
"--source",
exists=True,
file_okay=False,
help="A directory already holding the release's parts as `<dataset>/part-*.parquet` (and `croissant.json`). Omit to download them into `<out>/source/`.",
),
parts: int | None = typer.Option(
None,
"--parts",
min=1,
help="Download only the first N parts of each dataset, for a test-sized build. The snapshot records what it read against the total, and the pass warns that it is partial.",
),
release: str = typer.Option(
OPENTARGETS_RELEASE,
"--release",
help="The Platform release directory to pin.",
),
out: Path = typer.Option(
repro_out("opentargets"),
"--out",
file_okay=False,
help="Output snapshot directory (writes data/*.parquet + release.json).",
),
) -> None
Download (or read) one Open Targets Platform release and flatten it into the lane's snapshot.
The full release this lane reads is about 22 GB of parquet over EBI's FTP (coloc alone is 16.5 GB), and it trims to a few GB: GWAS credible sets and their members, the L2G scores, the GWAS × molecular-QTL colocalisations and every variant's per-transcript consequences. No row is dropped for its value.
Source code in enricher/src/just_dna_enricher/cli/opentargets_commands.py
opentargets_enrich_ ¶
opentargets_enrich_(
spec: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
snapshot: Path | None = typer.Option(
None,
"--snapshot",
exists=True,
file_okay=False,
help="The built snapshot. Omit to use $JUST_DNA_OPENTARGETS_CACHE, then the cache base.",
),
strict: bool = typer.Option(
False,
"--strict",
help="Refuse a partial snapshot (one built from some of a dataset's parts).",
),
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 rows: unstated|non-commercial|commercial.",
),
) -> None
Fill locus_to_gene.csv, colocalisations.csv, consequences.csv and RM239's posterior on gwas_effects.csv.
Reads only the provisioned snapshot, so it never fetches and needs no --offline: with no snapshot
it says so and writes nothing. Coordinates come from resolution.csv, so run enrich first.