mkt.databases.oncokb.OncoKBProteinChange

class mkt.databases.oncokb.OncoKBProteinChange(url: str = 'https://www.oncokb.org/api/v1', header: dict = <factory>, gene_name: str | None = None, alteration: str | None = None, dict_highest_level: dict[str, int] = <factory>, list_treatment: list[str] = <factory>, oncogenic: str | None = None, vus: bool | None = None, known_effect: str | None = None, verbose: bool = True)[source]

Bases: OncoKB

OncoKB API client for protein changes.

__init__(url: str = 'https://www.oncokb.org/api/v1', header: dict = <factory>, gene_name: str | None = None, alteration: str | None = None, dict_highest_level: dict[str, int] = <factory>, list_treatment: list[str] = <factory>, oncogenic: str | None = None, vus: bool | None = None, known_effect: str | None = None, verbose: bool = True) None

Methods

__eq__(other)

Return self==value.

__init__([url, header, gene_name, ...])

__post_init__()

Initialize the OncoKBProteinChange client.

_stamp_from_response(res)

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

_stamp_now()

Record current UTC datetime; cache provenance unknown.

annotate_highest_level()

Annotate the highest level of evidence for the protein change.

check_response(res)

Check the response status code for errors.

extract_level_as_int(str_in)

Extract the level from a string and convert it to an integer.

get_treatments()

Get the list of treatments associated with the alteration.

has_json()

Get the JSON response from the OncoKB API query.

maybe_get_token()

Get API token, if available.

query_api()

Query the OncoKB API for a given URL.

set_api_key()

Set API token for REST API.

update_url()

Update the URL for the OncoKB API query based on the UniProt ID.

Attributes

__dataclass_fields__

__dataclass_params__

__match_args__

_json

alteration

Alteration type (e.g., V600E if BRAF is gene).

from_cache

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

gene_name

Gene associated with the protein change.

known_effect

Effect of the mutation on the protein (e.g., missense, nonsense).

oncogenic

Oncogenic status of the alteration.

query_datetime

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

url

Base URL for the OncoKB API.

url_query

URL to update for specific queries.

verbose

Whether to log warnings for missing data.

vus

Whether the alteration is a Variant of Uncertain Significance (VUS).

dict_highest_level

Dictionary to store the highest level of evidence for each alteration.

list_treatment

List of treatments associated with the alteration.

header

OncoKB API token, if available.

__init__(url: str = 'https://www.oncokb.org/api/v1', header: dict = <factory>, gene_name: str | None = None, alteration: str | None = None, dict_highest_level: dict[str, int] = <factory>, list_treatment: list[str] = <factory>, oncogenic: str | None = None, vus: bool | None = None, known_effect: str | None = None, verbose: bool = True) None
alteration: str | None = None

Alteration type (e.g., V600E if BRAF is gene).

annotate_highest_level()[source]

Annotate the highest level of evidence for the protein change.

dict_highest_level: dict[str, int]

Dictionary to store the highest level of evidence for each alteration.

gene_name: str | None = None

Gene associated with the protein change.

get_treatments()[source]

Get the list of treatments associated with the alteration.

header: dict

OncoKB API token, if available.

known_effect: str | None = None

Effect of the mutation on the protein (e.g., missense, nonsense).

list_treatment: list[str]

List of treatments associated with the alteration.

oncogenic: str | None = None

Oncogenic status of the alteration.

update_url()[source]

Update the URL for the OncoKB API query based on the UniProt ID.

verbose: bool = True

Whether to log warnings for missing data.

vus: bool | None = None

Whether the alteration is a Variant of Uncertain Significance (VUS).