Skip to content

Updates to opentargets API #209

@lauraluebbert

Description

@lauraluebbert

What happened?

The following tests fail currently with HTTP 400:
test_opentargets_drugs
test_opentargets_pharmacogenetics_filter_or
test_opentargets_drugs_no_limit
test_opentargets_no_limit
test_opentargets_no_limit_accurate_coverage
test_opentargets_pharmacogenetics_no_limit

Possiible cause:
The OpenTargets API replaced knownDrugs with drugAndClinicalCandidates, and the data structure changed significantly:

Old API (knownDrugs → rows of flat fields):

  • drugId, prefName, drugType, mechanismOfAction
  • disease { id, name }
  • phase, status, ctIds
  • drug { synonyms, tradeNames, description, isApproved }

New API (drugAndClinicalCandidates → ClinicalTargetFromTarget):

  • id, maxClinicalStage
  • drug (full Drug object — no more isApproved, has maximumClinicalStage instead)
  • clinicalReports (replaces inline trial data)
  • diseases (list, instead of a single disease)
  • No more mechanismOfAction, prefName, drugType at the row level — those are now on the Drug object or gone

This is a breaking schema change in the OpenTargets Platform API, not something fixable by updating test
fixtures alone. The drugs query construction in gget/gget_opentargets.py (lines ~413-460) needs to be
rewritten to use the new drugAndClinicalCandidates endpoint with the new field structure, and the column
mapping/output format will need to be redesigned to match whatever fields are now available.

@josephrich98

gget version

0.30.3

Operating System (OS)

macOS

User interface

Not applicable

Are you using a computer with an Apple M1 chip?

Not M1

What is the exact command that was run?

Which output/error did you get?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions