I am struggling a lot with the lack of documentation of the GraphQL endpoint.
"associations on the fly"
associatedTargets(
"List of disease or target IDs"
Bs: \[String!\],
"Use the disease ontology to retrieve all its descendants and capture their associated evidence."
enableIndirect: Boolean,
"List of datasource settings"
datasources: \[DatasourceSettingsInput!\],
"List of the facet IDs to filter by (using AND)"
facetFilters: \[String!\],
"Filter to apply to the ids with string prefixes"
BFilter: String,
"Ordering for the associations. By default is score desc"
orderByScore: String,
"Pagination settings with index and size"
page: Pagination): AssociatedTargets!
What is the format of orderByScore? How to sort by other scores than just “score desc”, e.g. how to sort by a datatype score? E.g. genetics_association if available?
Hi @jpfeuffer and welcome to the Open Targets Community!
Thanks for the feedback! We know the GraphQL documentation is not always very descriptive, we’re working on improving it.
What is the format of orderByScore? How to sort by other scores than just “score desc”, e.g. how to sort by a datatype score? E.g. genetics_association if available?
orderByScore is a string, where you can input:
score type: either "score" or an id from datatypeScores or datasourceScores e.g. "gwas_credible_sets"
sort type: either "desc" or "asc"
orderByScore can either be:
Empty —> sorts by descending "score"
Just the score type —> sorts that score type in descending order.
Just the sort type —> sort in the specified way on "score".
Both score type and sort type separated by a space like score_type sort_type e.g. "gwas_credible_sets asc" → sort targets in ascending order by their gwas_credible_sets score
On the Platform webpage, you can see view the API query that we use to build the Associations on the Fly page to see how this is constructed (Export —> API Query), which might help to understand how some of the functions work.
Thank you very much! That helps tremendously. It would be great if a condensed version of this ended up in the comments of your graphQL schema at some point.
I assume this would help people (and LLMs) a lot in the future.
Regarding:
Note that additional required data sources are added as “AND” filters.
Which sounds like it means that filtering for traits that have ANY genetics evidence is not possible, right? Could we hack our way around this by creating a weighted score on our own that includes all datasource evidence scores of the genetics type somehow?