跳到正文
Skillpedia
分析与电子表格51k · #3532

primekg

它能做什么

这个代理可以在名为 PrimeKG 的数据库中搜索信息。它能找出基因、药物、疾病和性状之间的联系,并提供这些关系的详细信息。

适用场景

  • ✓当你想查看基因与疾病之间已知的联系时。
  • ✓当你想找出与某种特定疾病相关的药物时。
  • ✓当你想了解与某种医学状况相关的性状时。

技能链接

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/primekg/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/primekg/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“哪些基因与阿尔茨海默病相关?”

每周 5 个新技能,1 分钟读完。

工作原理

你提供一个关键词(比如某种疾病或基因名称),代理就会在 PrimeKG 数据库中搜索相关信息。它会返回直接联系,还会返回最多两步的关联路径,帮助你理解这些关系。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

PrimeKG Knowledge Graph

When to use

Use for reproducing PrimeKG analyses, resolving entities in a specific graph artifact, or exploring recorded gene, drug, disease, phenotype, anatomy, and pathway associations. A path supports a research hypothesis; it does not establish causality, treatment efficacy, a prescribing recommendation, or a diagnostic conclusion.

PrimeKG upstream now recommends OptimusKG for new work. This skill remains scoped to PrimeKG CSVs; the helper is not an OptimusKG client. Published PrimeKG integrates 20 resources, with approximately 129,000 nodes and 4.05 million undirected relationships. CSVs contain reverse rows, so row counts differ from distinct undirected relationship counts. Count the actual pinned artifact.

1. Pin and verify the input

The official dataset remained V2.1, published 2022-05-02, at the 2026-10-01 review. Its kg.csv has Dataverse file ID 6180620, size 981751236 bytes, and provider MD5 aac8191d4fbc5bf09cdf8c3c78b4e75f. The record declares CC0 1.0; upstream construction code is MIT. These are distinct from this skill's retained license declaration and from terms of individual source resources used in a rebuild.

Use the artifact and API reference to obtain metadata, verify the file checksum, or distinguish kg.csv, kg_grouped.csv, features, and PyTDC. The 2023 construction/OMIM updates in GitHub do not make the published 2022 artifact a 2023 dataset. Record DOI, version, filename, file ID, checksum, retrieval date, and any subset/rebuild steps with every result.

The helper makes no remote graph queries. Download the CSV deliberately after checking storage and RAM. This full-download example is illustrative; validation used small HTTP byte ranges and synthetic data, not the 982 MB file:

curl --fail --location --output kg.csv \
  'https://dataverse.harvard.edu/api/access/datafile/6180620'
export PRIMEKG_DATA="$PWD/kg.csv"

PRIMEKG_DATA is read when the module is imported; the default is data/PrimeKG/kg.csv. The module reads the whole CSV for each public query. low_memory parsing is not a bounded-memory graph engine. For many queries or limited RAM, build an indexed local store from the pinned file and validate its node keys, edge multiplicities, and counts.

2. Resolve a typed entity before traversal

Run from this skill's directory with pandas installed, so scripts.query_primekg is importable. The following is an illustrative real-data query; no disease result or ID is promised without inspecting the pinned file:

from scripts.query_primekg import search_nodes, get_neighbors

candidates = search_nodes("Alzheimer", node_type="disease", limit=None)
for node in candidates:
    print(node)  # id, type, name, source, and index when present

# Review the candidates and select the intended disease before calling:
# get_neighbors(selected["id"], node_type=selected["type"],
#               node_source=selected["source"])

Search is literal, case insensitive, and returns at most 20 matches by default; limit=None removes that cap. Preserve IDs as strings, including numeric-looking and underscore-joined IDs. Drug nodes use DrugBank identifiers; diseases can use MONDO or MONDO_grouped, including IDs joining multiple diseases. Do not invent EFO, ChEMBL, Wikidata, or prefixed MONDO IDs from labels. x_index/y_index are local release indexes, not ontology accessions and not stable across rebuilds.

The helper identifies a node by (id, type, source) and rejects ambiguous bare IDs or a key mapping to multiple release indexes. Supply node_type and node_source from the search result. Equal numeric IDs from different namespaces are different nodes.

3. Retrieve associations without losing their meaning

get_neighbors(node_id, relation_type=None, *, node_type=None, node_source=None) collects both stored orientations. Reverse rows are consolidated into one adjacency per neighboring identity/name, relation, and display_relation; all original rows remain in edge_rows. Extra CSV evidence columns and release indexes are preserved. Do not multiply evidence counts by the number of reverse copies.

Use exact stored relation names. Common published relations include:

relation Interpretation to retain

…

常见问题

什么是 PrimeKG?

PrimeKG 是一个大型数据库,整理了基因、药物、疾病和性状的信息,并展示它们之间的关系。

这个代理能告诉我某种治疗方法是否有效吗?

不能。代理只会展示数据库中记录的关联,无法确认治疗效果,也不能给出治疗建议。

我需要下载文件吗?

需要。使用这个代理前,你需要从 PrimeKG 数据库下载一个特定文件。代理不会实时搜索互联网。

详情

作者的原始描述

Queries a pinned Precision Medicine Knowledge Graph (PrimeKG) CSV for typed gene, drug, disease, and phenotype nodes, direct associations, disease context, and one- or two-hop paths. Use for PrimeKG reproducibility, biological association lookup, and hypothesis generation with relation and data provenance preserved.

repo: K-Dense-AI/scientific-agent-skills

热度

GitHub 星标
51k
排名
#3532
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能