opentargets-database▌
google-deepmind/science-skills · updated Jun 4, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
### Opentargets Database
- ›name: "opentargets-database"
- ›description: "Query Open Targets Platform for target-disease associations, drug target discovery, tractability/safety data, genetics/omics evidence, known drugs, for therapeutic target identification."
| name | opentargets-database |
| description | > Query Open Targets Platform for target-disease associations, drug target discovery, tractability/safety data, genetics/omics evidence, known drugs, for therapeutic target identification. |
Open Targets Database Skill
Overview
This skill provides access to the Open Targets Platform GraphQL API. It aggregates multi-modal evidence from genetics (GWAS/eQTL), pathways, animal models, and clinical trials to rank target-disease associations and identify druggable genes.
Prerequisites
uv: Read theuvskill and follow its Setup instructions to ensureuvis installed and on PATH.- User Notification: If LICENSE_NOTIFICATION.txt does not already exist in this skill directory then (1) prominently notify the user to check the terms at https://platform-docs.opentargets.org/licence, then (2) create the file recording the notification text and timestamp.
Core Rules
- Use the Wrapper: ALWAYS execute the provided helper scripts to query the database rather than accessing the database directly. The scripts automatically enforce fair use and implement retry logic.
- Output Flag: The
--outputflag is always required as output can be very large. Usejqor write your own code to process this JSON file. - Notification: If this skill is used, ensure this is mentioned in the output.
Quick Reference
Always use the provided Python script scripts/query_opentargets.py to quickly
query the database. It handles API communication, retries, formatting, and
automatically truncates overly large responses. NEVER write your own curl or
similar requests.
Usage:
uv run scripts/query_opentargets.py --output /tmp/opentargets_results.json [OPTIONS] COMMAND [ARGS]...
Common Options:
--output PATH: Required. Path to write the JSON output file.--limit N: Limit the number of items returned in arrays (default is 50). Use a smaller number like 10 when doing preliminary exploration.--page-size N: Set the API pagination size (default is 200). Increase if you need more results (e.g., a study with many credible sets).
Available Commands:
get-gwas-studiesefo_id: Fetches all GWAS studies associated with a specific disease ontology EFO ID (e.g.EFO_0000685).get-study-credible-setsstudy_id: Fetches all credible sets for a given study ID (e.g.FINNGEN_R12_RX_CROHN_2NDLINE). Returns confidence, finemapping method, variant, and p-value info.get-qtl-credible-setsvariant_id: Retrieves QTL credible sets for a specific variant ID (e.g.19_44908822_C_T).get-l2gvariant_id [--study-id ID]: Returns Locus-to-Gene (L2G) predictions/scores for a locus to identify the most likely causal gene. Onlyvariant_idis required; use--study-idto filter to a specific study. Acceptschrprefix (e.g.chr1_113834946_A_G).get-target-druggabilityensembl_id: Provides tractability data (small molecule, antibody, etc.) and clinical trial safety info for a gene/target.get-associated-targetsefo_id: Find all target genes associated with a specific disease EFO ID.get-associated-diseasesensembl_id: Find all diseases associated with a specific target Ensembl ID.search-diseasequery_string: Search for a disease by name to find its EFO ID and other metadata.get-credible-sets-near-targetensembl_id [--window N]: Fetches credible sets for a target and filters them to those within a genomic window around the target. Useful for finding variants "nearby" a gene.custom-queryquery [--variables '{}']: Run a raw GraphQL query for any other Open Targets data.
L2G Query Usage
The get-l2g command has two modes:
- Variant only (
get-l2g <variant_id>): Returns L2G predictions from all credible sets across all studies where that variant is the lead variant. This can return a large number of results (e.g., hundreds). Use this when the user wants a broad view of which gene is most likely causal at a locus, or when no specific study is mentioned. - Variant + study (
get-l2g <variant_id> --study-id <study_id>): Returns L2G predictions only for credible sets from that specific study. Use this when the user asks about a specific GWAS study or when you need to narrow down the results.
Incomplete results warning: The variant-only mode can return hundreds of credible sets. The default
--page-sizeis 200, so if the API reports acounthigher than the number ofrowsreturned, you are seeing incomplete results. Always comparecountto the actual number of rows. If they differ, either increase--page-sizeor inform the user that only a subset was retrieved.
Querying by Region
To find studies with variants "nearby" a gene, use
get-credible-sets-near-target, which improves upon the base API by performing
a flexible search based on genomic position: uv run scripts/query_opentargets.py --output /tmp/results.json get-credible-sets-near-target ENSG00000156515 --window 500000
Note that the Open Targets GraphQL schema includes a regions parameter for
credibleSets, however it performs an exact match against pre-computed region
strings (e.g., chr10:68769984-69903496) and there is some missing data. Use
get-credible-sets-near-target as it allows a genomic range overlap search.
This fetches credible sets associated with the target and filters them in Python based on the variant's genomic position.
Advanced GraphQL Queries
If you need to query endpoints or fields not exposed by the built-in
subcommands, use the custom-query subcommand.
Before writing a custom query: Read the reference documentation to understand the API schema, types, and see example queries. See references/OpenTargets_GraphQL_Guide.md for full schema details, endpoints, and examples.
Example: Finding drugs for a disease
uv run scripts/query_opentargets.py custom-query \
query drugsForDisease($id: String!) {
disease(efoId: $id) {
name
drugAndClinicalCandidates {
count
rows {
maxClinicalStage
drug {
id
name
}
}
}
}
}' \
--variables '{"id": "EFO_1001006"}'
--output '/tmp/opentargets_result.json'
Confidence Star Ratings
The Open Targets Platform assigns a confidence level to each credible set based on the fine-mapping method and quality checks. These correspond to star ratings displayed in the platform UI:
| Stars | Confidence String (API value) |
|---|---|
| ★★★★ (4 stars) | SuSiE fine-mapped credible set with in-sample LD |
| ★★★ (3 stars) | SuSiE fine-mapped credible set with out-of-sample LD |
| ★★ (2 stars) | `PICS fine-mapped credible set extracted from summary |
| : : statistics` : | |
| ★ (1 star) | PICS fine-mapped credible set based on reported top hit |
| None | Unknown confidence |
When users ask about "N-star confidence", match their request to the
corresponding string in the confidence field of the API response.
Tips and Common Mistakes
- ID Formats:
- Disease IDs must be in EFO format (e.g.
EFO_0000685). - Target IDs must be Ensembl IDs (e.g.
ENSG00000169083), not HGNC symbols. If you only have a gene symbol, you may need to map it first using a custom GraphQLsearchquery. - Variant IDs are formatted as
chromosome_position_ref_alt(e.g.,1_154426264_C_T). Achrprefix (e.g.chr1_154426264_C_T) is automatically stripped by the tool. - Study IDs can be GWAS Catalog IDs (e.g.
GCST90204201) or project-specific IDs (e.g.FINNGEN_R12_RX_CROHN_2NDLINE).
- Disease IDs must be in EFO format (e.g.
- Truncation: The tool truncates arrays longer than
--limitto protect the context window. If you see"_truncated", you can run the query again with a higher limit if you specifically need more data, but be cautious with large limit values. Always use the--outputflag to save the result to a file and avoid terminal output truncation. - Pagination and incomplete results: The
--page-sizeoption (default: 200) controls how many items are fetched from the API. Always check thecountfield in the response and compare it to the number ofrowsactually returned. Ifcount> number of rows, you have incomplete data — either increase--page-sizeto fetch more, or inform the user that only a partial result set was returned. This is especially important forget-l2gwithout--study-id, which can return hundreds of credible sets.
How to use opentargets-database on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add opentargets-database
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches opentargets-database from GitHub repository google-deepmind/science-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate opentargets-database. Access the skill through slash commands (e.g., /opentargets-database) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★27 reviews- ★★★★★Anika Lopez· Dec 28, 2024
Solid pick for teams standardizing on skills: opentargets-database is focused, and the summary matches what you get after install.
- ★★★★★Camila Verma· Dec 12, 2024
opentargets-database is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Sakshi Patil· Nov 27, 2024
opentargets-database fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Arya Chawla· Nov 19, 2024
Registry listing for opentargets-database matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Min Patel· Nov 3, 2024
Keeps context tight: opentargets-database is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Arjun Li· Oct 10, 2024
Useful defaults in opentargets-database — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Anika Rao· Sep 21, 2024
opentargets-database has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Naina Bhatia· Sep 17, 2024
opentargets-database is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Anaya Ramirez· Sep 13, 2024
Solid pick for teams standardizing on skills: opentargets-database is focused, and the summary matches what you get after install.
- ★★★★★Oshnikdeep· Sep 5, 2024
Useful defaults in opentargets-database — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 27