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 fromdatatypeScoresordatasourceScorese.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_typee.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.
What is propagate? How does weighting work?
See this previous question on the Community for an explanation of the propagate boolean and the weighting. We also explain the weighting in more detail in our documentation.
How to require at least “one of” a list of datasources?
You can require a datasource like this (and you can set multiple data sources as “required: true”) :
query DiseaseAssociationsQuery {
disease(efoId: "MONDO_0004975") {
id
associatedTargets(
datasources: [{ id: "gwas_credible_sets", weight: 1, propagate: true, required: true }]
) {
count
}
}
}
Note that additional required data sources are added as “OR” filters.
Let us know if you have further questions!