[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DKQQWCTM4258PVW4FVZ8C8":3,"skill-same:01M7DKQQWCTM4258PVW4FVZ8C8":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M7DKQQWCTM4258PVW4FVZ8C8","answer-eye-questions-with-visionkb-kg",null,"Answer chat-style knowledge questions about eye genes, cell types, diseases and datasets from the VisionKB knowledge graph through its read-only HTTP API or the equivalent visionkb-kg MCP tools, citing the KG release and dataset versions. Resolves a gene or cell type to a CURIE, reads per-class and per-cell-type expression from the HECA atlas summaries, reads typed Biolink relationships with knowledge_level, sources and PMIDs, opens the evidence behind an edge, and finds atlases with ready bind records, keeping atlas observations apart from curated claims. Use for questions such as which retinal cell types express LRAT, which class has the highest RHO, which diseases and PMIDs are recorded for PRPF31, or which atlases contain RPE cells. Not for new analysis of cell-level data.","lijinbio\u002Faiscientist-skills","lijinbio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16247242?v=4","01M7DKPQK7Q6V7QXAAPV51Z89N","Jin Li","01M7DKPQM0NMDN3M6XH7Z9AAKM",0,"MIT","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: answer-eye-questions-with-visionkb-kg\ndescription: Answer chat-style knowledge questions about eye genes, cell types, diseases and datasets from the VisionKB knowledge graph through its read-only HTTP API or the equivalent visionkb-kg MCP tools, citing the KG release and dataset versions. Resolves a gene or cell type to a CURIE, reads per-class and per-cell-type expression from the HECA atlas summaries, reads typed Biolink relationships with knowledge_level, sources and PMIDs, opens the evidence behind an edge, and finds atlases with ready bind records, keeping atlas observations apart from curated claims. Use for questions such as which retinal cell types express LRAT, which class has the highest RHO, which diseases and PMIDs are recorded for PRPF31, or which atlases contain RPE cells. Not for new analysis of cell-level data.\nlicense: MIT\ncompatibility: Needs network access to a running VisionKB API (visionkb-api 0.1.1 or later, deployed with visionkb-deploy) and a read token in a file; Python 3.11+ with httpx (scripts\u002Fvkb_client.py), or curl and jq. No local compute, no atlas files, no scheduler.\nmetadata:\n  category: knowledge-graph\n  version: \"0.0.1\"\n  status: community\n  author: \"Jin Li\"\n  tags: \"knowledge-graph, biolink, gene-expression, retina, eye, cell-atlas, disease-genes, provenance, rest-api, mcp\"\n  tested-with: \"visionkb-api 0.1.1 (image digest sha256:5d956d03...), visionkb-deploy 0.1.1, KG release visionkb-2026.11.0, Neo4j 2026.10.1 Community, PostgreSQL 17.11, httpx 0.28.1, Python 3.13.18, curl 8.23.0, jq 1.8.2\"\n  compute: \"none on the client: the four worked questions (roughly 100 HTTP requests, most of them evidence lookups) took 8-18 s wall (four runs) against a stack on the same node; the server stack used 4 GB Neo4j heap and 8 GB page cache\"\n  requires-gpu: \"false\"\n  scheduler: \"none\"\n  requires-network: \"runtime\"\n  requires-secrets: \"VISIONKB_API_TOKEN_FILE\"\n---\n\n# Answer eye knowledge questions with the VisionKB knowledge graph\n\nVisionKB is a Biolink 4.4.6 knowledge graph of eye biology: HGNC genes, Cell Ontology cell types\nplus dataset-specific cell states, UBERON tissues, MONDO diseases, HPO phenotypes, the 13 Human\nEye Cell Atlas (HECA) single-cell and single-nucleus atlases as datasets, expression edges derived\nfrom those atlases, and curated gene-disease claims. It is served read-only by\n[visionkb-api](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Fvisionkb-api) (deployment:\n[visionkb-deploy](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Fvisionkb-deploy)) and released as immutable,\nversioned bundles (`kg_release` = `visionkb-YYYY.MM.N`).\n\nThis skill is the **knowledge answer** route: a few API calls (seconds), no atlas files opened, no\njobs. Every response carries `kg_release`; every expression row carries `dataset_id` and\n`dataset_version`. Cite both.\n\nTested end to end, as written, against a stack deployed with visionkb-deploy 0.1.1 on an HPC\ncompute node, serving the first real release `visionkb-2026.11.0` (Biolink 4.4.6; 2,783,649 nodes; 2,359,657 `expressed_in` edges with\n2,758,076 StudyResults from the 13 HECA atlases at `heca-2026.05`; 22 curated gene-disease or\ngene-phenotype edges). The outputs quoted below are from that run; the HECA datasets are\n`access_level: lab`, so only the values needed to read the example are shown, rounded.\n\nReplace every `\u002Fpath\u002Fto\u002F...` with your own values.\n\n## When to use\n\n- \"Which cell types \u002F major classes express gene X, how strongly, with how many donors?\"\n- \"Which class has the highest X?\" (ranked atlas summaries).\n- \"What is known about gene X and disease Y, with PMIDs?\" (curated `causes` \u002F `gene_associated_with_condition`).\n- \"Which genes are associated with disease Y?\", \"Which genes are expressed in cell type Z?\" (gene sets).\n- \"Which atlases contain RPE cells \u002F are from retina, and how do I attach one?\" (registry + bind record).\n- Before an analysis of a bound atlas: pick the dataset and the prior evidence to compare against.\n\n## When NOT to use\n\n- New statistics on cell-level data (DE, composition, signature scoring, donor-aware tests): bind\n  the atlas the registry returns and run the analysis tools; the KG holds summaries only.\n- Region-specific claims from the graph: region x class numbers exist only in the atlas summary\n  table (`level=region_majorclass`), never as edges.\n- Perturbation results and cell-state comparisons: not in the 0.1 API (not exposed).\n\n## 1. Environment\n\n```bash\nmamba create -y -n visionkb_kgclient -c conda-forge python=3.13 httpx=0.28.1 jq curl\nsource \"$(conda info --base)\u002Fetc\u002Fprofile.d\u002Fconda.sh\"\nconda activate visionkb_kgclient\nexport VISIONKB_API_URL=http:\u002F\u002F127.0.0.1:8770\u002Fv1                 # your deployment\nexport VISIONKB_API_TOKEN_FILE=\u002Fpath\u002Fto\u002Fsecrets\u002Fapi_token_read   # one line: the read token\nexport VKB_SKILL_SCRIPTS=\u002Fpath\u002Fto\u002Fanswer-eye-questions-with-visionkb-kg\u002Fscripts   # vkb_client.py\n```\n\nThe tested solve: Python 3.13.18, httpx 0.28.1, curl 8.23.0, jq 1.8.2 (conda-forge). With visionkb-deploy, `bin\u002Fvisionkb init` writes the read\ntoken to `\u003Cdeploy dir>\u002F\u003Cinstance>\u002Fsecrets\u002Fapi_token_read` (mode 600) and `bin\u002Fvisionkb health`\nchecks the stack. Never paste the token into code, logs or reports.\n\n## 2. Client\n\nEvery call returns the same envelope:\n`{\"status\": \"ok\"|\"error\", \"kg_release\", \"data\", \"page\": {\"limit\", \"offset\", \"total\"} | null, \"warnings\", \"error\"}`.\nLists default to 50 rows (max 200). Errors are returned as envelopes, never as invented data.\n\n**A page can hold fewer rows than `limit`.** The API trims every response to stay under about\n24,000 characters and then warns `\u003Clist>: returned N of M items to stay within 24000 characters;\npage with limit\u002Foffset`. Advance `offset` by the number of rows received (`len(data)`), never by\n`limit`, or the trimmed rows are skipped silently. [scripts\u002Fvkb_client.py](scripts\u002Fvkb_client.py)\n(httpx; its paging logic is tested in `tests\u002F` against a fake API that trims every page) does\nthis:\n\n| Function | Does |\n| --- | --- |\n| `KG(url, token_file)` | client with the bearer token read from the file |\n| `kg.get(path, **params)` | one call; raises on `status: error`, prints `warnings` |\n| `kg.get_all(path, **params)` | every row of a list endpoint, `offset += len(data)` until `page.total` |\n| `kg.evidence_all(edge_id)` | `\u002Fevidence\u002F{edge_id}` with every StudyResult, paged the same way |\n| `kg.resolve(q, category)` | `search_entities`, exact CURIE or symbol match only, else `LookupError` |\n| `coverage(env[, rows])` | `complete: n of total`, `trimmed: n of total (...)`, `partial: ...` or `top n` (search) |\n\nUse `get_all` \u002F `evidence_all` for anything you count or conclude from; when you keep a single\npage (a top-5 view), print `coverage(...)` with it so the answer says what it covers. The worked\nquestions start with:\n\n```python\nimport json\nimport os\nimport pathlib\nimport sys\n\nsys.path.insert(0, os.environ[\"VKB_SKILL_SCRIPTS\"])  # \u003Cskill folder>\u002Fscripts\nfrom vkb_client import KG, coverage\n\nkg = KG(os.environ[\"VISIONKB_API_URL\"], os.environ[\"VISIONKB_API_TOKEN_FILE\"])\nget, get_all, resolve = kg.get, kg.get_all, kg.resolve\nOUT = pathlib.Path(sys.argv[1])  # every response envelope is kept here, for the report\nOUT.mkdir(parents=True, exist_ok=True)\nSEQ = [0]\n\n\ndef save(name, env):\n    SEQ[0] += 1\n    (OUT \u002F f\"{SEQ[0]:02d}_{name}.json\").write_text(json.dumps(env, indent=1))\n\n\ndef show(rows, cols):\n    for r in rows:\n        print(\"  \" + \"  \".join(f\"{c}={r.get(c)}\" for c in cols))\n```\n\nThe same calls with curl and jq (these ran as written):\n\n```bash\nH=\"Authorization: Bearer $(cat \"$VISIONKB_API_TOKEN_FILE\")\"\ncurl -fsS \"$VISIONKB_API_URL\u002Fready\" >ready.json\ncurl -fsS -H \"$H\" \"$VISIONKB_API_URL\u002Fentities\u002Fsearch?q=LRAT&category=biolink:Gene&limit=3\" >search.json\ncurl -fsS -H \"$H\" \"$VISIONKB_API_URL\u002Fatlas\u002Fexpression?genes=LRAT&level=majorclass&limit=3\" >atlas.json\njq -c '{kg_release, ready: .data}' ready.json\njq -c '.kg_release, (.data[] | {id, symbol, match})' search.json\njq -c '.data[] | {dataset_id, dataset_version, group_label, pct_expressing, pseudobulk_cp10k}' atlas.json\n# one page only: say how much of the result it is (rows \u003C limit can mean trimmed, see warnings)\njq -c '{returned: (.data | length), page, warnings}' atlas.json\n# errors are envelopes too: no token -> 401; no anchor -> missing_anchor; absent predicate\ncurl -sS -o \u002Fdev\u002Fnull -w 'no token: HTTP %{http_code}\\n' \"$VISIONKB_API_URL\u002Frelease\"\ncurl -sS -H \"$H\" \"$VISIONKB_API_URL\u002Frelationships?predicate=biolink:expressed_in\" | jq -c '{status, error}'\ncurl -sS -H \"$H\" \"$VISIONKB_API_URL\u002Frelationships?subject=HGNC:6685&predicate=biolink:treats\" | jq -c '.error'\n```\n\nWhat came back: `ready` with `neo4j`, `summaries` and `postgres` all `ok` and the release id;\n`LRAT` resolved to `HGNC:6685` (`exact_symbol`) with `LRATD1` and `LRATD2` as `fulltext` hits; the\ntop three LRAT rows across all atlases were RPE groups of `ds-rpechoroid-scrna`, `ds-hrca-snrna`\nand `ds-rpechoroid-snrna`; no token gave HTTP 401; `\u002Frelationships` without an anchor gave\n`missing_anchor`.\n\nThe `{returned, page, warnings}` line is the same check for one curl page; here it gave\n`returned: 3` with `limit: 3`, `total: 132` and no warning, i.e. a partial page by `limit`, not a\ntrimmed one.\n\n## 3. What is in the graph, and what each field means\n\n| Source | Edges | `knowledge_level` | `agent_type` | `primary_knowledge_source` |\n| --- | --- | --- | --- | --- |\n| HECA atlas summaries | `expressed_in` (gene -> cell type or state) | `observation` | `data_analysis_pipeline` | `infores:visionkb-heca` |\n| RetiGene curated haploinsufficiency review | `causes`, `gene_associated_with_condition` (gene -> disease), `has_phenotype` (gene -> HPO) | `knowledge_assertion` | `manual_validation_of_automated_agent` | `infores:visionkb-retigene` |\n| CL, UBERON, MONDO, HPO | `subclass_of`, `part_of` | `knowledge_assertion` | `manual_agent` | `infores:cl`, ... |\n\n`knowledge_level` is what keeps observations apart from claims: an `expressed_in` edge says \"this\ntranscript was measured in these cells of this atlas\", nothing about function; a\n`causes` or `gene_associated_with_condition` edge is a curated statement backed by publications\n(with a curator `grade` per StudyResult). Filter with\n`knowledge_level=` on `\u002Frelationships` and report the two kinds in separate paragraphs.\n\n**Evidence.** Each edge lists `has_study_results`; `GET \u002Fevidence\u002F{edge_id}` returns them. For\nexpression, one StudyResult per (dataset, level, group) with `n_cells`, `n_donors`,\n`pct_expressing`, `mean_log1p_cp10k`, `pseudobulk_cp10k`, `n_donors_expressing`, `method`; for\ncurated claims, `pmid`, `page`, `evidence_kind`, `grade` and a short `supporting_text` (lab\ncuration: do not quote it outside the lab).\n\n**What makes an `expressed_in` edge (VisionKB decision D18).** A (gene, dataset, group) becomes an\nedge, with a StudyResult, only if all of these hold:\n\n1. `pct_expressing >= 0.10` and `n_cells >= 20` in the group;\n2. `pseudobulk_cp10k >= 0.10 x` the gene's maximum over the groups of the same dataset and level\n   (specificity: removes low-level spill-over of very abundant transcripts);\n3. `n_donors_expressing >= 2` (a donor counts when >= 10 % of its cells in the group express the\n   gene). Atlases without donor labels would use 1-2 only, with flagged edges; all 13 atlases of\n   `visionkb-2026.11.0` have donor labels.\n\nEdges exist at two levels, `majorclass` and `celltype` (CL class, or a `visionkb:cs-\u003Cdataset>-\u003Clabel>`\nCellState that is `subclass_of` a CL class). **Region x major class numbers are only in the\nParquet summaries** (`\u002Fatlas\u002Fexpression?level=region_majorclass`); there are no regional edges.\n\n**Absence of an edge is not evidence of non-expression.** The graph keeps only the rows that pass\nthe rule above. Before saying \"X is not expressed in Z\", read the atlas rows\n(`\u002Fatlas\u002Fexpression`, all genes x groups, no threshold) and report `pct_expressing`,\n`pseudobulk_cp10k` and donor support. Also check that the gene and group exist in that dataset:\na gene missing from the summaries comes back as no rows plus the warning\n`\u003Cgene>: not found in the expression summaries`, not as zeros.\n\n**Ambient RNA in snRNA.** Very abundant transcripts leak into other nuclei. In the HRCA snRNA\natlas, RHO is detected in 17-28 % of amacrine, bipolar, cone and Müller-glia nuclei at 3-9 % of\nthe rod pseudobulk (section 4.2). Rule 2 removes those edges, but the atlas rows still show\nthem: a rod gene at 0.1-0.3 `pct_expressing` in a non-rod class is contamination until shown\notherwise (for example by specific expression in an scRNA atlas or by another method). Say so\nwhenever you report such a row.\n\n**Doublet programs in small subtypes (known issue KI-1).** Small subtypes of one class can carry\nthe program of another, abundant class (rod genes in amacrine subtypes in `visionkb-2026.11.0`).\nThose groups pass all three rules and get edges. For a gene that marks one major class strongly,\nread the major-class rows first and treat edges to small subtypes of a different class as\npossible contamination (section 4.2 shows how to check every edge).\n\n## 4. A knowledge answer (Route A) in about six calls\n\n1. `GET \u002Frelease`: `kg_release`, atlases and versions, predicates present.\n2. `GET \u002Fentities\u002Fsearch?q=...`: exact CURIE \u002F symbol match only (synonym or full-text hits need\n   checking).\n3. `GET \u002Fatlas\u002Fexpression?genes=...&level=majorclass|celltype` (add `dataset=` to stay in one atlas).\n4. `GET \u002Frelationships?subject=\u003CCURIE>&predicate=...` (or `knowledge_level=`).\n5. `GET \u002Fevidence\u002F{edge_id}` for the edges you cite.\n6. `GET \u002Fdatasets?entities=...|tissue=...` when the next step is an analysis.\n\nThe parameters of the worked questions below:\n\n```python\nQ1_GENE = os.environ.get(\"Q1_GENE\", \"LRAT\")\nQ1_DATASET = os.environ.get(\"Q1_DATASET\", \"visionkb:ds-hrca-snrna\")\nQ2_GENE = os.environ.get(\"Q2_GENE\", \"RHO\")\nQ3_GENE = os.environ.get(\"Q3_GENE\", \"PRPF31\")\n```\n\n### 4.0 Which release am I querying?\n\n```python\nrel = get(\"\u002Frelease\")\nsave(\"release\", rel)\nprint(\"kg_release:\", rel[\"kg_release\"], \"| biolink\", rel[\"data\"][\"biolink_version\"])\nprint(\"predicates:\", rel[\"data\"].get(\"predicates_in_graph\"))\nprint(\"edges by predicate:\", rel[\"data\"][\"counts\"][\"edges_by_predicate\"])\nfor a in rel[\"data\"][\"atlases\"]:\n    print(\"  atlas\", a[\"dataset_id\"], a[\"atlas_version\"])\nexpect = os.environ.get(\"VISIONKB_EXPECT_RELEASE\")\nassert expect is None or rel[\"kg_release\"] == expect, (rel[\"kg_release\"], expect)\n```\n\nThe run printed `visionkb-2026.11.0`, the six predicates present (`causes`, `expressed_in`,\n`gene_associated_with_condition`, `has_phenotype`, `part_of`, `subclass_of`), the edge counts per\npredicate and the 13 atlases, all at `heca-2026.05`.\n\n**Known issues are not in `\u002Frelease`.** visionkb-api 0.1.1 does not return the manifest's\n`known_issues`; read `validation\u002Fknown_issues.json` (or the Known issues section of\n`validation\u002Freport.md`) of the release bundle, or ask the operator. For `visionkb-2026.11.0` it\nholds KI-1 (section 3).\n\n### 4.1 In which classes and cell types is LRAT expressed? (expression, observation)\n\n```python\nprint(f\"\\n# Q1 {Q1_GENE}: expression by class and cell type\")\ngene, hits = resolve(Q1_GENE)\nsave(\"q1_search\", hits)\nprint(\"  search:\", coverage(hits))\nshow(hits[\"data\"], [\"id\", \"symbol\", \"name\", \"match\"])\n\nedges = get_all(\"\u002Frelationships\", subject=gene, predicate=\"biolink:expressed_in\", limit=200)\nsave(\"q1_expressed_in_edges\", edges)\nprint(\"  expressed_in edges (all atlases):\", coverage(edges))\nfor e in edges[\"data\"][:8]:\n    print(\"   \", e[\"object\"][\"id\"], e[\"object\"][\"name\"], e[\"qualifiers\"], e[\"summary\"])\n# an edge aggregates atlases: its StudyResults say which (dataset, level, group) support it\nedge_groups = set()\nfor e in edges[\"data\"]:\n    for sr in kg.evidence_all(e[\"edge_id\"], limit=200)[\"data\"][\"study_results\"]:\n        edge_groups.add((sr[\"dataset_id\"], sr[\"level\"], sr[\"group_label\"]))\n\nfor level in (\"majorclass\", \"celltype\"):\n    ex = get_all(\"\u002Fatlas\u002Fexpression\", genes=gene, dataset=Q1_DATASET, level=level, limit=200)\n    save(f\"q1_atlas_{level}\", ex)\n    top_cp10k = ex[\"data\"][0][\"pseudobulk_cp10k\"]  # rows are sorted by pseudobulk_cp10k\n    print(f\"  atlas {level}:\", coverage(ex), \"| rule a\u002Fb\u002Fc as in D18\")\n    for r in ex[\"data\"][:5]:\n        a = r[\"pct_expressing\"] >= 0.10 and r[\"n_cells\"] >= 20\n        b = r[\"pseudobulk_cp10k\"] >= 0.10 * top_cp10k\n        c = r[\"n_donors_expressing\"] >= 2\n        print(\n            f\"   {r['group_label']} {r['cell_type_id']} n_cells={r['n_cells']} \"\n            f\"pct={r['pct_expressing']} cp10k={r['pseudobulk_cp10k']} \"\n            f\"donors={r['n_donors_expressing']}\u002F{r['n_donors']} a={a} b={b} c={c} \"\n            f\"edge={(Q1_DATASET, level, r['group_label']) in edge_groups}\"\n        )\n\nreg = get(\"\u002Fatlas\u002Fexpression\", genes=gene, dataset=Q1_DATASET, level=\"region_majorclass\", limit=5)\nsave(\"q1_atlas_region_majorclass\", reg)\nprint(\"  atlas region_majorclass (Parquet only, no KG edges):\", coverage(reg))\nshow(reg[\"data\"], [\"group_label\", \"region\", \"pct_expressing\", \"pseudobulk_cp10k\"])\n\nif edges[\"data\"]:\n    ev = get(f\"\u002Fevidence\u002F{edges['data'][0]['edge_id']}\", limit=10)  # first page only\n    save(\"q1_evidence_top_edge\", ev)\n    srs = ev[\"data\"][\"study_results\"]\n    print(\"  evidence:\", ev[\"data\"][\"edge\"][\"object\"][\"id\"], coverage(ev, srs))\n    cols = [\"dataset_id\", \"atlas_version\", \"level\", \"group_label\", \"n_donors_expressing\", \"method\"]\n    show(srs, cols)\n```\n\nWhat the run showed (HRCA snRNA, 3,177,310 nuclei, `heca-2026.05`):\n\n- `LRAT` -> `HGNC:6685` (`exact_symbol`). 28 `expressed_in` edges over all atlases: RPE (CL and\n  dataset-specific RPE states), melanocytes, Schwann cells and one reactive Müller-glia state\n  (`MG_reactive`). Edges\n  to the same cell type with different `anatomical_context_qualifier` (retina vs RPE\u002Fchoroid) are\n  separate edges.\n- Major class: RPE is the top group (about three quarters of nuclei, 23 of 24 donors); it passes\n  rules a, b and c and has an edge. Müller glia come second at about 7 % of nuclei and 4 % of the\n  RPE pseudobulk, with 21 of 100 donors: rules a and b fail, so **no edge, but the gene is\n  detected**. Report it as low-level detection, not as absence.\n- Cell type: amacrine subtype HAC39 has about 24 % of nuclei expressing and 73 donors, so it\n  passes a and c, but fails b (under 10 % of the RPE pseudobulk): no edge.\n- Region x major class: 30 rows (the code keeps the top 5 and says `partial: 5 of 30`), only in the Parquet (RPE pseudobulk is similar in fovea, macula and\n  periphery). There are no regional edges to query.\n- The evidence of the top RPE edge lists three StudyResults, each with dataset, atlas version,\n  level, group and the D18 `method` string.\n\n### 4.2 Which major class shows the highest RHO? (ranking, ambient RNA)\n\n```python\nprint(f\"\\n# Q2 {Q2_GENE}: top major class per atlas, then every edge checked against it\")\nrho, _ = resolve(Q2_GENE)\ntop = get_all(\"\u002Fatlas\u002Fexpression\", genes=rho, level=\"majorclass\", limit=200)\nsave(\"q2_atlas_majorclass_all_datasets\", top)\nby_ds = {}\nfor r in top[\"data\"]:  # sorted by pseudobulk_cp10k over all atlases\n    by_ds.setdefault(r[\"dataset_id\"], []).append(r)\ntop_class = {ds: rows[0][\"cell_type_id\"] for ds, rows in by_ds.items()}\nfor ds, rows in by_ds.items():\n    detected = [r[\"group_label\"] for r in rows if r[\"pct_expressing\"] >= 0.10]\n    print(f\"  {ds}: top {rows[0]['group_label']}; groups with pct>=0.10: {detected}\")\n    show(rows[:3], [\"group_label\", \"n_cells\", \"pct_expressing\", \"pseudobulk_cp10k\"])\n\n# Majorclass first, then each edge's StudyResults: support from a group of ANOTHER class than the\n# atlas's top class (a small subtype, or a non-rod class in snRNA) is possible contamination\n# (doublets or ambient RNA), not expression. Known issue KI-1 of visionkb-2026.11.0.\nrho_edges = get_all(\"\u002Frelationships\", subject=rho, predicate=\"biolink:expressed_in\", limit=200)\nsave(\"q2_expressed_in_edges\", rho_edges)\nprint(f\"  expressed_in edges for {Q2_GENE}:\", coverage(rho_edges))\nfor e in rho_edges[\"data\"]:\n    o = e[\"object\"][\"id\"]\n    parents = get_all(\"\u002Frelationships\", subject=o, predicate=\"biolink:subclass_of\", limit=50)[\n        \"data\"\n    ]\n    parent_ids = [x[\"object\"][\"id\"] for x in parents]\n    for sr in kg.evidence_all(e[\"edge_id\"], limit=200)[\"data\"][\"study_results\"]:\n        tc = top_class[sr[\"dataset_id\"]]\n        flag = \"\" if tc in (o, *parent_ids) else \"  \u003C- not the top class: check\"\n        print(\n            f\"   {o} ({e['object']['name']}) parent={parent_ids} | {sr['dataset_id']} \"\n            f\"{sr['level']} \"\n            f\"{sr['group_label']} n_cells={sr['n_cells']} pct={sr['pct_expressing']} \"\n            f\"cp10k={sr['pseudobulk_cp10k']} donors={sr['n_donors_expressing']}{flag}\"\n        )\n```\n\nWhat the run showed:\n\n- Major class: Rod is the top class in both HRCA atlases (snRNA: about 91 % of 1,066,056 rod\n  nuclei, 103 donors). In HRCA snRNA, RHO is also detected in at least 10 % of nuclei of **every**\n  other major class (AC 17 %, BC, Cone and MG 26-28 %) at 3-9 % of the rod pseudobulk, which is\n  the ambient-RNA signature; rule b removes those major-class edges. Microglia, astrocyte and RPE\n  sit just above the threshold (10-12 % of the rod level) and keep edges: treat them as\n  unresolved (ambient RNA, or phagocytosed outer segments) unless another atlas or method\n  supports them.\n- 20 edges in total. Besides Rod: 14 amacrine subtypes of HRCA snRNA (39 to 1,057 nuclei each)\n  with 40-84 % of nuclei expressing at 11-28 % of the rod pseudobulk, and the bipolar type OFFx.\n  Twelve of those subtypes plus SEG* are exactly the 13 rod-program groups of **KI-1**; VG3* and\n  OFFx are not listed there but follow the same pattern.\n- ONONH snRNA has no rods; its top class for RHO is MG at about 10 % of nuclei and 0.3 CP10k, so\n  the within-atlas rule keeps an edge there. Compare with the gene's home class in other atlases\n  (15.8 CP10k in HRCA snRNA rods) before calling it expression.\n\n**Known issue KI-1 of `visionkb-2026.11.0` (decision D19).** Several small HRCA snRNA amacrine\nsubtypes (for example HAC79, HAC82, HAC89, AII*) carry a rod transcript program (KI-1 median\nratios to the rod level 0.14-0.25 for those four, with PDE6A, SAG, CNGB1 and PDE6G as examples;\nRHO at 11-28 % of the rod level in the run above), most likely rod-amacrine doublets. Their\n`expressed_in` edges to rod genes are real rows of the summaries but probably not expression.\nFor photoreceptor genes, and generally any gene that is a strong marker of another major class:\nread the major-class rows first, then treat edges to small subtypes of a different class as\npossible contamination and cite KI-1. No edge is flagged or removed in this release; a\ncontamination QC flag is planned for `visionkb-2026.11.1`.\n\n### 4.3 Which diseases are associated with PRPF31, with PMIDs? (curated claims)\n\n```python\nprint(f\"\\n# Q3 {Q3_GENE}: disease edges (curated claims) and their evidence\")\ng3, _ = resolve(Q3_GENE)\nallrel = get_all(\"\u002Frelationships\", subject=g3, limit=200)\nsave(\"q3_all_edges\", allrel)\nlevels = {}\nfor e in allrel[\"data\"]:\n    k = (e[\"predicate\"], e[\"knowledge_level\"], e[\"primary_knowledge_source\"])\n    levels[k] = levels.get(k, 0) + 1\nfor k, n in sorted(levels.items()):\n    print(\"  \", *k, n)\ndis = get_all(\"\u002Frelationships\", subject=g3, object_category=\"biolink:Disease\", limit=50)\nsave(\"q3_disease_edges\", dis)\nprint(\"  edges to diseases:\", coverage(dis))\nfor e in dis[\"data\"]:\n    o = e[\"object\"]\n    print(\"   \", e[\"predicate\"], o[\"id\"], o[\"name\"], e[\"knowledge_level\"], e[\"agent_type\"])\n    pubs = e[\"publications\"]  # at most 5 here; n_publications is the full count\n    print(\"     \", e[\"primary_knowledge_source\"], pubs, f\"({len(pubs)} of {e['n_publications']})\")\nif dis[\"data\"]:\n    ev3 = kg.evidence_all(dis[\"data\"][0][\"edge_id\"], limit=200)\n    save(\"q3_evidence\", ev3)\n    print(\"  evidence:\", coverage(ev3, ev3[\"data\"][\"study_results\"]))\n    print(\"  publications:\", ev3[\"data\"][\"publications\"])\n    show(ev3[\"data\"][\"study_results\"], [\"id\", \"pmid\", \"grade\"])\n    gs = get_all(\n        \"\u002Fgene-sets\", entity=dis[\"data\"][0][\"object\"][\"id\"], kind=\"disease_genes\", limit=50\n    )\n    save(\"q3_gene_set_disease\", gs)\n    print(f\"  genes associated with {dis['data'][0]['object']['id']}:\", coverage(gs))\n    show(gs[\"data\"], [\"gene_id\", \"symbol\", \"score\"])\n```\n\nWhat the run showed:\n\n- 201 edges from `PRPF31` (`HGNC:15446`): 200 `expressed_in` (observation, `infores:visionkb-heca`)\n  and 1 curated claim.\n- The claim is `biolink:causes` -> `MONDO:0019200` retinitis pigmentosa, `knowledge_assertion`,\n  `manual_validation_of_automated_agent`, `infores:visionkb-retigene`. The edge lists 5 PMIDs (the\n  relationship view is capped at 5); its evidence has 12 StudyResults with 8 distinct PMIDs\n  (`PMID:12714658`, `18450588`, `20232351`, `24419317`, `33576794`, `36672815`, `37809982`,\n  `40674075`), each with the curator `grade`.\n- `\u002Fgene-sets` for retinitis pigmentosa returned 3 genes (PRPF31, PRPF4, RP1).\n\nThe curated claims come from one source, a haploinsufficiency review: 22 gene-disease or\ngene-phenotype edges in this release (`causes`, `gene_associated_with_condition`,\n`has_phenotype`). **A missing disease edge says nothing about the gene**; say \"not in the curated\nsource of this release\". Use `object_category=biolink:Disease` (or `biolink:PhenotypicFeature`\nfor HPO) rather than one predicate, since the curated predicates differ by claim.\n\n### 4.4 Which atlases can I attach for RPE, or for retina? (datasets, bind records)\n\n```python\nprint(\"\\n# Q4 datasets with bind records\")\nrpe = get(\"\u002Fentities\u002Fsearch\", q=\"retinal pigment epithelial cell\", category=\"biolink:Cell\", limit=3)\nsave(\"q4_search_rpe\", rpe)\nprint(\"  search:\", coverage(rpe))\nshow(rpe[\"data\"], [\"id\", \"name\", \"match\"])\nrpe_id = next(h[\"id\"] for h in rpe[\"data\"] if h[\"name\"] == \"retinal pigment epithelial cell\")\nfor label, params in (\n    (\"rpe_cells\", {\"entities\": rpe_id}),\n    (\"retina\", {\"tissue\": \"UBERON:0000966\"}),\n):\n    ds = get_all(\"\u002Fdatasets\", limit=50, **params)\n    save(f\"q4_datasets_{label}\", ds)\n    print(f\"  {label} datasets:\", coverage(ds))\n    for d in ds[\"data\"]:\n        bind = {k: v for k, v in d[\"bind\"].items() if k != \"path\"}  # path = HPC-side h5ad path\n        print(\"   \", d[\"id\"], d[\"version\"], d[\"assay\"], d[\"n_cells\"], d[\"access_level\"], bind)\n\nprint(\"\\ndone:\", SEQ[0], \"responses saved in\", OUT)\n```\n\nWhat the run showed:\n\n- `retinal pigment epithelial cell` resolved by full text to `CL:0002586` (checked by name).\n- 5 datasets have RPE cells: HRCA scRNA and snRNA, ONONH snRNA, RPE\u002Fchoroid scRNA and snRNA\n  (`matched` says why; for the last three it also lists the dataset-specific RPE cell states\n  under `via`). All are\n  `heca-2026.05`, `access_level: lab`.\n- `tissue=UBERON:0000966` (retina) returned the two HRCA atlases.\n- Each record carries `bind = {name, path, role: \"reference\"}`. `path` is the HPC-side `.h5ad`\n  path for an analysis job (AiScientist attaches it); the API never opens it, and the code above\n  leaves it out of the printout. Never publish it.\n\n## 5. The same with the MCP server\n\nThe `visionkb-kg` MCP server (from [aiscientist-mcp](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-mcp))\nhas one tool per endpoint, with the query parameters as arguments (names as specified for the\nserver): `get_release`,\n`search_entities`, `get_relationships`, `get_evidence`, `get_gene_set`, `query_atlas_expression`,\n`find_datasets`. The mapping is in [references\u002Fmcp-tools.md](references\u002Fmcp-tools.md). This\nskill's runs used the HTTP API only.\n\n## 6. Validate before answering\n\n1. **Release.** Every envelope has the same `kg_release` as `\u002Frelease`. Mixing releases in one\n   answer is an error.\n2. **Resolution.** `match` is `exact_id` or `exact_symbol`. A `synonym` or `fulltext` hit must be\n   checked by name; HGNC previous symbols and aliases are synonyms here.\n3. **Warnings.** Read them: \"not found in the expression summaries\", \"matches N genes\",\n   deprecated predicates, and lower-than-graph thresholds all arrive as warnings.\n4. **Paging.** `page.total` larger than the rows you read means you have not seen everything\n   (search returns ranked top-k with `total: null`).\n5. **Donor support.** A high `pct_expressing` with `n_donors_expressing` of 0-1 is weak; say so.\n6. **Ambient RNA, doublets and absence.** As in section 3: no edge does not mean no expression;\n   abundant transcripts in snRNA leak into other classes; edges to small subtypes of another\n   class may be doublet programs. Check the release's known issues (KI-1 in `visionkb-2026.11.0`).\n7. **Access level.** HECA datasets are `access_level: lab` until published; do not send their rows\n   outside the lab.\n\n## 7. Report\n\n- `kg_release`, and for every expression number the `dataset_id` and `dataset_version`;\n- each entity with its CURIE and how it was resolved;\n- expression (observation) and curated claims (knowledge_assertion) in separate paragraphs, each\n  claim with `primary_knowledge_source` and PMIDs;\n- for expression: level, group, `pct_expressing`, `pseudobulk_cp10k`, `n_donors_expressing` \u002F\n  `n_donors`; the ambient-RNA, doublet (known issue id) and absence caveats where they apply;\n- for datasets: id, version, assay, cell count, `access_level` and the `bind` record;\n- what was not checked (e.g. other atlases, other levels, pages not read).\n\n## Troubleshooting\n\nHTTP 401, `missing_anchor`, truncated lists, a proxy setting that breaks httpx, and a Neo4j store\nthat loads fewer nodes than the manifest: see [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n","# Answer eye knowledge questions with the VisionKB knowledge graph\n\nVisionKB is a Biolink 4.4.6 knowledge graph of eye biology: HGNC genes, Cell Ontology cell types\nplus dataset-specific cell states, UBERON tissues, MONDO diseases, HPO phenotypes, the 13 Human\nEye Cell Atlas (HECA) single-cell and single-nucleus atlases as datasets, expression edges derived\nfrom those atlases, and curated gene-disease claims. It is served read-only by\n[visionkb-api](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Fvisionkb-api) (deployment:\n[visionkb-deploy](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Fvisionkb-deploy)) and released as immutable,\nversioned bundles (`kg_release` = `visionkb-YYYY.MM.N`).\n\nThis skill is the **knowledge answer** route: a few API calls (seconds), no atlas files opened, no\njobs. Every response carries `kg_release`; every expression row carries `dataset_id` and\n`dataset_version`. Cite both.\n\nTested end to end, as written, against a stack deployed with visionkb-deploy 0.1.1 on an HPC\ncompute node, serving the first real release `visionkb-2026.11.0` (Biolink 4.4.6; 2,783,649 nodes; 2,359,657 `expressed_in` edges with\n2,758,076 StudyResults from the 13 HECA atlases at `heca-2026.05`; 22 curated gene-disease or\ngene-phenotype edges). The outputs quoted below are from that run; the HECA datasets are\n`access_level: lab`, so only the values needed to read the example are shown, rounded.\n\nReplace every `\u002Fpath\u002Fto\u002F...` with your own values.\n\n## When to use\n\n- \"Which cell types \u002F major classes express gene X, how strongly, with how many donors?\"\n- \"Which class has the highest X?\" (ranked atlas summaries).\n- \"What is known about gene X and disease Y, with PMIDs?\" (curated `causes` \u002F `gene_associated_with_condition`).\n- \"Which genes are associated with disease Y?\", \"Which genes are expressed in cell type Z?\" (gene sets).\n- \"Which atlases contain RPE cells \u002F are from retina, and how do I attach one?\" (registry + bind record).\n- Before an analysis of a bound atlas: pick the dataset and the prior evidence to compare against.\n\n## When NOT to use\n\n- New statistics on cell-level data (DE, composition, signature scoring, donor-aware tests): bind\n  the atlas the registry returns and run the analysis tools; the KG holds summaries only.\n- Region-specific claims from the graph: region x class numbers exist only in the atlas summary\n  table (`level=region_majorclass`), never as edges.\n- Perturbation results and cell-state comparisons: not in the 0.1 API (not exposed).\n\n## 1. Environment\n\n```bash\nmamba create -y -n visionkb_kgclient -c conda-forge python=3.13 httpx=0.28.1 jq curl\nsource \"$(conda info --base)\u002Fetc\u002Fprofile.d\u002Fconda.sh\"\nconda activate visionkb_kgclient\nexport VISIONKB_API_URL=http:\u002F\u002F127.0.0.1:8770\u002Fv1                 # your deployment\nexport VISIONKB_API_TOKEN_FILE=\u002Fpath\u002Fto\u002Fsecrets\u002Fapi_token_read   # one line: the read token\nexport VKB_SKILL_SCRIPTS=\u002Fpath\u002Fto\u002Fanswer-eye-questions-with-visionkb-kg\u002Fscripts   # vkb_client.py\n```\n\nThe tested solve: Python 3.13.18, httpx 0.28.1, curl 8.23.0, jq 1.8.2 (conda-forge). With visionkb-deploy, `bin\u002Fvisionkb init` writes the read\ntoken to `\u003Cdeploy dir>\u002F\u003Cinstance>\u002Fsecrets\u002Fapi_token_read` (mode 600) and `bin\u002Fvisionkb health`\nchecks the stack. Never paste the token into code, logs or reports.\n\n## 2. Client\n\nEvery call returns the same envelope:\n`{\"status\": \"ok\"|\"error\", \"kg_release\", \"data\", \"page\": {\"limit\", \"offset\", \"total\"} | null, \"warnings\", \"error\"}`.\nLists default to 50 rows (max 200). Errors are returned as envelopes, never as invented data.\n\n**A page can hold fewer rows than `limit`.** The API trims every response to stay under about\n24,000 characters and then warns `\u003Clist>: returned N of M items to stay within 24000 characters;\npage with limit\u002Foffset`. Advance `offset` by the number of rows received (`len(data)`), never by\n`limit`, or the trimmed rows are skipped silently. [scripts\u002Fvkb_client.py](scripts\u002Fvkb_client.py)\n(httpx; its paging logic is tested in `tests\u002F` against a fake API that trims every page) does\nthis:\n\n| Function | Does |\n| --- | --- |\n| `KG(url, token_file)` | client with the bearer token read from the file |\n| `kg.get(path, **params)` | one call; raises on `status: error`, prints `warnings` |\n| `kg.get_all(path, **params)` | every row of a list endpoint, `offset += len(data)` until `page.total` |\n| `kg.evidence_all(edge_id)` | `\u002Fevidence\u002F{edge_id}` with every StudyResult, paged the same way |\n| `kg.resolve(q, category)` | `search_entities`, exact CURIE or symbol match only, else `LookupError` |\n| `coverage(env[, rows])` | `complete: n of total`, `trimmed: n of total (...)`, `partial: ...` or `top n` (search) |\n\nUse `get_all` \u002F `evidence_all` for anything you count or conclude from; when you keep a single\npage (a top-5 view), print `coverage(...)` with it so the answer says what it covers. The worked\nquestions start with:\n\n```python\nimport json\nimport os\nimport pathlib\nimport sys\n\nsys.path.insert(0, os.environ[\"VKB_SKILL_SCRIPTS\"])  # \u003Cskill folder>\u002Fscripts\nfrom vkb_client import KG, coverage\n\nkg = KG(os.environ[\"VISIONKB_API_URL\"], os.environ[\"VISIONKB_API_TOKEN_FILE\"])\nget, get_all, resolve = kg.get, kg.get_all, kg.resolve\nOUT = pathlib.Path(sys.argv[1])  # every response envelope is kept here, for the report\nOUT.mkdir(parents=True, exist_ok=True)\nSEQ = [0]\n\n\ndef save(name, env):\n    SEQ[0] += 1\n    (OUT \u002F f\"{SEQ[0]:02d}_{name}.json\").write_text(json.dumps(env, indent=1))\n\n\ndef show(rows, cols):\n    for r in rows:\n        print(\"  \" + \"  \".join(f\"{c}={r.get(c)}\" for c in cols))\n```\n\nThe same calls with curl and jq (these ran as written):\n\n```bash\nH=\"Authorization: Bearer $(cat \"$VISIONKB_API_TOKEN_FILE\")\"\ncurl -fsS \"$VISIONKB_API_URL\u002Fready\" >ready.json\ncurl -fsS -H \"$H\" \"$VISIONKB_API_URL\u002Fentities\u002Fsearch?q=LRAT&category=biolink:Gene&limit=3\" >search.json\ncurl -fsS -H \"$H\" \"$VISIONKB_API_URL\u002Fatlas\u002Fexpression?genes=LRAT&level=majorclass&limit=3\" >atlas.json\njq -c '{kg_release, ready: .data}' ready.json\njq -c '.kg_release, (.data[] | {id, symbol, match})' search.json\njq -c '.data[] | {dataset_id, dataset_version, group_label, pct_expressing, pseudobulk_cp10k}' atlas.json\n# one page only: say how much of the result it is (rows \u003C limit can mean trimmed, see warnings)\njq -c '{returned: (.data | length), page, warnings}' atlas.json\n# errors are envelopes too: no token -> 401; no anchor -> missing_anchor; absent predicate\ncurl -sS -o \u002Fdev\u002Fnull -w 'no token: HTTP %{http_code}\\n' \"$VISIONKB_API_URL\u002Frelease\"\ncurl -sS -H \"$H\" \"$VISIONKB_API_URL\u002Frelationships?predicate=biolink:expressed_in\" | jq -c '{status, error}'\ncurl -sS -H \"$H\" \"$VISIONKB_API_URL\u002Frelationships?subject=HGNC:6685&predicate=biolink:treats\" | jq -c '.error'\n```\n\nWhat came back: `ready` with `neo4j`, `summaries` and `postgres` all `ok` and the release id;\n`LRAT` resolved to `HGNC:6685` (`exact_symbol`) with `LRATD1` and `LRATD2` as `fulltext` hits; the\ntop three LRAT rows across all atlases were RPE groups of `ds-rpechoroid-scrna`, `ds-hrca-snrna`\nand `ds-rpechoroid-snrna`; no token gave HTTP 401; `\u002Frelationships` without an anchor gave\n`missing_anchor`.\n\nThe `{returned, page, warnings}` line is the same check for one curl page; here it gave\n`returned: 3` with `limit: 3`, `total: 132` and no warning, i.e. a partial page by `limit`, not a\ntrimmed one.\n\n## 3. What is in the graph, and what each field means\n\n| Source | Edges | `knowledge_level` | `agent_type` | `primary_knowledge_source` |\n| --- | --- | --- | --- | --- |\n| HECA atlas summaries | `expressed_in` (gene -> cell type or state) | `observation` | `data_analysis_pipeline` | `infores:visionkb-heca` |\n| RetiGene curated haploinsufficiency review | `causes`, `gene_associated_with_condition` (gene -> disease), `has_phenotype` (gene -> HPO) | `knowledge_assertion` | `manual_validation_of_automated_agent` | `infores:visionkb-retigene` |\n| CL, UBERON, MONDO, HPO | `subclass_of`, `part_of` | `knowledge_assertion` | `manual_agent` | `infores:cl`, ... |\n\n`knowledge_level` is what keeps observations apart from claims: an `expressed_in` edge says \"this\ntranscript was measured in these cells of this atlas\", nothing about function; a\n`causes` or `gene_associated_with_condition` edge is a curated statement backed by publications\n(with a curator `grade` per StudyResult). Filter with\n`knowledge_level=` on `\u002Frelationships` and report the two kinds in separate paragraphs.\n\n**Evidence.** Each edge lists `has_study_results`; `GET \u002Fevidence\u002F{edge_id}` returns them. For\nexpression, one StudyResult per (dataset, level, group) with `n_cells`, `n_donors`,\n`pct_expressing`, `mean_log1p_cp10k`, `pseudobulk_cp10k`, `n_donors_expressing`, `method`; for\ncurated claims, `pmid`, `page`, `evidence_kind`, `grade` and a short `supporting_text` (lab\ncuration: do not quote it outside the lab).\n\n**What makes an `expressed_in` edge (VisionKB decision D18).** A (gene, dataset, group) becomes an\nedge, with a StudyResult, only if all of these hold:\n\n1. `pct_expressing >= 0.10` and `n_cells >= 20` in the group;\n2. `pseudobulk_cp10k >= 0.10 x` the gene's maximum over the groups of the same dataset and level\n   (specificity: removes low-level spill-over of very abundant transcripts);\n3. `n_donors_expressing >= 2` (a donor counts when >= 10 % of its cells in the group express the\n   gene). Atlases without donor labels would use 1-2 only, with flagged edges; all 13 atlases of\n   `visionkb-2026.11.0` have donor labels.\n\nEdges exist at two levels, `majorclass` and `celltype` (CL class, or a `visionkb:cs-\u003Cdataset>-\u003Clabel>`\nCellState that is `subclass_of` a CL class). **Region x major class numbers are only in the\nParquet summaries** (`\u002Fatlas\u002Fexpression?level=region_majorclass`); there are no regional edges.\n\n**Absence of an edge is not evidence of non-expression.** The graph keeps only the rows that pass\nthe rule above. Before saying \"X is not expressed in Z\", read the atlas rows\n(`\u002Fatlas\u002Fexpression`, all genes x groups, no threshold) and report `pct_expressing`,\n`pseudobulk_cp10k` and donor support. Also check that the gene and group exist in that dataset:\na gene missing from the summaries comes back as no rows plus the warning\n`\u003Cgene>: not found in the expression summaries`, not as zeros.\n\n**Ambient RNA in snRNA.** Very abundant transcripts leak into other nuclei. In the HRCA snRNA\natlas, RHO is detected in 17-28 % of amacrine, bipolar, cone and Müller-glia nuclei at 3-9 % of\nthe rod pseudobulk (section 4.2). Rule 2 removes those edges, but the atlas rows still show\nthem: a rod gene at 0.1-0.3 `pct_expressing` in a non-rod class is contamination until shown\notherwise (for example by specific expression in an scRNA atlas or by another method). Say so\nwhenever you report such a row.\n\n**Doublet programs in small subtypes (known issue KI-1).** Small subtypes of one class can carry\nthe program of another, abundant class (rod genes in amacrine subtypes in `visionkb-2026.11.0`).\nThose groups pass all three rules and get edges. For a gene that marks one major class strongly,\nread the major-class rows first and treat edges to small subtypes of a different class as\npossible contamination (section 4.2 shows how to check every edge).\n\n## 4. A knowledge answer (Route A) in about six calls\n\n1. `GET \u002Frelease`: `kg_release`, atlases and versions, predicates present.\n2. `GET \u002Fentities\u002Fsearch?q=...`: exact CURIE \u002F symbol match only (synonym or full-text hits need\n   checking).\n3. `GET \u002Fatlas\u002Fexpression?genes=...&level=majorclass|celltype` (add `dataset=` to stay in one atlas).\n4. `GET \u002Frelationships?subject=\u003CCURIE>&predicate=...` (or `knowledge_level=`).\n5. `GET \u002Fevidence\u002F{edge_id}` for the edges you cite.\n6. `GET \u002Fdatasets?entities=...|tissue=...` when the next step is an analysis.\n\nThe parameters of the worked questions below:\n\n```python\nQ1_GENE = os.environ.get(\"Q1_GENE\", \"LRAT\")\nQ1_DATASET = os.environ.get(\"Q1_DATASET\", \"visionkb:ds-hrca-snrna\")\nQ2_GENE = os.environ.get(\"Q2_GENE\", \"RHO\")\nQ3_GENE = os.environ.get(\"Q3_GENE\", \"PRPF31\")\n```\n\n### 4.0 Which release am I querying?\n\n```python\nrel = get(\"\u002Frelease\")\nsave(\"release\", rel)\nprint(\"kg_release:\", rel[\"kg_release\"], \"| biolink\", rel[\"data\"][\"biolink_version\"])\nprint(\"predicates:\", rel[\"data\"].get(\"predicates_in_graph\"))\nprint(\"edges by predicate:\", rel[\"data\"][\"counts\"][\"edges_by_predicate\"])\nfor a in rel[\"data\"][\"atlases\"]:\n    print(\"  atlas\", a[\"dataset_id\"], a[\"atlas_version\"])\nexpect = os.environ.get(\"VISIONKB_EXPECT_RELEASE\")\nassert expect is None or rel[\"kg_release\"] == expect, (rel[\"kg_release\"], expect)\n```\n\nThe run printed `visionkb-2026.11.0`, the six predicates present (`causes`, `expressed_in`,\n`gene_associated_with_condition`, `has_phenotype`, `part_of`, `subclass_of`), the edge counts per\npredicate and the 13 atlases, all at `heca-2026.05`.\n\n**Known issues are not in `\u002Frelease`.** visionkb-api 0.1.1 does not return the manifest's\n`known_issues`; read `validation\u002Fknown_issues.json` (or the Known issues section of\n`validation\u002Freport.md`) of the release bundle, or ask the operator. For `visionkb-2026.11.0` it\nholds KI-1 (section 3).\n\n### 4.1 In which classes and cell types is LRAT expressed? (expression, observation)\n\n```python\nprint(f\"\\n# Q1 {Q1_GENE}: expression by class and cell type\")\ngene, hits = resolve(Q1_GENE)\nsave(\"q1_search\", hits)\nprint(\"  search:\", coverage(hits))\nshow(hits[\"data\"], [\"id\", \"symbol\", \"name\", \"match\"])\n\nedges = get_all(\"\u002Frelationships\", subject=gene, predicate=\"biolink:expressed_in\", limit=200)\nsave(\"q1_expressed_in_edges\", edges)\nprint(\"  expressed_in edges (all atlases):\", coverage(edges))\nfor e in edges[\"data\"][:8]:\n    print(\"   \", e[\"object\"][\"id\"], e[\"object\"][\"name\"], e[\"qualifiers\"], e[\"summary\"])\n# an edge aggregates atlases: its StudyResults say which (dataset, level, group) support it\nedge_groups = set()\nfor e in edges[\"data\"]:\n    for sr in kg.evidence_all(e[\"edge_id\"], limit=200)[\"data\"][\"study_results\"]:\n        edge_groups.add((sr[\"dataset_id\"], sr[\"level\"], sr[\"group_label\"]))\n\nfor level in (\"majorclass\", \"celltype\"):\n    ex = get_all(\"\u002Fatlas\u002Fexpression\", genes=gene, dataset=Q1_DATASET, level=level, limit=200)\n    save(f\"q1_atlas_{level}\", ex)\n    top_cp10k = ex[\"data\"][0][\"pseudobulk_cp10k\"]  # rows are sorted by pseudobulk_cp10k\n    print(f\"  atlas {level}:\", coverage(ex), \"| rule a\u002Fb\u002Fc as in D18\")\n    for r in ex[\"data\"][:5]:\n        a = r[\"pct_expressing\"] >= 0.10 and r[\"n_cells\"] >= 20\n        b = r[\"pseudobulk_cp10k\"] >= 0.10 * top_cp10k\n        c = r[\"n_donors_expressing\"] >= 2\n        print(\n            f\"   {r['group_label']} {r['cell_type_id']} n_cells={r['n_cells']} \"\n            f\"pct={r['pct_expressing']} cp10k={r['pseudobulk_cp10k']} \"\n            f\"donors={r['n_donors_expressing']}\u002F{r['n_donors']} a={a} b={b} c={c} \"\n            f\"edge={(Q1_DATASET, level, r['group_label']) in edge_groups}\"\n        )\n\nreg = get(\"\u002Fatlas\u002Fexpression\", genes=gene, dataset=Q1_DATASET, level=\"region_majorclass\", limit=5)\nsave(\"q1_atlas_region_majorclass\", reg)\nprint(\"  atlas region_majorclass (Parquet only, no KG edges):\", coverage(reg))\nshow(reg[\"data\"], [\"group_label\", \"region\", \"pct_expressing\", \"pseudobulk_cp10k\"])\n\nif edges[\"data\"]:\n    ev = get(f\"\u002Fevidence\u002F{edges['data'][0]['edge_id']}\", limit=10)  # first page only\n    save(\"q1_evidence_top_edge\", ev)\n    srs = ev[\"data\"][\"study_results\"]\n    print(\"  evidence:\", ev[\"data\"][\"edge\"][\"object\"][\"id\"], coverage(ev, srs))\n    cols = [\"dataset_id\", \"atlas_version\", \"level\", \"group_label\", \"n_donors_expressing\", \"method\"]\n    show(srs, cols)\n```\n\nWhat the run showed (HRCA snRNA, 3,177,310 nuclei, `heca-2026.05`):\n\n- `LRAT` -> `HGNC:6685` (`exact_symbol`). 28 `expressed_in` edges over all atlases: RPE (CL and\n  dataset-specific RPE states), melanocytes, Schwann cells and one reactive Müller-glia state\n  (`MG_reactive`). Edges\n  to the same cell type with different `anatomical_context_qualifier` (retina vs RPE\u002Fchoroid) are\n  separate edges.\n- Major class: RPE is the top group (about three quarters of nuclei, 23 of 24 donors); it passes\n  rules a, b and c and has an edge. Müller glia come second at about 7 % of nuclei and 4 % of the\n  RPE pseudobulk, with 21 of 100 donors: rules a and b fail, so **no edge, but the gene is\n  detected**. Report it as low-level detection, not as absence.\n- Cell type: amacrine subtype HAC39 has about 24 % of nuclei expressing and 73 donors, so it\n  passes a and c, but fails b (under 10 % of the RPE pseudobulk): no edge.\n- Region x major class: 30 rows (the code keeps the top 5 and says `partial: 5 of 30`), only in the Parquet (RPE pseudobulk is similar in fovea, macula and\n  periphery). There are no regional edges to query.\n- The evidence of the top RPE edge lists three StudyResults, each with dataset, atlas version,\n  level, group and the D18 `method` string.\n\n### 4.2 Which major class shows the highest RHO? (ranking, ambient RNA)\n\n```python\nprint(f\"\\n# Q2 {Q2_GENE}: top major class per atlas, then every edge checked against it\")\nrho, _ = resolve(Q2_GENE)\ntop = get_all(\"\u002Fatlas\u002Fexpression\", genes=rho, level=\"majorclass\", limit=200)\nsave(\"q2_atlas_majorclass_all_datasets\", top)\nby_ds = {}\nfor r in top[\"data\"]:  # sorted by pseudobulk_cp10k over all atlases\n    by_ds.setdefault(r[\"dataset_id\"], []).append(r)\ntop_class = {ds: rows[0][\"cell_type_id\"] for ds, rows in by_ds.items()}\nfor ds, rows in by_ds.items():\n    detected = [r[\"group_label\"] for r in rows if r[\"pct_expressing\"] >= 0.10]\n    print(f\"  {ds}: top {rows[0]['group_label']}; groups with pct>=0.10: {detected}\")\n    show(rows[:3], [\"group_label\", \"n_cells\", \"pct_expressing\", \"pseudobulk_cp10k\"])\n\n# Majorclass first, then each edge's StudyResults: support from a group of ANOTHER class than the\n# atlas's top class (a small subtype, or a non-rod class in snRNA) is possible contamination\n# (doublets or ambient RNA), not expression. Known issue KI-1 of visionkb-2026.11.0.\nrho_edges = get_all(\"\u002Frelationships\", subject=rho, predicate=\"biolink:expressed_in\", limit=200)\nsave(\"q2_expressed_in_edges\", rho_edges)\nprint(f\"  expressed_in edges for {Q2_GENE}:\", coverage(rho_edges))\nfor e in rho_edges[\"data\"]:\n    o = e[\"object\"][\"id\"]\n    parents = get_all(\"\u002Frelationships\", subject=o, predicate=\"biolink:subclass_of\", limit=50)[\n        \"data\"\n    ]\n    parent_ids = [x[\"object\"][\"id\"] for x in parents]\n    for sr in kg.evidence_all(e[\"edge_id\"], limit=200)[\"data\"][\"study_results\"]:\n        tc = top_class[sr[\"dataset_id\"]]\n        flag = \"\" if tc in (o, *parent_ids) else \"  \u003C- not the top class: check\"\n        print(\n            f\"   {o} ({e['object']['name']}) parent={parent_ids} | {sr['dataset_id']} \"\n            f\"{sr['level']} \"\n            f\"{sr['group_label']} n_cells={sr['n_cells']} pct={sr['pct_expressing']} \"\n            f\"cp10k={sr['pseudobulk_cp10k']} donors={sr['n_donors_expressing']}{flag}\"\n        )\n```\n\nWhat the run showed:\n\n- Major class: Rod is the top class in both HRCA atlases (snRNA: about 91 % of 1,066,056 rod\n  nuclei, 103 donors). In HRCA snRNA, RHO is also detected in at least 10 % of nuclei of **every**\n  other major class (AC 17 %, BC, Cone and MG 26-28 %) at 3-9 % of the rod pseudobulk, which is\n  the ambient-RNA signature; rule b removes those major-class edges. Microglia, astrocyte and RPE\n  sit just above the threshold (10-12 % of the rod level) and keep edges: treat them as\n  unresolved (ambient RNA, or phagocytosed outer segments) unless another atlas or method\n  supports them.\n- 20 edges in total. Besides Rod: 14 amacrine subtypes of HRCA snRNA (39 to 1,057 nuclei each)\n  with 40-84 % of nuclei expressing at 11-28 % of the rod pseudobulk, and the bipolar type OFFx.\n  Twelve of those subtypes plus SEG* are exactly the 13 rod-program groups of **KI-1**; VG3* and\n  OFFx are not listed there but follow the same pattern.\n- ONONH snRNA has no rods; its top class for RHO is MG at about 10 % of nuclei and 0.3 CP10k, so\n  the within-atlas rule keeps an edge there. Compare with the gene's home class in other atlases\n  (15.8 CP10k in HRCA snRNA rods) before calling it expression.\n\n**Known issue KI-1 of `visionkb-2026.11.0` (decision D19).** Several small HRCA snRNA amacrine\nsubtypes (for example HAC79, HAC82, HAC89, AII*) carry a rod transcript program (KI-1 median\nratios to the rod level 0.14-0.25 for those four, with PDE6A, SAG, CNGB1 and PDE6G as examples;\nRHO at 11-28 % of the rod level in the run above), most likely rod-amacrine doublets. Their\n`expressed_in` edges to rod genes are real rows of the summaries but probably not expression.\nFor photoreceptor genes, and generally any gene that is a strong marker of another major class:\nread the major-class rows first, then treat edges to small subtypes of a different class as\npossible contamination and cite KI-1. No edge is flagged or removed in this release; a\ncontamination QC flag is planned for `visionkb-2026.11.1`.\n\n### 4.3 Which diseases are associated with PRPF31, with PMIDs? (curated claims)\n\n```python\nprint(f\"\\n# Q3 {Q3_GENE}: disease edges (curated claims) and their evidence\")\ng3, _ = resolve(Q3_GENE)\nallrel = get_all(\"\u002Frelationships\", subject=g3, limit=200)\nsave(\"q3_all_edges\", allrel)\nlevels = {}\nfor e in allrel[\"data\"]:\n    k = (e[\"predicate\"], e[\"knowledge_level\"], e[\"primary_knowledge_source\"])\n    levels[k] = levels.get(k, 0) + 1\nfor k, n in sorted(levels.items()):\n    print(\"  \", *k, n)\ndis = get_all(\"\u002Frelationships\", subject=g3, object_category=\"biolink:Disease\", limit=50)\nsave(\"q3_disease_edges\", dis)\nprint(\"  edges to diseases:\", coverage(dis))\nfor e in dis[\"data\"]:\n    o = e[\"object\"]\n    print(\"   \", e[\"predicate\"], o[\"id\"], o[\"name\"], e[\"knowledge_level\"], e[\"agent_type\"])\n    pubs = e[\"publications\"]  # at most 5 here; n_publications is the full count\n    print(\"     \", e[\"primary_knowledge_source\"], pubs, f\"({len(pubs)} of {e['n_publications']})\")\nif dis[\"data\"]:\n    ev3 = kg.evidence_all(dis[\"data\"][0][\"edge_id\"], limit=200)\n    save(\"q3_evidence\", ev3)\n    print(\"  evidence:\", coverage(ev3, ev3[\"data\"][\"study_results\"]))\n    print(\"  publications:\", ev3[\"data\"][\"publications\"])\n    show(ev3[\"data\"][\"study_results\"], [\"id\", \"pmid\", \"grade\"])\n    gs = get_all(\n        \"\u002Fgene-sets\", entity=dis[\"data\"][0][\"object\"][\"id\"], kind=\"disease_genes\", limit=50\n    )\n    save(\"q3_gene_set_disease\", gs)\n    print(f\"  genes associated with {dis['data'][0]['object']['id']}:\", coverage(gs))\n    show(gs[\"data\"], [\"gene_id\", \"symbol\", \"score\"])\n```\n\nWhat the run showed:\n\n- 201 edges from `PRPF31` (`HGNC:15446`): 200 `expressed_in` (observation, `infores:visionkb-heca`)\n  and 1 curated claim.\n- The claim is `biolink:causes` -> `MONDO:0019200` retinitis pigmentosa, `knowledge_assertion`,\n  `manual_validation_of_automated_agent`, `infores:visionkb-retigene`. The edge lists 5 PMIDs (the\n  relationship view is capped at 5); its evidence has 12 StudyResults with 8 distinct PMIDs\n  (`PMID:12714658`, `18450588`, `20232351`, `24419317`, `33576794`, `36672815`, `37809982`,\n  `40674075`), each with the curator `grade`.\n- `\u002Fgene-sets` for retinitis pigmentosa returned 3 genes (PRPF31, PRPF4, RP1).\n\nThe curated claims come from one source, a haploinsufficiency review: 22 gene-disease or\ngene-phenotype edges in this release (`causes`, `gene_associated_with_condition`,\n`has_phenotype`). **A missing disease edge says nothing about the gene**; say \"not in the curated\nsource of this release\". Use `object_category=biolink:Disease` (or `biolink:PhenotypicFeature`\nfor HPO) rather than one predicate, since the curated predicates differ by claim.\n\n### 4.4 Which atlases can I attach for RPE, or for retina? (datasets, bind records)\n\n```python\nprint(\"\\n# Q4 datasets with bind records\")\nrpe = get(\"\u002Fentities\u002Fsearch\", q=\"retinal pigment epithelial cell\", category=\"biolink:Cell\", limit=3)\nsave(\"q4_search_rpe\", rpe)\nprint(\"  search:\", coverage(rpe))\nshow(rpe[\"data\"], [\"id\", \"name\", \"match\"])\nrpe_id = next(h[\"id\"] for h in rpe[\"data\"] if h[\"name\"] == \"retinal pigment epithelial cell\")\nfor label, params in (\n    (\"rpe_cells\", {\"entities\": rpe_id}),\n    (\"retina\", {\"tissue\": \"UBERON:0000966\"}),\n):\n    ds = get_all(\"\u002Fdatasets\", limit=50, **params)\n    save(f\"q4_datasets_{label}\", ds)\n    print(f\"  {label} datasets:\", coverage(ds))\n    for d in ds[\"data\"]:\n        bind = {k: v for k, v in d[\"bind\"].items() if k != \"path\"}  # path = HPC-side h5ad path\n        print(\"   \", d[\"id\"], d[\"version\"], d[\"assay\"], d[\"n_cells\"], d[\"access_level\"], bind)\n\nprint(\"\\ndone:\", SEQ[0], \"responses saved in\", OUT)\n```\n\nWhat the run showed:\n\n- `retinal pigment epithelial cell` resolved by full text to `CL:0002586` (checked by name).\n- 5 datasets have RPE cells: HRCA scRNA and snRNA, ONONH snRNA, RPE\u002Fchoroid scRNA and snRNA\n  (`matched` says why; for the last three it also lists the dataset-specific RPE cell states\n  under `via`). All are\n  `heca-2026.05`, `access_level: lab`.\n- `tissue=UBERON:0000966` (retina) returned the two HRCA atlases.\n- Each record carries `bind = {name, path, role: \"reference\"}`. `path` is the HPC-side `.h5ad`\n  path for an analysis job (AiScientist attaches it); the API never opens it, and the code above\n  leaves it out of the printout. Never publish it.\n\n## 5. The same with the MCP server\n\nThe `visionkb-kg` MCP server (from [aiscientist-mcp](https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-mcp))\nhas one tool per endpoint, with the query parameters as arguments (names as specified for the\nserver): `get_release`,\n`search_entities`, `get_relationships`, `get_evidence`, `get_gene_set`, `query_atlas_expression`,\n`find_datasets`. The mapping is in [references\u002Fmcp-tools.md](references\u002Fmcp-tools.md). This\nskill's runs used the HTTP API only.\n\n## 6. Validate before answering\n\n1. **Release.** Every envelope has the same `kg_release` as `\u002Frelease`. Mixing releases in one\n   answer is an error.\n2. **Resolution.** `match` is `exact_id` or `exact_symbol`. A `synonym` or `fulltext` hit must be\n   checked by name; HGNC previous symbols and aliases are synonyms here.\n3. **Warnings.** Read them: \"not found in the expression summaries\", \"matches N genes\",\n   deprecated predicates, and lower-than-graph thresholds all arrive as warnings.\n4. **Paging.** `page.total` larger than the rows you read means you have not seen everything\n   (search returns ranked top-k with `total: null`).\n5. **Donor support.** A high `pct_expressing` with `n_donors_expressing` of 0-1 is weak; say so.\n6. **Ambient RNA, doublets and absence.** As in section 3: no edge does not mean no expression;\n   abundant transcripts in snRNA leak into other classes; edges to small subtypes of another\n   class may be doublet programs. Check the release's known issues (KI-1 in `visionkb-2026.11.0`).\n7. **Access level.** HECA datasets are `access_level: lab` until published; do not send their rows\n   outside the lab.\n\n## 7. Report\n\n- `kg_release`, and for every expression number the `dataset_id` and `dataset_version`;\n- each entity with its CURIE and how it was resolved;\n- expression (observation) and curated claims (knowledge_assertion) in separate paragraphs, each\n  claim with `primary_knowledge_source` and PMIDs;\n- for expression: level, group, `pct_expressing`, `pseudobulk_cp10k`, `n_donors_expressing` \u002F\n  `n_donors`; the ambient-RNA, doublet (known issue id) and absence caveats where they apply;\n- for datasets: id, version, assay, cell count, `access_level` and the `bind` record;\n- what was not checked (e.g. other atlases, other levels, pages not read).\n\n## Troubleshooting\n\nHTTP 401, `missing_anchor`, truncated lists, a proxy setting that breaks httpx, and a Neo4j store\nthat loads fewer nodes than the manifest: see [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":35},{"tags":25,"author":12,"status":26,"compute":27,"version":28,"category":29,"scheduler":30,"tested-with":31,"requires-gpu":32,"requires-network":33,"requires-secrets":34},"knowledge-graph, biolink, gene-expression, retina, eye, cell-atlas, disease-genes, provenance, rest-api, mcp","community","none on the client: the four worked questions (roughly 100 HTTP requests, most of them evidence lookups) took 8-18 s wall (four runs) against a stack on the same node; the server stack used 4 GB Neo4j heap and 8 GB page cache","0.0.1","knowledge-graph","none","visionkb-api 0.1.1 (image digest sha256:5d956d03...), visionkb-deploy 0.1.1, KG release visionkb-2026.11.0, Neo4j 2026.10.1 Community, PostgreSQL 17.11, httpx 0.28.1, Python 3.13.18, curl 8.23.0, jq 1.8.2","false","runtime","VISIONKB_API_TOKEN_FILE","Needs network access to a running VisionKB API (visionkb-api 0.1.1 or later, deployed with visionkb-deploy) and a read token in a file; Python 3.11+ with httpx (scripts\u002Fvkb_client.py), or curl and jq. No local compute, no atlas files, no scheduler.","main","5c42aa74b19348cb68aa35301eba042a737d94d4","skills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg",2,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills","https:\u002F\u002Fgithub.com\u002Flijinbio","2026-11-14 05:44:08",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add lijinbio\u002Faiscientist-skills --skill answer-eye-questions-with-visionkb-kg",{"tool":49,"command":50},"bunx","bunx skills add lijinbio\u002Faiscientist-skills --skill answer-eye-questions-with-visionkb-kg",{"tool":52,"command":53},"pnpm","pnpm dlx skills add lijinbio\u002Faiscientist-skills --skill answer-eye-questions-with-visionkb-kg","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002FSKILL.md",true,[57,63,67,73],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fmcp-tools.md","REFERENCE","参考文档",1029,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002Freferences\u002Fmcp-tools.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Ftroubleshooting.md",1117,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002Freferences\u002Ftroubleshooting.md",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"scripts\u002Fvkb_client.py","SCRIPT","脚本",4110,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002Fscripts\u002Fvkb_client.py",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"tests\u002Ftest_vkb_client.py",4744,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fknowledge-graph\u002Fanswer-eye-questions-with-visionkb-kg\u002Ftests\u002Ftest_vkb_client.py",[78,85,92,99,106,113],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DKZPCPYM78N1R0MVAVVYKT","verb-object-with-tool","One or two sentences on what the skill does and when to use it. Name the tool, the input it takes and the output it produces, then list the situations that should trigger it (for example \"Use when setting up X, writing a Y config, or diagnosing a failed Z run\").","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Ftemplate\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DKZCJMFJJB9ZH9YGCSQHR5","write-variant-tables","Write the five standard variant-annotation result tables - consequence, impact and ClinVar-significance distributions, a ClinVar pathogenic and likely-pathogenic list, and a shortlist of rare, damaging variants not in ClinVar - plus a JSON summary, from an annotated per-variant TSV (VEP consequence and impact, SIFT, PolyPhen, max population AF, rsID, ClinVar significance), in pure Python without re-parsing the VCF or re-running VEP. Use when a study needs these tables with a different rarity cutoff, impact set or damaging-predictor rule, or when rebuilding them from an existing annotation table. In AiScientist, annotate_variants already writes the default tables, so use this only for a custom cut.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fwrite-variant-tables\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DKZ3R4E6JEJT3YB6AHXE60","rank-phenotype-differentials-with-mcp","Map clinical phenotype text to grounded HPO terms and rank a research differential through an already configured phenotype-diagnosis MCP service with LIRICAL and optional literature adjudication. Use for explicit service-based analysis while preserving negation, uncertainty and original probabilities; retain the established workflow when the service is unavailable.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Frank-phenotype-differentials-with-mcp\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DKYS9R4F5EPCMDHSH3TEZ7","qc-vcf-callset","Judge whether a germline VCF callset is trustworthy before interpreting any variant - Ti\u002FTv, Het\u002FHom, SNP, indel and multiallelic counts, sample count and genotype call rate from bcftools stats (falling back to cyvcf2, then to a plain-Python Ti\u002FTv scan) - and flag values outside the expected human WGS or WES ranges. Writes tables\u002Fvcf_qc_summary.csv and data\u002Fvcf_qc.json with a qc_flags list. Use when a VCF (one sample or a cohort) arrives for annotation or prioritization, when a Ti\u002FTv or Het\u002FHom value needs interpreting, or when deciding whether downstream variant tables must carry a low-confidence caveat.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fqc-vcf-callset\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7DKYDRBFTBS2J58QMB7SMHK","prioritize-clinical-variants","Rank annotated variants into research-triage tiers (ClinVar pathogenic, likely pathogenic, VUS favouring pathogenic, VUS, likely benign, benign) from ClinVar significance used verbatim, gnomAD allele frequency against a dominant or recessive disease-model cutoff and the ACMG BA1 5 percent rule, and in-silico predictors (SIFT, PolyPhen, REVEL, CADD, AlphaMissense) as supporting evidence only. Pure Python; reads a per-variant annotation TSV and writes a tier-sorted CSV with the evidence for each tier plus a JSON of tier counts. Use when a rare-variant list from VEP, ClinVar and gnomAD annotation must be ordered for review (which variants to look at first) or when choosing the disease model and cutoffs for that ordering. Research triage only, NOT a clinical ACMG\u002FAMP classification.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fprioritize-clinical-variants\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7DKY2XPCQ2S639KTPSAJ170","normalize-vcf-with-bcftools","Normalize a VCF with bcftools norm before annotation or ClinVar\u002FgnomAD matching - split multiallelic sites into biallelic records, atomize MNPs into SNPs, then left-align and trim indels against the reference FASTA of the same build - writing an indexed normalized.vcf.gz and a JSON of record counts before and after. Use when a VCF not known to be normalized (especially an indel-heavy one) will be matched against ClinVar, gnomAD or dbSNP, compared between callers or loaded into PLINK, or when a known pathogenic indel comes back as not in ClinVar. In AiScientist, the offline annotate_variants path already normalizes, so do not plan it as a separate step there.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fnormalize-vcf-with-bcftools\u002FSKILL.md",[],[]]