How to modify data source weights in the API?


I have come across a statement, “The default weights used in the web application can be modified by the user in the API, to adjust to different prioritisation strategies.”. Can you please tell me how to do this?



Once you are fetching associations (associated diseases for a fixed target or associated targets for a fix disease), you have the option to specify datasource weights in the query as follows:

query DiseaseAssociationsQuery {
  disease(efoId: "EFO_0005774") {
      page: { index: 0, size: 50 }
      orderByScore: "score"
      BFilter: ""
      aggregationFilters: []
      datasources: [{ id: "ot_genetics", weight: 0.5, propagate: false }]
    ) {
      rows {
        target {
        datatypeScores {
          componentId: id

You can try out here. For details, take a look at the API documentation and schema.

1 Like

Hi. I found the above helpful, thank you Philge and Daniel for posting the question and response.

From what I can see, amending these weightings affects only the overall association score, rather than the individual score for each of the 7 evidence types - at least this seems to be the response from my queries. Is there a way to amend the API query to adjust the 7 individual association scores as well as the overall score?

I am also wondering if you could provide an explanation for the ‘propagate’ boolean?

Many thanks,

Hi @cjb-apis and welcome to our Community!

  1. Regarding the weights and association scores
    You are right in observing that amending the weights using the datasources parameter in your query directly impacts the overall association score. The purpose behind this design is that these weights are applied to each datasource when combining the associations by datasource. Only when these are combined do we compute the associations by datatype or the overall associations. Until that point, they aren’t considered, and hence the API doesn’t return weighted associations by datasource. As described in our documentation:

“To calculate both data type and overall association scores, evidence is weighted using a factor that aims to calibrate the relevance of each data source relative to others.”

  1. The propagate boolean
    The propagate boolean determines if the evidence from a given data source should be propagated using the ontology. You can learn more about it here. If you set propagate to true, it means you’re allowing this ontological propagation for that specific datasource in your query. To provide more context, the default values for all datasources with respect to the propagate boolean can be obtained using the following query:
query associatedTargets {
  disease(efoId: "EFO_0000349") {
    associatedTargets {
      datasources {

By default, propagate is set to True for all data sources, except for Expression Atlas (RNA Expression), as mentioned in our documentation.

I hope you found this helpful! We understand the complexity of our API schema, we will work on documenting an accurate description of each endpoint. Let us know if you have further questions.