mkt.databases.uniprot.UniProtJSON
- class mkt.databases.uniprot.UniProtJSON(uniprot_id: str, url: str = 'https://rest.uniprot.org/uniprotkb', headers: str = "{'Accept': 'application/json'}", _json: dict | None = None, dict_mod_res: dict | None = None)[source]
Bases:
UniProt,RESTAPIClientClass to interact UniProt API for JSON download.
- __init__(uniprot_id: str, url: str = 'https://rest.uniprot.org/uniprotkb', headers: str = "{'Accept': 'application/json'}", _json: dict | None = None, dict_mod_res: dict | None = None) None
Methods
__eq__(other)Return self==value.
__init__(uniprot_id[, url, headers, _json, ...])__post_init__()_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.
Extract modified residues from JSON.
Get JSON for UniProt ID.
Attributes
__dataclass_fields____dataclass_params____match_args___jsonJSON response from the API.
Dictionary of modified residues.
from_cacheWhether the most recent response was served from requests-cache.
Header for the API request.
query_datetimeUTC datetime the underlying network query was made (cache creation time if served from cache).
urlURL for the UniProt API.
UniProt ID.
- __init__(uniprot_id: str, url: str = 'https://rest.uniprot.org/uniprotkb', headers: str = "{'Accept': 'application/json'}", _json: dict | None = None, dict_mod_res: dict | None = None) None
- dict_mod_res: dict | None = None
Dictionary of modified residues.
- extract_modified_residues()[source]
Extract modified residues from JSON.
- Returns:
List of modified residues
- Return type:
list[str]
- headers: str = "{'Accept': 'application/json'}"
Header for the API request.
- query_api() dict | None[source]
Get JSON for UniProt ID.
- Returns:
JSON for UniProt ID; None if request fails
- Return type:
dict | None
- uniprot_id: str
UniProt ID.