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:
OncoKBOncoKB 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 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 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 the URL for the OncoKB API query based on the UniProt ID.
Attributes
__dataclass_fields____dataclass_params____match_args___jsonAlteration type (e.g., V600E if BRAF is gene).
from_cacheWhether the most recent response was served from requests-cache.
Gene associated with the protein change.
Effect of the mutation on the protein (e.g., missense, nonsense).
Oncogenic status of the alteration.
query_datetimeUTC datetime the underlying network query was made (cache creation time if served from cache).
urlBase URL for the OncoKB API.
url_queryURL to update for specific queries.
Whether to log warnings for missing data.
Whether the alteration is a Variant of Uncertain Significance (VUS).
Dictionary to store the highest level of evidence for each alteration.
List of treatments associated with the alteration.
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).
- 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.
- 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.
- verbose: bool = True
Whether to log warnings for missing data.
- vus: bool | None = None
Whether the alteration is a Variant of Uncertain Significance (VUS).