Skip to content

Commit 08aac57

Browse files
authored
Merge pull request #107 from bigbio/dev
release: skills pilot + pre-pilot features (sync dev → main)
2 parents 0952a3f + 5ee0cb1 commit 08aac57

62 files changed

Lines changed: 6527 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/python-package-conda.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
conda env update --file environment.yml --name base
2828
- name: Lint with flake8
2929
run: |
30-
conda install flake8
30+
python -m pip install flake8
3131
# stop the build if there are Python syntax errors or undefined names
3232
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3333
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3434
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3535
- name: Test with pytest
3636
run: |
37-
conda install pytest
37+
python -m pip install pytest
3838
pytest

‎CONTRIBUTING.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
11
# Contributing to hvantk
22

33
See the full contributing guide at [docs_site/contributing.md](docs_site/contributing.md).
4+
5+
## Skill maintenance (resource-centric skills)
6+
7+
`hvantk/skills/` contains agent-readable methodology for maintaining stable resources. Each per-resource `SKILL.md` is a design contract (source identity, output schema, builder + CLI + registry wiring, validation contract) that the round-trip test pins down. Shared conventions live in `hvantk/skills/_conventions/SKILL.md` — read that first before any per-resource skill.
8+
9+
### When you change builder code
10+
11+
If a PR changes a function or path named in any `SKILL.md` — including the `_conventions/` skill — update the affected skill in the same PR. Reviewer will reject PRs where skill drift is obvious.
12+
13+
### Skill status
14+
15+
Each `SKILL.md` carries a `status` frontmatter field:
16+
17+
- `provisional` — work in progress, not yet validated against the round-trip + update tests.
18+
- `stable` — actively maintained, agent can rely on it.
19+
- `deprecated` — superseded by code change; do not use.
20+
21+
Do not invoke an agent against a `deprecated` skill.
22+
23+
### Snapshot regeneration
24+
25+
When a builder change legitimately changes output:
26+
27+
```bash
28+
poetry run pytest hvantk/tests/test_<source>_builder.py --regenerate-snapshots
29+
# For Hail-marked builders only:
30+
poetry run pytest hvantk/tests/test_<source>_builder.py -m hail --regenerate-snapshots
31+
```
32+
33+
Review the diff in `hvantk/tests/snapshots/<source>/` before committing. The regenerated snapshot is the new ground truth.
34+
35+
### Skill-driven changes
36+
37+
Skill-assisted code changes (where an agent generates the builder) are reviewed identically to hand-written code. NEVER auto-merge a skill-generated PR. Always run the full test suite, especially the affected `test_<source>_builder.py`.

‎docs_site/tools/ptm-constraint.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
`hvantk ptm constraint` is a stratified depletion analysis that compares gnomAD
44
allele-frequency distributions between PTM-proximal and non-PTM variants,
55
grouped by tissue, cell type, or any categorical field found in an expression
6-
dataset. It is the CLI incarnation of the multi-dataset EDA consolidated in
7-
`local/notebooks/ptm-eda/PTM-EDA_Consolidated_Report.md` (Notebooks E–I).
6+
dataset.
87

98
> **Not a per-variant scorer.** For per-site PTM flags use `hvantk ptm annotate`.
109
> This command produces *stratified group-level* statistics.

‎hvantk/commands/make_table_cli.py‎

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ def _create_pqtl_tb(*args, **kwargs):
9595
return create_pqtl_tb(*args, **kwargs)
9696

9797

98+
def _create_gwas_catalog_tb(*args, **kwargs):
99+
from hvantk.tables.table_builders import create_gwas_catalog_tb
100+
101+
return create_gwas_catalog_tb(*args, **kwargs)
102+
103+
104+
def _create_msigdb_tb(*args, **kwargs):
105+
from hvantk.tables.table_builders import create_msigdb_tb
106+
107+
return create_msigdb_tb(*args, **kwargs)
108+
109+
98110
@click.group("mktable", context_settings=CONTEXT_SETTINGS)
99111
def mktable_group():
100112
"""Create a single annotation Table/MatrixTable from a raw input file."""
@@ -717,19 +729,28 @@ def mktable_pqtl(
717729

718730
@mktable_group.command("alphagenome")
719731
@click.option(
720-
"--input", "input_path", required=True, type=str,
732+
"--input",
733+
"input_path",
734+
required=True,
735+
type=str,
721736
help="Path to Hail Table (.ht) or TSV with chrom/pos/ref/alt columns",
722737
)
723738
@click.option(
724-
"--output-dir", required=True, type=str,
739+
"--output-dir",
740+
required=True,
741+
type=str,
725742
help="Output directory for per-modality Hail Tables",
726743
)
727744
@click.option(
728-
"--config", "config_path", required=True, type=str,
745+
"--config",
746+
"config_path",
747+
required=True,
748+
type=str,
729749
help="Path to AlphaGenome YAML config file",
730750
)
731751
@click.option(
732-
"--no-resume", is_flag=True,
752+
"--no-resume",
753+
is_flag=True,
733754
help="Discard existing checkpoints and restart from scratch",
734755
)
735756
@_overwrite_opt
@@ -746,3 +767,45 @@ def mktable_alphagenome(input_path, output_dir, config_path, no_resume, overwrit
746767
overwrite=overwrite,
747768
)
748769
click.echo(f"AlphaGenome predictions written to {output_dir}")
770+
771+
772+
@mktable_group.command("gwas-catalog")
773+
@_raw_input_opt
774+
@_output_ht_opt
775+
@_overwrite_opt
776+
@_export_tsv_opt
777+
@_ref_genome_opt
778+
def mktable_gwas_catalog(
779+
raw_input: str, output_ht: str, overwrite: bool, export_tsv: bool, ref_genome: str
780+
):
781+
"""Build a GWAS Catalog Hail Table from the v1.0 full-associations TSV (keyed by locus, alleles)."""
782+
logger.info("Building GWAS Catalog table")
783+
ht = _create_gwas_catalog_tb(
784+
input_path=raw_input,
785+
output_path=output_ht,
786+
overwrite=overwrite,
787+
export_tsv=export_tsv,
788+
reference_genome=ref_genome,
789+
)
790+
click.echo(f"GWAS Catalog table created at {output_ht}")
791+
ht.describe()
792+
793+
794+
@mktable_group.command("msigdb")
795+
@_raw_input_opt
796+
@_output_ht_opt
797+
@_overwrite_opt
798+
@_export_tsv_opt
799+
def mktable_msigdb(
800+
raw_input: str, output_ht: str, overwrite: bool, export_tsv: bool
801+
):
802+
"""Build an MSigDB Hail Table from a GMT file (keyed by set_name)."""
803+
logger.info("Building MSigDB table")
804+
ht = _create_msigdb_tb(
805+
input_path=raw_input,
806+
output_path=output_ht,
807+
overwrite=overwrite,
808+
export_tsv=export_tsv,
809+
)
810+
click.echo(f"MSigDB table created at {output_ht}")
811+
ht.describe()

‎hvantk/ptm/constraint.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
33
Compares gnomAD allele-frequency distributions between PTM-proximal and
44
non-PTM variants, stratified by tissue, cell type, or any categorical
5-
metadata field derived from an expression dataset. The five statistical
6-
tests mirror the EDA prototyped in Notebooks E through I
7-
(see ``local/notebooks/ptm-eda/PTM-EDA_Consolidated_Report.md``).
5+
metadata field derived from an expression dataset.
86
97
This module is an **orchestrator**, not a per-variant scorer. For per-site
108
PTM flags use :func:`hvantk.ptm.annotate.annotate_variants_with_ptm`.

‎hvantk/resources/catalog.yaml‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '2.0'
2-
generated: '2025-10-16T11:53:17.977662'
2+
generated: '2026-05-12T08:37:59.302733'
33
description: Unified catalog of all omics datasets in hvantk registry
44
registry_structure:
55
schemas: hvantk/resources/schemas/
@@ -9,40 +9,40 @@ registry_structure:
99
epigenomics: hvantk/resources/registry/epigenomics/
1010
datasets:
1111
transcriptomics:
12-
count: 297
12+
count: 300
1313
schemas: schemas/transcriptomics_schema.json
1414
data_file: registry/transcriptomics/datasets.json
1515
summary:
1616
data_sources:
1717
- Custom
18-
- UCSC
1918
- Expression_Atlas
19+
- UCSC
2020
organisms:
21-
- Fruit Fly (D. melanogaster)
22-
- Human (H. sapiens)
23-
- Gallus gallus
24-
- Mus musculus
25-
- Freshwater Hydra (H. vulgaris)
26-
- Sea Squirt (C. robusta)
27-
- Sea urchin (S. purpuratus)
28-
- Dog (C. familiaris)
2921
- African Clawed Frog (X. laevis)
30-
- Rat (R. norvegicus)
22+
- Sea urchin (S. purpuratus)
23+
- Blood Fluke (S. mansoni)
24+
- Starlet Sea Anemone (N. vectensis)
3125
- Brine Shrimp (A. franciscana)
26+
- Rat (R. norvegicus)
27+
- Mosquito (A. aegypti)
28+
- Colonial Hydroid (H. symbiolongicarpus)
29+
- Freshwater Worm (P. leidyi)
30+
- Dog (C. familiaris)
31+
- Human-Mouse Xenograft
32+
- Human (H. sapiens)
33+
- Fruit Fly (D. melanogaster)
3234
- Mouse lemur (T. microcebus)
35+
- Homo sapiens
36+
- Sea Squirt (C. robusta)
37+
- X. tropicalis
38+
- Freshwater Hydra (H. vulgaris)
39+
- Fruit fly (D. melanogaster)
40+
- Gallus gallus
3341
- Sea Squirt (C. intestinalis)
34-
- Blood Fluke (S. mansoni)
35-
- Human-Mouse Xenograft
3642
- Horse (E. caballus)
37-
- Freshwater Worm (P. leidyi)
3843
- Marmoset (C. jacchus)
39-
- Fruit fly (D. melanogaster)
40-
- Mosquito (A. aegypti)
41-
- Colonial Hydroid (H. symbiolongicarpus)
42-
- X. tropicalis
44+
- Mus musculus
4345
- Zebrafish (D. rerio)
44-
- Homo sapiens
45-
- Starlet Sea Anemone (N. vectensis)
4646
sample_range:
4747
min: 0
4848
max: 2058652
@@ -59,7 +59,7 @@ datasets:
5959
min: 1
6060
max: 1
6161
genomics:
62-
count: 7
62+
count: 11
6363
schemas: schemas/genomics_schema.json
6464
data_file: registry/genomics/datasets.json
6565
summary:
@@ -68,7 +68,7 @@ datasets:
6868
organisms:
6969
- Homo sapiens
7070
sample_range:
71-
min: 20000
71+
min: 1000
7272
max: 700000000
7373
epigenomics:
7474
count: 0
@@ -81,5 +81,5 @@ datasets:
8181
min: 0
8282
max: 0
8383
summary:
84-
total_datasets: 306
84+
total_datasets: 313
8585
omics_types: 3

‎hvantk/resources/registry/genomics/datasets.json‎

Lines changed: 93 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,30 @@
100100
]
101101
},
102102
{
103-
"title": "INSIDER - Interaction Network of Structured Domains in Proteins",
103+
"title": "INSIDER - Interactome Insider (protein-protein interface residues, hg38)",
104104
"accession": "INSIDER_v1.0",
105-
"description": "Database of protein-protein interaction sites and interfaces derived from structural data. Provides information about interaction residues, binding sites, and functional domains involved in protein-protein interactions.",
105+
"description": "Interactome Insider (Wei et al., Nat Methods 2017). Predicted (ECLAIR), structural (PDB), and homology-derived (I3D) protein-protein interaction interface residues. Distributed as two complementary products: (1) Whole_Human_Interactome_Interface_hg38.bed — UCSC-style BED with 208,448 named PPI tracks projecting interface residues onto GRCh38 coordinates (this file path), and (2) H_sapiens_interfacesALL.txt — per protein-pair residue arrays with Source provenance (a separately-onboardable product, not in this catalog entry). Built by a custom track-aware BED parser plus hl.import_table into an interval-keyed Hail Table that preserves PPI IDs from track names; see hvantk/skills/insider/SKILL.md. Used for variant-interval intersection (does a variant fall in any predicted PPI interface?).",
106106
"pubmedid": "29036289",
107107
"data_source": "Custom",
108108
"last_updated": "2025-09-23T16:30:00.000000",
109109
"update_frequency": "irregular",
110110
"organism": "Homo sapiens",
111111
"tissue_type": "all",
112-
"sample_count": 50000,
112+
"sample_count": 208448,
113113
"license": "Academic use",
114-
"doi": "10.1093/nar/gkx1044",
114+
"doi": "10.1093/nmeth.4540",
115115
"genome_build": "GRCh38",
116116
"variant_types": ["SNV"],
117117
"frequency_data": false,
118118
"clinical_significance": false,
119-
"annotation_sources": ["PDB", "InterPro", "Pfam"],
119+
"annotation_sources": ["ECLAIR", "PDB", "I3D"],
120120
"files": [
121121
{
122-
"path": "insider_interaction_sites.tsv",
123-
"format": "tsv",
124-
"size_bytes": 100000000,
125-
"description": "Protein-protein interaction site annotations"
122+
"path": "Whole_Human_Interactome_Interface_hg38.bed",
123+
"format": "bed",
124+
"size_bytes": 1171586071,
125+
"url": "http://interactomeinsider.yulab.org/downloads.html",
126+
"description": "UCSC-style BED with 208,448 'track name=<P1>_ppi_<P2>' headers; 18.6M data rows representing per-residue genomic intervals (typically 1-3 bp) for predicted/experimental protein-protein interface positions. >1 GB; manual acquisition per CLAUDE.md downloader strategy. The track-aware INSIDER builder preserves track-name metadata as PPI IDs during import."
126127
}
127128
]
128129
},
@@ -243,6 +244,88 @@
243244
"description": "Gene-disease validity classifications with evidence levels"
244245
}
245246
]
247+
},
248+
{
249+
"title": "GWAS Catalog - NHGRI-EBI Catalog of human genome-wide association studies",
250+
"accession": "GWAS_Catalog_v1.0_e115_r2026-04-27",
251+
"description": "Manually curated collection of all published genome-wide association studies. Each row is a SNP-trait association with study provenance, p-value, effect size (OR or BETA), and risk-allele frequency. v1.0 schema (34 columns, no MAPPED_TRAIT_URI). Built into a Hail Table keyed by (locus, alleles) with a sentinel ALT for variant-annotation joins; see hvantk/skills/gwas-catalog/SKILL.md.",
252+
"pubmedid": "30445434",
253+
"data_source": "Custom",
254+
"last_updated": "2026-04-27T00:00:00.000000",
255+
"update_frequency": "quarterly",
256+
"organism": "Homo sapiens",
257+
"tissue_type": "all",
258+
"sample_count": 1100000,
259+
"license": "CC0 1.0",
260+
"doi": "10.1093/nar/gky1120",
261+
"genome_build": "GRCh38",
262+
"variant_types": ["SNV"],
263+
"frequency_data": true,
264+
"clinical_significance": false,
265+
"annotation_sources": ["GWAS Catalog", "Ensembl"],
266+
"files": [
267+
{
268+
"path": "gwas-catalog-download-associations-v1.0-full.tsv",
269+
"format": "tsv",
270+
"size_bytes": 556245182,
271+
"url": "https://www.ebi.ac.uk/gwas/api/search/downloads/full",
272+
"description": "Full associations TSV (v1.0, 34 columns) from the EBI GWAS Catalog e115 / r2026-04-27 release."
273+
}
274+
]
275+
},
276+
{
277+
"title": "MSigDB - Molecular Signatures Database (C2 Canonical Pathways, human, gene symbols)",
278+
"accession": "MSigDB_C2_CP_v2026.1.Hs.symbols",
279+
"description": "Broad Institute Molecular Signatures Database. Collection C2 (curated gene sets) sub-collection CP (Canonical Pathways) — pathway gene sets curated from online resources (BIOCARTA, KEGG, PID, REACTOME, WP, SA). Human gene-symbol variant. GMT format: tab-separated variable-width rows where column 1 is set_name, column 2 is a gsea-msigdb URL, and columns 3..N are gene symbols. Built into a Hail Table keyed by set_name with genes as array<str>; see hvantk/skills/msigdb/SKILL.md. Used for gene-set lookup in enrichment / burden / overlap analyses.",
280+
"pubmedid": "16199517",
281+
"data_source": "Custom",
282+
"last_updated": "2026-01-01T00:00:00.000000",
283+
"update_frequency": "annually",
284+
"organism": "Homo sapiens",
285+
"tissue_type": "all",
286+
"sample_count": 4115,
287+
"license": "CC Attribution 4.0 (academic) / commercial license required",
288+
"doi": "10.1073/pnas.0506580102",
289+
"genome_build": "GRCh38",
290+
"frequency_data": false,
291+
"clinical_significance": false,
292+
"annotation_sources": ["MSigDB", "BIOCARTA", "KEGG", "PID", "REACTOME", "WikiPathways", "SignalingAlliance"],
293+
"files": [
294+
{
295+
"path": "c2.cp.v2026.1.Hs.symbols.gmt",
296+
"format": "gmt",
297+
"size_bytes": 1677390,
298+
"url": "https://www.gsea-msigdb.org/gsea/msigdb/human/collections.jsp",
299+
"description": "C2 Canonical Pathways collection, human gene symbols, v2026.1. 4,115 gene sets ranging from 5 to ~1500 members per set."
300+
}
301+
]
302+
},
303+
{
304+
"title": "GTEx v11 cis-eQTL significant variant-gene pairs (per-tissue)",
305+
"accession": "GTEx_v11_eQTL_signif_pairs",
306+
"description": "GTEx Consortium release v11 cis-eQTL significant variant-gene pairs, one parquet file per tissue. 12 source columns: phenotype_id, variant_id (chr_pos_ref_alt_b38), start_distance, af, ma_samples, ma_count, pval_nominal, slope, slope_se, pval_nominal_threshold, min_pval_nominal, pval_beta. Built into a Hail Table keyed by (locus, alleles, gene_id) via spark.read.parquet → hl.Table.from_spark; see hvantk/skills/gtex-eqtl/SKILL.md. Used as eQTL input to hvantk/qtlcascade/ and variant annotation.",
307+
"pubmedid": "32913098",
308+
"data_source": "Custom",
309+
"last_updated": "2024-12-01T00:00:00.000000",
310+
"update_frequency": "irregular",
311+
"organism": "Homo sapiens",
312+
"tissue_type": "all",
313+
"sample_count": 1000,
314+
"license": "Public (summary statistics); dbGaP-controlled for individual-level data",
315+
"doi": "10.1126/science.aaz1776",
316+
"genome_build": "GRCh38",
317+
"variant_types": ["SNV"],
318+
"frequency_data": true,
319+
"clinical_significance": false,
320+
"annotation_sources": ["GTEx", "GENCODE", "Ensembl"],
321+
"files": [
322+
{
323+
"path": "Liver.v11.eQTLs.signif_pairs.parquet",
324+
"format": "parquet",
325+
"size_bytes": 27912129,
326+
"url": "https://gtexportal.org/home/downloads/adult-gtex/qtl",
327+
"description": "Liver tissue v11 cis-eQTL significant variant-gene pairs (Apache Parquet). One file per tissue; the skill anchors against Liver as the smallest v11 tissue (~28 MB). Same schema across all 49 tissues."
328+
}
329+
]
246330
}
247331
]
248-

0 commit comments

Comments
 (0)