mkt.databases.open_targets.OpenTargetsDrugMoA

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

Methods

__eq__(other)

Return self==value.

__init__([url, query_string, variables, ...])

__post_init__()

Initialize the Open Targets Drug MoA API client.

_stamp_from_response(res)

Record query datetime + cache provenance from a requests-cache response.

_stamp_now()

Record current UTC datetime; cache provenance unknown.

check_response(res)

Check the response status code for errors.

get_moa()

Get the mechanism of action information for the drug.

query_api()

Query a GraphQL API and return result.

Attributes

__dataclass_fields__

__dataclass_params__

__match_args__

from_cache

Whether the most recent response was served from requests-cache.

query_datetime

UTC datetime the underlying network query was made (cache creation time if served from cache).

query_string

GraphQL query string to retrieve drug mechanism of action information.

response

Response from the GraphQL API query, if any.

url

Base URL for the Open Targets GraphQL API.

chembl_id

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

variables

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

__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.