mkt.databases.open_targets

Open Targets GraphQL client for drug mechanism-of-action data.

Provides OpenTargetsDrugMoA, a GraphQL client that retrieves drug mechanism-of-action annotations from Open Targets.

Classes

OpenTargets(url, query_string, variables, ...)

Open Targets GraphQL API client.

OpenTargetsDrugMoA(url, query_string, ...)

Open Targets Drug MoA API client.

class mkt.databases.open_targets.OpenTargets(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str | None = None, variables: dict = <factory>, response: dict | None = None)[source]

Bases: GraphQLClient

Open Targets GraphQL API client.

__init__(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str | None = None, variables: dict = <factory>, response: dict | None = None) None
url: str = 'https://api.platform.opentargets.org/api/v4/graphql'

Base URL for the Open Targets GraphQL API.

class mkt.databases.open_targets.OpenTargetsDrugMoA(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str = '\nquery MechanismsOfActionSectionQuery($chemblId: String!) {\n  drug(chemblId: $chemblId) {\n    id\n    mechanismsOfAction {\n      rows {\n        mechanismOfAction\n        targetName\n        targets {\n          id\n          approvedSymbol\n        }\n        references {\n          source\n          urls\n        }\n      }\n      uniqueActionTypes\n      uniqueTargetTypes\n    }\n    parentMolecule {\n      id\n      name\n    }\n    childMolecules {\n      id\n      name\n    }\n  }\n}\n', variables: dict = <factory>, response: dict | None = None, *, chembl_id: str)[source]

Bases: OpenTargets

Open Targets Drug MoA API client.

__init__(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str = '\nquery MechanismsOfActionSectionQuery($chemblId: String!) {\n  drug(chemblId: $chemblId) {\n    id\n    mechanismsOfAction {\n      rows {\n        mechanismOfAction\n        targetName\n        targets {\n          id\n          approvedSymbol\n        }\n        references {\n          source\n          urls\n        }\n      }\n      uniqueActionTypes\n      uniqueTargetTypes\n    }\n    parentMolecule {\n      id\n      name\n    }\n    childMolecules {\n      id\n      name\n    }\n  }\n}\n', variables: dict = <factory>, response: dict | None = None, *, chembl_id: str) None
chembl_id: str

ChEMBL ID of the drug to query for mechanism of action information.

get_moa() dict | None[source]

Get the mechanism of action information for the drug.

query_string: str = '\nquery MechanismsOfActionSectionQuery($chemblId: String!) {\n  drug(chemblId: $chemblId) {\n    id\n    mechanismsOfAction {\n      rows {\n        mechanismOfAction\n        targetName\n        targets {\n          id\n          approvedSymbol\n        }\n        references {\n          source\n          urls\n        }\n      }\n      uniqueActionTypes\n      uniqueTargetTypes\n    }\n    parentMolecule {\n      id\n      name\n    }\n    childMolecules {\n      id\n      name\n    }\n  }\n}\n'

GraphQL query string to retrieve drug mechanism of action information.

variables: dict

Variables for the GraphQL query retrieve drug mechanism of action information.