원클릭으로
turingdb-graph
Build, query, and analyse biomedical knowledge graphs in TuringDB, a columnar graph database with git-like versioning.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Build, query, and analyse biomedical knowledge graphs in TuringDB, a columnar graph database with git-like versioning.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects. Calculates CRAP scores per method and surfaces risk hotspots — complex code with low coverage that is dangerous to modify. Use to diagnose why coverage is stuck or plateaued, identify what methods block improvement, or get project-wide coverage analysis with risk ranking. USE FOR: coverage stuck, coverage plateau, can't increase coverage, what's blocking coverage, coverage gap, CRAP scores, risk hotspots, where to add tests, coverage analysis, coverage report. DO NOT USE FOR: targeted single-method CRAP analysis (use crap-score); auditing test code for coverage-touching or other anti-patterns (use test-anti-patterns); writing tests; running tests (use run-tests). Requires or produces coverage (Cobertura) and CRAP metrics.
Role-based multi-agent orchestration framework for building "Crews" of collaborating LLM agents (each with a role, goal, backstory, and optional tools) that execute sequential or hierarchical task pipelines, plus event-driven "Flows" for precise, single-LLM-call orchestration. Use when composing specialized agents (e.g. a research agent + an analysis agent + a writer agent) into a declarative pipeline for complex multi-step tasks like automated literature review or multi-agent research workflows. Distinct from LangGraph's explicit state-machine graphs and smolagents' minimal tool-calling loop — CrewAI is standalone (no LangChain dependency) and expresses orchestration as roles and delegated tasks rather than a graph or a single ReAct loop.
Adapter, primer, and poly-A/T trimming for high-throughput sequencing reads (FASTQ/FASTA). Use for ATAC-seq (Nextera adapter removal), ChIP-seq/CUT&RUN, small RNA-seq (preserving reads as short as ~18 nt), and amplicon/primer trimming where exact or linked adapter sequences matter more than fastp's heuristic auto-detection. Covers 3'/5'/linked adapters, IUPAC wildcards, paired-end synchronization, quality/length filtering, and demultiplexing by barcode.
Data Version Control (DVC) for tracking large datasets/models with Git-like semantics, defining reproducible data/ML pipelines (dvc.yaml stages that only re-run when their inputs change), and lightweight experiment tracking without a server. Use when large files (VCF/BAM/FASTQ, reference genomes, model weights) can't go in Git, when you need Make/Snakemake-style selective re-execution driven by data, or when comparing many training runs locally before promoting one. Pairs with Git (code), cloud object storage (data), and Snakemake/Nextflow (compute graph).
Fast Python I/O for BigWig (continuous genome signal) and BigBed (interval annotation) files via libBigWig. Use for random-access signal queries at specific genomic coordinates (bw.values, bw.stats), computing per-region summary statistics (mean/max/coverage) over a BED file of regions, writing custom BigWig tracks from numpy arrays, and loading ChIP-seq/ATAC-seq/RNA-seq/methylation coverage tracks (e.g. produced by deeptools bamCoverage) into pandas/numpy for downstream analysis or ML feature extraction. Complements deeptools (which generates BigWig files) and chip-seq/atac-seq workflows.
Distributed Python compute with Ray — @ray.remote tasks/actors for cluster-scale parallelism, Ray Data for large-batch preprocessing, Ray Train for distributed model training (DDP/FSDP/DeepSpeed), Ray Tune for scalable hyperparameter search, and Ray Serve for model serving. Use when scaling a Python workload (docking screens, million-cell atlas preprocessing, hyperparameter sweeps, multi-GPU training) from a laptop to a multi-node cluster with minimal code changes. Ray Tune can use optuna as a search algorithm; Ray Train wraps pytorch-lightning-style training loops.
| name | turingdb-graph |
| description | Build, query, and analyse biomedical knowledge graphs in TuringDB, a columnar graph database with git-like versioning. |
| license | MIT |
| metadata | {"version":"0.1.0","author":"TuringDB <team@turingdb.ai>","domain":"graph-analytics","tags":["graph-database","knowledge-graph","turingdb","cypher","biomedical","patient-cohort","pathway"],"inputs":[{"name":"input_file","type":"file","format":["csv","tsv","gml","jsonl"],"description":"Graph source file for --build. CSV/TSV: one node per row (requires --node-label). GML: nodes become GMLNode. JSONL: typed nodes and edges (Neo4j APOC-compatible).","required":false},{"name":"cypher","type":"string","description":"Cypher query string for --query. TuringDB supports a subset of openCypher.","required":false},{"name":"graph","type":"string","description":"Name of the TuringDB graph to target.","required":false}],"outputs":[{"name":"report","type":"file","format":["md"],"description":"Human-readable markdown report (cohort analyses, query results, graph summaries)."},{"name":"summary","type":"file","format":["json"],"description":"Structured JSON summary (counts, stats, query results)."}],"dependencies":{"python":">=3.11","packages":["turingdb>=1.34","pandas>=2.0","fastapi>=0.110","uvicorn>=0.27","pydantic>=2.0","tabulate>=0.9"]},"demo_data":[{"path":"demo/cohort.csv","description":"20-row synthetic patient cohort (no PHI) with conditions, medications, doctors, hospitals."},{"path":"demo/pathway.gml","description":"~25-node synthetic pathway graph (glycolysis-style) with entity classes as labels."},{"path":"demo/antibody.csv","description":"15-row synthetic antibody-protein-publication graph (CiteAb-like)."}],"endpoints":{"cli":"python skills/turingdb-graph/turingdb_graph.py --demo cohort --out {output_dir}","http":"uvicorn http_server:app"},"openclaw":{"requires":{"bins":["python3"]},"always":false,"emoji":"🕸","homepage":"https://github.com/ClawBio/ClawBio","os":["darwin","linux"],"install":[{"kind":"pip","package":"turingdb","bins":["turingdb"]},{"kind":"pip","package":"pandas"},{"kind":"pip","package":"fastapi"},{"kind":"pip","package":"tabulate"}],"trigger_keywords":["knowledge graph","biomedical graph","turingdb","cypher query","patient cohort graph","pathway graph","graph database","build a graph from CSV","comorbidity analysis","comedication analysis"]}} |
You are TuringDB Graph, a specialised ClawBio agent for building, querying, and analysing biomedical knowledge graphs in TuringDB — a columnar graph database with git-like versioning.
Fire this skill when the user says any of:
Do NOT fire when:
CALL db.history(). The skill enforces safety rules (no PHI in logs, no graph overwrites, research-use disclaimer on every report).--build): ingest CSV/TSV/GML/JSONL into a named TuringDB graph with automatic numeric type wrapping and commit tracking.--query): run an arbitrary Cypher query against a graph and return results as Markdown, JSON, or TSV.--analyse-cohort): run a fixed set of descriptive clinical-cohort analyses (demographics, top conditions & medications, comorbidities, comedications) on a patient-centric graph.--demo): run an end-to-end example against one of three shipped synthetic datasets (cohort, pathway, antibody).One skill, four operations. This skill builds graphs, queries them, and runs descriptive cohort analytics. It does not perform statistical inference, vocabulary normalisation, or clinical decision support. For custom Cypher beyond the fixed analyses, point an agent at the reference/ docs.
| Format | Extension | Required Flags | Notes |
|---|---|---|---|
| CSV | .csv | --node-label | One node per row; columns become properties; integer/float columns auto-wrapped via toInteger()/toFloat() |
| TSV | .tsv | --node-label | Treated as CSV with tab separator |
| GML | .gml | — | All nodes become GMLNode, all edges GMLEdge, all properties strings. Properties stored with type suffix (e.g. displayName (String)) |
| JSONL | .jsonl | — | Typed labels and properties preserved (Neo4j APOC export-compatible) |
When the user asks to build and analyse a graph:
--host (default localhost:6666); auto-start the daemon if unreachable.LOAD CSV + CREATE, LOAD GML, or LOAD JSONL inside a versioned change.--analyse-cohort or --demo cohort): run 8 fixed Cypher queries for demographics, conditions, medications, comorbidities, and comedications; aggregate results in pandas.report.md + summary.json to the output directory. Every report ends with the ClawBio research disclaimer.Note for ClawBio reviewers: this skill uses mutually exclusive subcommand flags (
--build,--query,--analyse-cohort,--demo,--stop-server) rather than the standard--input/--outputpattern. This is because it handles four distinct operations that do not share a single input/output contract.--outserves the role of--output.
# Build a graph from CSV
python skills/turingdb-graph/turingdb_graph.py \
--build --input data.csv --graph my_graph --node-label PatientRow \
--out /tmp/build-output
# Build from GML
python skills/turingdb-graph/turingdb_graph.py \
--build --input pathway.gml --graph my_pathway --out /tmp/build-output
# Run a Cypher query
python skills/turingdb-graph/turingdb_graph.py \
--query --graph my_graph \
--cypher "MATCH (p:Patient)-[:HAS]->(c:MedicalCondition) RETURN p.displayName, c.displayName LIMIT 10" \
--out /tmp/query-output
# Analyse a patient cohort
python skills/turingdb-graph/turingdb_graph.py \
--analyse-cohort --graph my_graph --top-n 10 --out /tmp/analysis-output
# Run a demo (auto-starts TuringDB if needed)
python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo pathway --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo antibody --out /tmp/demo
# Stop the TuringDB daemon
python skills/turingdb-graph/turingdb_graph.py --stop-server
| Flag | Default | Description |
|---|---|---|
--host | http://localhost:6666 | TuringDB host URL |
--data-dir | ~/.turing | TuringDB data directory |
--no-auto-start | off | Fail fast if the server is not running |
--out | ./output | Output directory for reports |
python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo
Expected output: a patient-centric graph with 50 nodes (20 patients, 6 conditions, 7 medications, 4 doctors, 3 hospitals, 8 blood types, 2 genders) and 120 edges, plus a cohort analysis report showing demographics (ages 14-73, mean 48.6), top conditions (Hypertension: 6, Diabetes Type 2: 4), and top medications (Metformin: 4).
All three demos (cohort, pathway, antibody) use synthetic data with no PHI.
# Cohort analysis: `demo_cohort`
- **Patients**: 20
- **Ages** (n=20): min 14, max 73, mean 48.6, median 51.0
- **Under 18**: 3
- **Over 65**: 6
## Top 10 conditions
| condition | patients |
|---|---|
| Hypertension | 6 |
| Diabetes Type 2 | 4 |
| Arthritis | 3 |
| Asthma | 3 |
| Cancer | 2 |
| Migraine | 2 |
---
*ClawBio is a research and educational tool. Not a medical device.
This output must not be used for clinical decision-making.*
output_directory/
├── report.md # Markdown report (build summary, cohort analysis, or query results)
├── summary.json # Structured JSON (counts, stats, query metadata)
├── result.json # Query results as JSON (--query only)
├── result.tsv # Query results as TSV (--query only)
└── analysis/ # Subdirectory for cohort analysis (--demo cohort only)
├── report.md
└── summary.json
All cohort analyses run as fixed Cypher queries that return raw rows, with aggregation performed in pandas. This avoids TuringDB's current GROUP BY limitation and keeps the aggregation logic auditable in Python.
pd.to_numeric. Missing ages excluded, not imputed.MATCH (p:Patient)-[:HAS]->(c:MedicalCondition) returns (patient, condition) pairs; pandas groupby().nunique() counts distinct patients per condition.:TOOK_MEDICATION edges.min()/max() to avoid double-counting, then filtered to pairs co-occurring in >= 2 patients.WHERE p.age < 18 and WHERE p.age > 65.LOAD CSV values arrive as strings. The skill reads the first 200 rows with pandas dtype detection and wraps integer-like columns with toInteger() and float-like columns with toFloat() at ingest time.
TuringDB's LOAD GML stores properties with a type suffix: displayName becomes displayName (String). Access via backtick-escaped Cypher: n.`displayName (String)`.
Required:
turingdb >= 1.34; graph database engine (includes native daemon binary)pandas >= 2.0; data manipulation and cohort aggregationtabulate >= 0.9; DataFrame.to_markdown() renderingOptional (HTTP endpoint only):
fastapi >= 0.110; REST API wrapperuvicorn >= 0.27; ASGI serverpydantic >= 2.0; request validationLOAD GML, properties are stored as displayName (String), not displayName. You must use backtick-escaped access: n.`displayName (String)`. Forgetting this produces "Property type not found" errors.<. The < operator only works on numeric types. Pair deduplication (e.g. comorbidity pairs) must happen in Python, not in Cypher WHERE clauses.RETURN key, count(x) does not group correctly. Always return raw rows and aggregate in pandas with groupby().nunique().LOAD CSV + CREATE does not deduplicate. Each CSV row creates a new node unconditionally. TuringDB has no MERGE. Pre-dedupe in pandas if you need one-node-per-unique-value.CREATE/SET in new_change() ... CHANGE SUBMIT. This is the most common mistake when extending the skill.turingdb was upgraded but an old daemon is still running, LOAD CSV + CREATE and other features will fail. Stop the old daemon first: --stop-server.GROUP BY, string < comparison, and MERGE limitations against the latest changelog before relying on them, as any may have been fixed in a release since this skill was last updated.--query is the exception — it returns the user's own query results verbatim.demo/cohort.csv, demo/pathway.gml, demo/antibody.csv) are synthetic. No real names, no real medical records, no identifiable demographics.--build is additive, not destructive. Refuses to overwrite an existing graph. Pass a new --graph name or drop the existing one manually.--query is for trusted operators. It executes arbitrary Cypher. Do not expose the HTTP /query endpoint on an untrusted network without authentication.PascalCase (Patient, MedicalCondition, BloodType).UPPER_SNAKE_CASE (HAS, TOOK_MEDICATION, IS_TREATED_BY).camelCase (displayName, pubmedId).Every --build run executes inside a fresh TuringDB change. After load, the skill issues CHANGE SUBMIT and returns the resulting commit hash in the JSON summary. This makes every build auditable via CALL db.history().
The skill does not create indexes automatically. Users who repeatedly run --query against the same graph should create indexes manually — see reference/writing.md.
--build.--query.--analyse-cohort.http_server.py).The agent (LLM) dispatches this skill and interprets its outputs. It must not rewrite the cohort-analysis Cypher, invent new subcommands, or skip the safety disclaimer. For custom Cypher, point the agent at reference/querying.md, reference/writing.md, and reference/biomedical.md.
Trigger conditions: the orchestrator routes here when:
Chaining partners:
rnaseq-de: DE results (gene lists) can be loaded as JSONL nodes for pathway enrichment queriespubmed-summariser: antibody graph query results can feed into literature searchesclinical-variant-reporter: variant annotations could be loaded as graph nodes for network analysisLOAD GML property naming, or adds native MERGE/GROUP BY support.