Submit compact Open Targets Platform GraphQL requests for target, disease, drug, variant, study, and search data, including associated-disease datasource heatmap matrices. Use when a user wants concise Open Targets summaries or per-datasource evidence context
scripts/opentargets_graphql.py for all Open Targets GraphQL work.scripts/opentargets_disease_heatmap.py when the user wants the associated-disease bubble grid or a disease-by-datasource evidence matrix.max_items; for nested GraphQL results, start with max_items=3 to 5.query_path for long GraphQL documents instead of pasting large inline query strings.... in tool previews as UI truncation, not part of the real query.datasourceScores as evidence-source breadth/context. Do not treat heatmap breadth alone as proof of causal target assignment, mechanism, or direction of effect.query or query_pathvariables, max_items, max_depth, timeout_sec, save_raw, raw_output_path{"query":"query { __typename }"}{"query":"query searchAny($q: String!) { search(queryString: $q) { total hits { entity score object { ... on Target { id approvedSymbol } } } } }","variables":{"q":"MST1"},"max_items":3}ok, source, top_keys, a compact summary, and raw_output_path when save_raw=true.ok=false with error.code such as invalid_json, invalid_input, network_error, invalid_response, or graphql_error.echo '{"query":"query { __typename }"}' | python scripts/opentargets_graphql.py
Associated-disease heatmap helper:
echo '{
"ensembl_id":"ENSG00000186868",
"page_size":50,
"max_pages":4,
"disease_name_filter":"alzh"
}' | python scripts/opentargets_disease_heatmap.py
The helper paginates associatedDiseases, collects datasourceScores, and returns:
matrix.columns: datasource IDs plus display labelsmatrix.rows: diseases with datasource_scoressummary.rows_preview: top datasource signals per diseaseUse the disease-name filter as a client-side substring filter similar to the UI. If you later need the overall association score column, inspect the GraphQL row type first before adding candidate fields such as score or associationScore.
scripts/.