diff --git a/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-polygenic-risk-score/SKILL.md b/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-polygenic-risk-score/SKILL.md index 372a7886..0bf9179e 100644 --- a/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-polygenic-risk-score/SKILL.md +++ b/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-polygenic-risk-score/SKILL.md @@ -1,8 +1,8 @@ --- lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/tooluniverse-polygenic-risk-score/SKILL.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/tooluniverse-polygenic-risk-score/SKILL.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: unknown upstream_changes: accepted name: tooluniverse-polygenic-risk-score @@ -152,10 +152,19 @@ PRS can stratify individuals for: ### Research Applications - **Gene discovery**: PRS-based phenome-wide association studies (PheWAS) -- **Genetic correlation**: Compare PRS across traits +- **Genetic correlation**: Compare PRS across traits — but for a rigorous, GWAS-summary-statistics estimate of cross-trait genetic correlation (rg), use `run_ldsc_genetic_correlation` (LD Score regression), which needs only summary stats (no individual genotypes) and corrects for sample overlap. Far more principled than correlating PRS values. - **Causal inference**: Mendelian randomization using PRS as instruments - **Simulation studies**: Model polygenic architecture +### SNP-heritability and genetic correlation (LDSC) + +Before or alongside building a PRS, quantify how much of the trait is captured by common SNPs and how traits relate — directly from GWAS summary statistics: + +- `run_ldsc_heritability` — SNP-based heritability (h²_SNP) from one GWAS's summary stats; the intercept also flags confounding/inflation vs. true polygenicity. This sets the ceiling a PRS can reach (the "heritability gap" below is exactly h²_SNP minus PRS R²). +- `run_ldsc_genetic_correlation` — genetic correlation (rg) between two GWAS, for shared-aetiology and cross-trait PRS questions. + +Both are remote tools (LD Score regression engine + reference LD-score panels). Use them to ground heritability/rg claims in data rather than citing literature point estimates. + ### Personal Genomics Consumer genetic testing (23andMe, Ancestry DNA) provides raw genotypes. Users can: diff --git a/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-regulatory-genomics/SKILL.md b/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-regulatory-genomics/SKILL.md index fb4ae375..fe2091ef 100644 --- a/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-regulatory-genomics/SKILL.md +++ b/upstream/mims-harvard-ToolUniverse/catalogue/skills/tooluniverse-regulatory-genomics/SKILL.md @@ -1,12 +1,12 @@ --- lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/tooluniverse-regulatory-genomics/SKILL.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/tooluniverse-regulatory-genomics/SKILL.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: catalogue upstream_changes: accepted name: tooluniverse-regulatory-genomics -description: Transcription factor binding, cis-regulatory elements (cCREs), chromatin accessibility, and regulatory annotation using JASPAR (motifs), ENCODE (cCREs, ChIP-seq), RegulomeDB (regulatory variant scoring), UCSC. Use for regulatory element annotation, TF-binding-site prediction, and regulatory-region functional impact assessment. +description: Transcription factor binding, cis-regulatory elements (cCREs), chromatin accessibility, and regulatory annotation using JASPAR (motifs), ENCODE (cCREs, ChIP-seq), RegulomeDB (regulatory variant scoring), UCSC — plus sequence-based deep-learning prediction of regulatory activity and non-coding variant effects (AlphaGenome, Enformer, Borzoi, ChromBPNet, Evo 2). Use for regulatory element annotation, TF-binding-site prediction, regulatory-region functional impact assessment, and predicting how a non-coding variant or a raw DNA sequence affects expression/chromatin/accessibility. Use this whenever a user asks what regulates a gene, whether a SNP hits a regulatory element, or to predict a non-coding variant's functional effect from sequence. disable-model-invocation: true --- @@ -48,6 +48,9 @@ When analysis requires computation (statistics, data processing, scoring, enrich - "Is rs1234567 in a regulatory region?" - "What TF motifs overlap this genomic region?" - "Find ENCODE experiments for ATAC-seq in cancer cell lines" +- "Predict the effect of this non-coding variant on expression / chromatin accessibility" +- "Predict regulatory activity (expression, accessibility, TF binding) directly from a DNA sequence" +- "Which of these enhancer variants is predicted to be most disruptive?" --- @@ -71,6 +74,20 @@ When analysis requires computation (statistics, data processing, scoring, enrich | `RegulomeDB_query_variant` | Score regulatory impact of a variant | `rsid` (e.g., "rs4994") | | `ENCODE_search_biosamples` | Find available cell lines/tissues in ENCODE | `term_name`, `biosample_type`, `limit` | +### Sequence-based deep-learning models (predict, don't just annotate) + +The tools above tell you what is *known* to be at a locus (databases). These models instead *predict* regulatory activity directly from the DNA sequence, and — by scoring a reference vs. alternate window — predict what a non-coding variant *does*. RegulomeDB ranks a variant by overlap with existing annotations; these give a quantitative, tissue-aware effect size even for novel variants with no annotation. Reach for them when annotation is silent or when the question is "how much does this allele change regulation". + +| Tool | Op | Predicts | Context | Access | +|------|----|----------|---------|--------| +| `AlphaGenome_predict_interval` / `AlphaGenome_score_variant` | profile region / score variant | RNA-seq, ATAC, CAGE, splice tracks (frontier accuracy, single-base) | up to 1 Mb | hosted API — `ALPHA_GENOME_API_KEY` | +| `run_enformer_predict` / `run_enformer_variant_effect` | profile / score | 5,313 human (+1,643 mouse) tracks: expression, chromatin, TF binding | 196 kb | remote MCP server | +| `run_borzoi_predict` / `run_borzoi_variant_effect` | profile / score | RNA-seq coverage (expression / polyA / splicing emphasis), 7,611 tracks | 524 kb | remote MCP server | +| `run_chrombpnet_predict` / `run_chrombpnet_variant_effect` | profile / score | chromatin accessibility (ATAC / DNase), base-resolution profile + counts | ~2 kb | remote MCP server | +| `Evo2_score_variant` | score | genome-foundation-model delta log-likelihood; coding **and** non-coding | up to 1 Mb | hosted NIM — `NVIDIA_API_KEY` | + +**Picking one:** `AlphaGenome_*` is the broadest readout + longest context when its key is set; `run_enformer_*` / `run_borzoi_*` are the published, self-hostable equivalents (Enformer for general regulation, Borzoi when expression/splicing is the question); `run_chrombpnet_*` when the question is specifically chromatin accessibility; `Evo2_score_variant` as a sequence-only check that also covers coding variants. Outputs are Δ (alt − ref) effect sizes, not calibrated probabilities — rank/calibrate against known variants. If no key/server is provisioned, fall back to the annotation tools above and say so. + --- ## Workflow diff --git a/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/SKILL.md b/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/SKILL.md index dc5d339c..d752c053 100644 --- a/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/SKILL.md +++ b/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/SKILL.md @@ -1,8 +1,8 @@ --- lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/devtu-code-optimization/SKILL.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/devtu-code-optimization/SKILL.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: prompt upstream_changes: accepted name: devtu-code-optimization @@ -40,6 +40,8 @@ Always run `Skill(skill="simplify")` after writing or modifying code. | Undisclosed normalization | Auto-transform hidden from user | [code-patterns.md](code-patterns.md) — Normalization Disclosure | | try/except indent | SyntaxError at runtime | [code-patterns.md](code-patterns.md) — try/except section | | Truncation buried | Data count hidden in notes | [code-patterns.md](code-patterns.md) — Truncation | +| Hosted model API (NIM) | async 404 on poll, JSON-wrapped output, 200+inner-failure, "not found for account" | [code-patterns.md](code-patterns.md) — Hosted Model-API Tools | +| R subprocess tool | `'\.' unrecognized escape` from `Rscript -e` | [code-patterns.md](code-patterns.md) — R-subprocess Tools | ## References diff --git a/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/references/code-patterns.md b/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/references/code-patterns.md index cbd905b0..5ecbf2c1 100644 --- a/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/references/code-patterns.md +++ b/upstream/mims-harvard-ToolUniverse/skills/devtu-code-optimization/references/code-patterns.md @@ -2,9 +2,9 @@ title: "Code Patterns Reference" task: "" lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/devtu-code-optimization/references/code-patterns.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/devtu-code-optimization/references/code-patterns.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: prompt upstream_changes: accepted author: upstream @@ -115,6 +115,73 @@ elif count == 0: result["hint"] = "No data available for this entity." ``` +## Hosted Model-API Tools (NVIDIA NIM-style) + +### Async poll host = the invocation host +Poll a 202 job-status on the SAME gateway you POSTed to. NVCF biology NIMs invoke +**and** poll on `health.api.nvidia.com`; `integrate.api.nvidia.com` serves only the +OpenAI-compatible LLM endpoints and has **no** `/v1/status` route. + +```python +host = urlparse(self.base_url).netloc # e.g. health.api.nvidia.com +poll_url = f"https://{host}/v1/status/{req_id}" +``` + +### Route-existence probe (find/verify hosted endpoints) +Plain-text `404 page not found` = route does NOT exist; a structured +`{"status":404,...}` (or 400/422/200) = route exists. Use the live API to confirm a +model is hosted and to find the right slug before wrapping it. + +### Unwrap JSON envelopes around the "raw" payload +Some endpoints return `{"pdbs": ["...ATOM..."]}` even when response_type is `pdb`. +Unwrap to the inner value so the field matches the schema (real PDB, not a JSON blob). + +### HTTP 200 with an inner failure +A 200 can carry `{"status": "failed", ...}` (e.g. DiffDock with an unreadable +ligand). Surface it as an error — but only on explicit `failed/error/errored`; an +inner `status:"success"` must stay a success (don't over-match). + +### 404 "not found for account" ≠ wrong path +A gated/unprovisioned model returns a 404 whose body says "Not found for account". +Report "model not available for your account" rather than "endpoint not found". + +### Retry a longer poll window before declaring "broken" +A heavy async job can return 504 / `nvcf-status: errored` simply because +`NVCF-POLL-SECONDS` was shorter than its runtime. Only a *persistent* 400 +`DEGRADED`/error across retries is a real outage. 5xx bodies are often empty — +surface `nvcf-status` / `nvcf-reqid` from the headers instead. + +### Model-variant selection via templated endpoint +Expose multiple hosted sizes through one tool: a `{placeholder}` in the endpoint + +`fields.path_params` default, filled from the request arg (sanitized slug) and +stripped from the request body. + +```python +# endpoint "arc/{model}/generate", path_params {"model": "evo2-40b"} +value = args.get(key) or default +if not re.fullmatch(r"[A-Za-z0-9._-]+", str(value)): # no path injection + value = default +endpoint = endpoint.replace("{" + key + "}", value) +``` + +## R-subprocess Tools + +### Run a script file, not `Rscript -e ` +`Rscript -e` collapses one backslash level before R parses it, so a regex literal +like `sub("\\..*", ...)` becomes `sub("\..*", ...)` and R aborts with +`'\.' is an unrecognized escape`. Write the script to a temp `.R` file and run +`Rscript ` (parsed verbatim); always remove the temp file, incl. on timeout. + +```python +tmp = tempfile.NamedTemporaryFile(mode="w", suffix=".R", delete=False) +try: + tmp.write(r_script); tmp.close() + return subprocess.run(["Rscript", tmp.name], capture_output=True, text=True, timeout=t) +finally: + try: os.unlink(tmp.name) + except OSError: pass +``` + ## try/except Indentation (Critical) ```python diff --git a/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/SKILL.md b/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/SKILL.md index 251d2f36..4b2002fe 100644 --- a/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/SKILL.md +++ b/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/SKILL.md @@ -1,12 +1,12 @@ --- lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/tooluniverse-variant-interpretation/SKILL.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/tooluniverse-variant-interpretation/SKILL.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: prompt upstream_changes: accepted name: tooluniverse-variant-interpretation -description: Clinical variant interpretation from raw variant calls to ACMG-classified recommendations with structural impact analysis. Use for VUS classification, pathogenicity assessment with cited criteria, structure-based variant impact (AlphaFold/PDB), and producing clinical-grade variant reports for return of results or molecular tumor boards. +description: Clinical variant interpretation from raw variant calls to ACMG-classified recommendations with structural impact analysis. Use for VUS classification, pathogenicity assessment with cited criteria, structure-based variant impact (AlphaFold/PDB), non-coding/regulatory variant effect prediction with sequence deep-learning models (AlphaGenome, Enformer, Borzoi, ChromBPNet, Evo 2), and producing clinical-grade variant reports for return of results or molecular tumor boards. Use this whenever a user asks about a variant's significance, an intronic/promoter/enhancer/UTR non-coding variant's functional impact, or needs ACMG classification — even if they don't say "ACMG". disable-model-invocation: true --- @@ -43,7 +43,7 @@ When asked about a variant's significance, query ClinVar/gnomAD/CIViC FIRST. Nev ``` Phase 1: VARIANT IDENTITY → Normalize HGVS, map gene/transcript/consequence Phase 2: CLINICAL DATABASES → ClinVar, gnomAD, OMIM, ClinGen, COSMIC, SpliceAI -Phase 2.5: REGULATORY CONTEXT → ChIPAtlas, ENCODE (non-coding variants only) +Phase 2.5: REGULATORY CONTEXT → ChIPAtlas/ENCODE annotation + DL variant-effect (AlphaGenome/Enformer/Borzoi/ChromBPNet/Evo2) (non-coding only) Phase 3: COMPUTATIONAL PREDICTIONS → CADD, AlphaMissense, EVE, SIFT/PolyPhen Phase 4: STRUCTURAL ANALYSIS → PDB/AlphaFold2, domains, functional sites (VUS/novel) Phase 4.5: EXPRESSION CONTEXT → CELLxGENE, GTEx tissue expression @@ -88,7 +88,23 @@ See `CODE_PATTERNS.md` for implementation details. Apply for intronic (non-splice), promoter, UTR, or intergenic variants near disease genes. -Tools: `ChIPAtlas_enrichment_analysis`, `ChIPAtlas_get_peak_data`, `ENCODE_search_experiments`, `ENCODE_get_experiment` +**Annotation — what regulatory element is here:** `ChIPAtlas_enrichment_analysis`, `ChIPAtlas_get_peak_data`, `ENCODE_search_experiments`, `ENCODE_get_experiment`. These tell you whether the variant falls in a known TF-binding peak, enhancer, or open-chromatin region. + +**Prediction — what the variant *does* to regulation:** annotation says an element is present, not whether this specific allele disrupts it. Sequence-based deep-learning models answer that directly: they read the reference and alternate DNA windows and predict the change in regulatory signal. This is what turns "the variant is in an enhancer" into "the variant is predicted to reduce accessibility/expression in the relevant tissue" — the mechanistic evidence ACMG PS3/PP3 actually needs for a non-coding variant, where SIFT/PolyPhen/AlphaMissense do not apply. + +| Tool | Predicts | Context | Access | +|---|---|---|---| +| `AlphaGenome_score_variant` | Δ across RNA-seq / ATAC / CAGE / splice tracks (frontier accuracy, single-base) | up to 1 Mb | hosted API — needs `ALPHA_GENOME_API_KEY` | +| `run_enformer_variant_effect` | Δ across 5,313 human tracks (expression, chromatin, TF binding) | 196 kb | remote MCP server | +| `run_borzoi_variant_effect` | Δ in RNA-seq coverage (expression / polyA / splicing emphasis) | 524 kb | remote MCP server | +| `run_chrombpnet_variant_effect` | Δ in chromatin accessibility (ATAC / DNase), base-resolution | ~2 kb | remote MCP server | +| `Evo2_score_variant` | Genome-foundation-model delta log-likelihood; covers coding **and** non-coding | up to 1 Mb | hosted NIM — needs `NVIDIA_API_KEY` | + +**Reading the score:** these return Δ (alt − ref) effect sizes, *not* calibrated pathogenicity probabilities. A large predicted disruption in a tissue-relevant track is mechanistic support (PS3_supporting / PP3) for a non-coding variant; near-zero across tracks supports BP4. Rank or calibrate against known regulatory variants rather than applying an absolute cutoff. + +**Which to pick:** start with `AlphaGenome_score_variant` (broadest readout, longest context, frontier accuracy) when its key is set; `run_enformer_variant_effect` / `run_borzoi_variant_effect` are the named, self-hostable equivalents (Enformer for general regulation, Borzoi when expression/splicing is the question); `run_chrombpnet_variant_effect` when the hypothesis is specifically chromatin accessibility; `Evo2_score_variant` as a sequence-only check that also works on coding variants. If no key/server is provisioned, fall back to the ChIPAtlas/ENCODE annotation above and note the predictive gap rather than guessing. + +**Inputs:** `AlphaGenome_score_variant` takes `chromosome` + `position` + `reference_bases`/`alternate_bases` (+ `output_type`, `sequence_length`); `Evo2_score_variant` takes a DNA window as `sequence` + `position` + `alternate` (point substitution) or `ref_sequence`/`alt_sequence`, plus optional `model` (`evo2-40b` default, `evo2-7b` faster); the Enformer/Borzoi/ChromBPNet remote tools take the variant locus and score the change over their output tracks. ## Phase 2.9: Short-Circuit Check diff --git a/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md b/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md index 78c61ecb..b6341e77 100644 --- a/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md +++ b/upstream/mims-harvard-ToolUniverse/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md @@ -2,9 +2,9 @@ title: "Clinical Variant Interpreter - Tool Reference" task: "" lineage_type: import -upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/e2520a96/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md -upstream_sha: e2520a96 -imported_at: 2026-06-26 +upstream_source: https://github.com/mims-harvard/ToolUniverse/blob/3038dcbe/skills/tooluniverse-variant-interpretation/TOOLS_REFERENCE.md +upstream_sha: 3038dcbe +imported_at: 2026-06-30 prompt_class: prompt upstream_changes: accepted author: upstream @@ -626,6 +626,20 @@ peaks = tu.tools.ChIPAtlas_get_peak_data( | `ENCODE_get_experiment` | Experiment details | `accession` | | `ENCODE_get_biosample` | Sample annotations | `accession` | +### Sequence Deep-Learning Variant-Effect Predictors + +Predict the functional impact of a non-coding (and, for Evo 2, any) variant directly from sequence — the mechanistic evidence (PS3_supporting / PP3) that SIFT/PolyPhen/AlphaMissense cannot give for non-coding loci. Outputs are Δ (alt − ref) effect sizes, not calibrated probabilities. + +| Tool | Predicts | Access | +|------|----------|--------| +| `AlphaGenome_score_variant` | RNA-seq/ATAC/CAGE/splice track Δ (1 Mb, single-base) | hosted API — `ALPHA_GENOME_API_KEY` | +| `run_enformer_variant_effect` | Δ across 5,313 human tracks (196 kb) | remote MCP server | +| `run_borzoi_variant_effect` | RNA-seq coverage Δ (expression/splicing, 524 kb) | remote MCP server | +| `run_chrombpnet_variant_effect` | chromatin accessibility Δ (ATAC/DNase, base-res) | remote MCP server | +| `Evo2_score_variant` | genome-LM delta log-likelihood; coding + non-coding | hosted NIM — `NVIDIA_API_KEY` | + +**Inputs**: `AlphaGenome_score_variant` → `chromosome`,`position`,`reference_bases`,`alternate_bases`,`output_type`,`sequence_length`. `Evo2_score_variant` → `sequence`+`position`+`alternate` (or `ref_sequence`/`alt_sequence`), optional `model` (`evo2-40b`/`evo2-7b`). The Enformer/Borzoi/ChromBPNet remote tools take the variant locus. See SKILL.md Phase 2.5 for selection guidance. + **Example - Get regulatory annotations**: ```python # Search for regulatory data near variant