How to modify data source weights in the API?

Hi,

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?

Thanks
Philge

Hi,

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") {
    id
    associatedTargets(
      page: { index: 0, size: 50 }
      orderByScore: "score"
      BFilter: ""
      aggregationFilters: []
      datasources: [{ id: "ot_genetics", weight: 0.5, propagate: false }]
    ) {
      count
      rows {
        target {
          id
          approvedSymbol
          approvedName
        }
        score
        datatypeScores {
          componentId: id
          score
        }
      }
    }
  }
}

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

1 Like