just_dna_enricher.cli.authoring_commands¶
just_dna_enricher.cli.authoring_commands ¶
Authoring surfaces: draft, template, check-identifiers and the vrs group (RM260 split this out
of the former single-file cli.py).
draft_ ¶
draft_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
gene: list[str] = typer.Option(
...,
"--gene",
help="Gene to draft from CPIC (repeatable).",
),
drug: list[str] = typer.Option(
[],
"--drug",
help="Also draft CPIC's prescribing recommendations for this drug (repeatable).",
),
allele: list[str] = typer.Option(
[],
"--allele",
help="Draft only these alleles, in all three tables (repeatable; `*1` is always kept, and so is CPIC's `Reference`). A star allele, or an HGVS-named one as CPIC spells it or as it is written (`c.1003G>T(*11)`). A caller emits a bounded allele set, and n alleles is n(n+1)/2 pairs — CYP2D6 is 16,290 diplotypes unfiltered. Requires a single --gene, since a star name is gene-scoped.",
),
population: str | None = typer.Option(
None,
"--population",
help="Draft only this CPIC clinical context (e.g. 'NVI'). Default: every context, as rows.",
),
use: str = typer.Option(
"unstated",
"--use",
help="Declared use: unstated | non-commercial | commercial. CPIC forbids sale, so a draft is SKIPPED when unstated and REFUSED when commercial.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Draft from a built CPIC snapshot only; never reach CPIC live, and read no reference bases, so CPIC's DEL/INS/repeat-count alleles are withheld with the reason (RM253).",
),
cpic_cache: Path | None = typer.Option(
None,
"--cpic-cache",
help="Explicit CPIC snapshot dir.",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Report what would be added; write nothing.",
),
) -> None
Draft PGx tables for one or more genes from CPIC — appends rows, never overwrites one.
Re-runnable and additive, so a multi-gene module is built up a gene at a time. A row whose key is
already in the file is reported, never replaced: what CPIC now says about a row you already wrote
is a finding for pgx, not an edit for this command to make.
Source code in enricher/src/just_dna_enricher/cli/authoring_commands.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
template_ ¶
template_(
kind: str = typer.Argument(
...,
help="Authored CSV to emit a header for, e.g. repeat_alleles.csv",
),
) -> None
Print a header-only CSV for one authored table kind, generated from the live models.
Kept working here, but just-dna-compiler template is canonical: this needs no network, and an
author who installed only the tier that owns the CSV shape should not have to add the network
tier to get a header. See just-dna-compiler stub for a template with rows to replace.
Source code in enricher/src/just_dna_enricher/cli/authoring_commands.py
check_identifiers_ ¶
check_identifiers_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
strict: bool = typer.Option(
False,
"--strict/--best-effort",
help="Exit 1 if any identifier is stale.",
),
traits: bool = typer.Option(
True,
"--traits/--no-traits",
help="Check trait_efo_id against OLS4.",
),
genes: bool = typer.Option(
True,
"--genes/--no-genes",
help="Check gene symbols against HGNC.",
),
pgs: bool = typer.Option(
True,
"--pgs/--no-pgs",
help="Check pgs_id against the PGS Catalog, and the two authored cells beside it.",
),
use: str = typer.Option(
"unstated",
"--use",
help="Declared use: unstated | non-commercial | commercial. A PGS score licensed for academic research only bars sale, so a module citing one compiles ONLY with a declaration — and this flag is the one the compile's own refusal tells you to re-run with.",
),
) -> None
Report obsolete trait terms, retired gene symbols and unrecognised PGS accessions (online).
Writes no authored cell, and records that the question was put. Unlike the rsID check (whose
verdict lands on resolution.csv), these are module-level identifiers with no sidecar column to
record, and filling one from the registry being asked about it would make the comparison vacuous
— see hints.REDUNDANCY_BEARING. What this does write is verification.json: an attestation that
the five checks ran and over how many rows, never a value. A consumer holding the artifact has no
other way to tell "asked and clean" from "never asked" (RM45/RM72).
The PGS leg also writes sources.csv (RM163), and that is not an exception to the sentence above:
the Catalog's license is a field on each score record and it varies, so a module carrying an
academic-research-use-only score must not compile claiming the generic terms. The rows are the
terms, never a value in an authored cell.
Source code in enricher/src/just_dna_enricher/cli/authoring_commands.py
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 325 326 327 328 329 330 331 332 333 334 335 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 | |
vrs_mint_ ¶
vrs_mint_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
offline: bool = typer.Option(
False,
"--offline",
help="Substitutions only: indels need the reference sequence, which means a network call.",
),
) -> None
Stamp ga4gh:VA.… allele ids onto resolution.csv (substitutions offline, indels online).