@@ -23,32 +23,17 @@ eval "$(poetry env activate)"
2323
2424### Optional extras
2525
26- The base install is intentionally lean — heavy plotting and ML dependencies are
27- opt-in via Poetry extras. Install only what a given workflow needs:
28-
29- | Extra | Enables | Pulls in |
30- | --- | --- | --- |
31- | ` viz ` | Static and interactive plotting | matplotlib, seaborn, plotly |
32- | ` interactive ` | Interactive plots / dashboards | plotly |
33- | ` duckdb ` | DuckDB-backed queries | duckdb |
34- | ` hgc ` | Joint genotyping plots (genotype adjustment needs no extra) | matplotlib, seaborn |
35- | ` psroc ` | Pathogenicity Score ROC analysis | matplotlib, plotly, scikit-learn, scipy |
36- | ` ptm ` | CPTAC proteomics builders | cptac, sorted-nearest |
37- | ` constraint ` | Tissue-specificity / constraint metrics | tspex, matplotlib, seaborn, scipy |
38- | ` enrichex ` | ` hvantk enrichex overlap ` / ` burden ` and their plots | scipy, matplotlib, seaborn |
39- | ` cohort ` | ` hvantk cohort burden ` (Fisher gene burden) | scipy |
40- | ` ancestry ` | Ancestry inference (PCA + Random Forest + plots) | scikit-learn, matplotlib, seaborn, scipy |
41- | ` ml ` | scikit-learn-backed features only | scikit-learn, scipy |
42- | ` expression ` | ` hvantk expression summarize ` / ` markers ` , and ` ptm constraint --expression-metric mean ` | scanpy, scipy |
26+ The base install is intentionally lean — plotting, machine-learning, and a few
27+ provider-specific dependencies are opt-in Poetry extras:
4328
4429``` bash
45- # One or more extras at once
46- poetry install --extras " ancestry psroc"
47-
48- # Or a single extra
49- poetry install --extras ml
30+ poetry install --extras " ancestry psroc" # one or more
31+ poetry install --all-extras # everything
5032```
5133
34+ For the full table — what each extra pulls in and which commands need it — see
35+ [ Installation → Optional features] ( docs_site/getting-started/installation.md#optional-features-extras ) .
36+
5237Verify it works:
5338
5439``` bash
@@ -122,105 +107,24 @@ returns `(native_obj, Provenance)` zero-cost.
122107
123108### Plugin contract — adding a new data source
124109
125- Each plugin under ` hvantk/skills/<plugin>/ ` declares itself via
126- [ ` plugin.yaml ` ] ( hvantk/skills/clinvar/plugin.yaml ) and provides a builder
127- that returns a typed artifact:
128-
129- ``` python
130- # hvantk/skills/clinvar/builder.py
131- def build_clinvar (parsed_input , ctx : BuildContext, ** params ) -> AnnotationTable:
132- ht = hl.import_vcf(str (parsed_input), force = True , ... ).rows().key_by(" locus" , " alleles" )
133- return AnnotationTable.from_hail(
134- ht, provenance = ctx.provenance(schema_id = " clinvar-variants-v1" )
135- )
136- ```
137-
138- The platform orchestrator [ ` run_builder_for_spec ` ] ( hvantk/core/plugin/run_builder.py )
139- ties it all together at build time:
140-
141- ``` mermaid
142- sequenceDiagram
143- participant CLI as hvantk reprocess
144- participant Reg as plugin registry
145- participant Probe as drift_probe()
146- participant Build as build_fn(parsed, ctx)
147- participant IO as core/io
148-
149- CLI->>Reg: get_dataset("clinvar:variants")
150- Reg-->>CLI: DatasetSpec (lazy bind on first access)
151- CLI->>Probe: compute source fingerprint
152- Probe-->>CLI: probe dict
153- CLI->>CLI: BuildContext(plugin, version, fingerprint, …)
154- CLI->>Build: (parsed_input, ctx, **params)
155- Build-->>CLI: AnnotationTable(provenance=ctx.provenance(schema_id=…))
156- CLI->>CLI: validate artifact_type + schema_id
157- CLI->>IO: artifact.save(path)
158- IO-->>IO: write data + sidecar .provenance.json
159- ```
160-
161- Twenty-one plugins ship today: ` clinvar ` , ` clingen ` , ` gencc ` , ` gwas-catalog ` ,
162- ` hgnc ` , ` gtex-eqtl ` , ` insider ` , ` msigdb ` , ` uniprot-ptm ` , ` peptideatlas ` ,
163- ` expression-atlas ` , ` cptac ` , ` ucsc-cellbrowser ` , ` gevir ` , ` gnomad-metrics ` ,
164- ` ensembl-gene ` , ` dbnsfp ` , ` cosmic-cgc ` , ` pqtl ` , ` alphagenome ` , ` onek-genomes ` .
165-
166- ### Project structure
167-
168- ```
169- hvantk/
170- ├── core/ # platform substrate — stable contracts
171- │ ├── models/ # AnnotationTable, ExpressionMatrix, VariantMatrix, GeneSet,
172- │ │ # Provenance, BuildContext, Expr DSL,
173- │ │ # AlgorithmMeta (@algorithm decorator)
174- │ ├── io/ # save / load / save_native / load_native,
175- │ │ # sidecar provenance manifests, legacy shim
176- │ ├── plugin/ # plugin registry, run_builder_for_spec,
177- │ │ # two-pass discovery (DatasetManifest → DatasetSpec)
178- │ ├── tool/ # tool manifest discovery (descriptive)
179- │ ├── streamers/ # Streamer ABCs — query/iterate built tables
180- │ │ # (concrete subclasses live in skills/<plugin>/)
181- │ ├── ontology/ # OBO / MONDO parsers
182- │ └── utils/ # generic helpers (hail context, hail_helpers,
183- │ # file utils, gene sets)
184- │
185- ├── algorithms/ # analytics — consume artifacts, return artifacts
186- │ ├── ancestry/ # PCA + Random Forest ancestry inference
187- │ ├── enrichex/ # gene set enrichment + burden testing
188- │ ├── expression/ # tissue specificity (tau, gini, etc.)
189- │ ├── hgc/ # joint genotyping (gvcf combine, VDS, QC)
190- │ ├── ptm/ # PTM coordinate mapping + atlas
191- │ ├── psroc/ # pathogenicity score ROC analysis
192- │ ├── qtlcascade/ # eQTL → pQTL cascade + colocalization
193- │ ├── annotation/ # spine / prepare / compose annotation pipeline
194- │ ├── burden/, cohort/ # rare-variant burden + external cohort handling
195- │ ├── rerank/ # multi-omic gene re-ranking (feature axes + audit)
196- │ ├── statistics/ # multiple-testing correction, shared stats
197- │ └── visualization/ # shared figure helpers (empty_figure, save_figure)
198- │
199- ├── skills/ # data-source plugins (21 total)
200- │ ├── <plugin>/
201- │ │ ├── plugin.yaml # declarative manifest (drives discovery + CLI)
202- │ │ ├── builder.py # Phase B: (parsed, ctx) → AnnotationTable / …
203- │ │ ├── drift_probe.py # upstream fingerprint
204- │ │ ├── cli.py # downloader (auto-wired via manifest cli: block)
205- │ │ └── tests/ # per-plugin conformance tests + fixtures
206- │ └── _conventions/SKILL.md # contract documentation
207- │
208- ├── tools/ # CLI wiring + workflow orchestration
209- │ ├── plugins/ # download, drift, reprocess, plugins/tools list
210- │ ├── hgc/ # joint-genotyping CLI (lazy-loaded)
211- │ ├── infra/ # catalog, utils (check-install, bgzf)
212- │ ├── annotation/ # annotate spine / prepare / compose
213- │ ├── cohort/ # cohort validate / burden / attach
214- │ ├── rerank/ # rerank CLI
215- │ ├── genesets/ # gene set extraction / preparation
216- │ ├── training_sets/ # TrainingSetBuilder — library only, no CLI command
217- │ └── ancestry/, enrichex/, expression/, ptm/, qtl/ # one package per domain
218- │
219- ├── resources/ # platform metadata (unified catalog registry)
220- └── tests/ # cross-cutting tests (dependency directions,
221- # plugin conformance, io round-trips,
222- # Expr algebra parity, etc.)
223- ```
110+ Each data source ships as a self-contained plugin under ` hvantk/skills/<plugin>/ ` ,
111+ declared by a [ ` plugin.yaml ` ] ( hvantk/skills/clinvar/plugin.yaml ) manifest naming its
112+ builder and drift probe, plus an optional downloader for sources that permit an
113+ automated fetch. Sources behind a license gate, or too large to mirror, ship a
114+ documented acquisition procedure instead. The platform orchestrator
115+ [ ` run_builder_for_spec ` ] ( hvantk/core/plugin/run_builder.py ) resolves the manifest,
116+ computes the source fingerprint, calls the builder, validates the returned artifact
117+ against the manifest's ` artifact_type ` and ` schema_id ` , and saves it alongside a
118+ sidecar ` .provenance.json ` . The loader discovers manifests on its own — there is no
119+ registry to edit.
120+
121+ The full contract and the annotated directory tree live in the architecture guide:
122+
123+ - [ Plugin contract] ( docs_site/architecture.md#3-plugin-contract--adding-a-data-source )
124+ — build sequence diagram, annotated ` plugin.yaml ` , two-pass loader, streamer
125+ placement rule
126+ - [ Project structure] ( docs_site/architecture.md#project-structure ) — what lives in
127+ each package, layer by layer
224128
225129### How to extend
226130
0 commit comments