just_dna_enricher.cli.panel_commands¶
just_dna_enricher.cli.panel_commands ¶
draft-panel and the closed set of authorities it drafts from (RM260 split this out of the former
single-file cli.py).
draft_panel_ ¶
draft_panel_(
spec_dir: Path = typer.Argument(
...,
exists=True,
file_okay=False,
help="Module spec directory",
),
gene: list[str] = typer.Option(
[],
"--gene",
help="Gene to draft rows for (repeatable). Required for every source but mitomap-miss, whose increment is asked for as a whole and where --gene only filters.",
),
source: str = typer.Option(
"clinvar",
"--source",
help="Which authority to draft the calls from: clinvar (the default); pubmind — an LLM's reading of the literature, which needs an operator-built snapshot and still reads the ClinVar one for its gene attribution; civic — curated cancer interpretations, which writes the DIRECTION axis rather than clin_sig and needs a `civic build` snapshot; or mitomap-miss — the curated mtDNA calls MITOMAP publishes and the ClinVar cache does not, which needs a `mitomap miss` snapshot.",
),
mitomap_miss_cache: Path | None = typer.Option(
None,
"--mitomap-miss-cache",
exists=True,
file_okay=False,
help="Built MITOMAP-miss snapshot (see `mitomap miss`). Only read under --source mitomap-miss; omit it and $JUST_DNA_MITOMAP_MISS_CACHE is used.",
),
civic_cache: Path | None = typer.Option(
None,
"--civic-cache",
exists=True,
file_okay=False,
help="Built CIViC snapshot (see `civic build`). Only read under --source civic; omit it and $JUST_DNA_CIVIC_CACHE is used.",
),
snapshot: Path | None = typer.Option(
None,
"--snapshot",
exists=True,
file_okay=False,
help="Built ClinVar snapshot (see `clinvar build`). Omit it and the cache is used, or the published snapshot downloaded — the citations table comes with it, which is what a panel needs to compile. Read for its gene attribution under --source pubmind, which publishes no gene column of its own.",
),
pubmind_cache: Path | None = typer.Option(
None,
"--pubmind-cache",
exists=True,
file_okay=False,
help="Built PubMind snapshot (see `pubmind build`), for --source pubmind. Omit it and $JUST_DNA_PUBMIND_CACHE is read; there is no published one to download.",
),
offline: bool = typer.Option(
False,
"--offline",
help="Use a local snapshot only: never download one.",
),
download: bool = typer.Option(
True,
"--download/--no-download",
help="Provision the published snapshot when no local one is found. Fetching it is this command's only network use, so --no-download coincides with --offline today; it is a separate switch because it says 'do not go and get one', not 'make no request'.",
),
clin_sig: str | None = typer.Option(
None,
"--clin-sig",
help="Comma-separated calls to include. Default: pathogenic,likely_pathogenic.",
),
min_review_stars: int = typer.Option(
2,
"--min-review-stars",
min=0,
max=4,
help="Review-status floor, --source clinvar only. 2 = multiple submitters, no conflicts.",
),
max_citations: int = typer.Option(
3,
"--max-citations",
min=0,
help="Study rows to draft per variant from ClinVar's literature links. 0 disables. --source clinvar only: PubMind's channel carries no PMID.",
),
min_confidence: int = typer.Option(
DEFAULT_MIN_CONFIDENCE,
"--min-confidence",
min=0,
max=3,
help="Evidence-depth floor, --source pubmind only. PubMind's confidence counts how much of the literature spoke, 0-3; 1 means more than a single mention.",
),
use: str = typer.Option(
"unstated",
"--use",
help="Declared use (ClinVar is public domain).",
),
dry_run: bool = typer.Option(
False,
"--dry-run",
help="Report what would be added; write nothing.",
),
) -> None
Draft a gene panel's variants.csv rows from an authority — appends, never overwrites a row.
The drafted rows carry a genotype placeholder, so the module will not compile until you decide what each finding is about. That is deliberate: ClinVar publishes alleles, and whether carrying one is a carrier state or an affected one follows from the condition's inheritance mode, which the source does not say. Rows land in their gene's block, and a re-run leaves anything already there — stub or filled — exactly as it is.
Source code in enricher/src/just_dna_enricher/cli/panel_commands.py
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 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 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 | |