Code
import requests
import urllib3
urllib3.disable_warnings()
def fetch_uniprot_data(uniprot_id):
= f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.json"
url = requests.get(url, verify=False) # Disable SSL verification
response # Raise an error for bad status codes
response.raise_for_status() return response.json()
def display_uniprot_data(data):
= data.get('primaryAccession', 'N/A')
primary_accession = data.get('proteinDescription', {}).get('recommendedName', {}).get('fullName', {}).get('value', 'N/A')
protein_name = data.get('gene', [{'geneName': {'value': 'N/A'}}])[0]['geneName']['value']
gene_name = data.get('organism', {}).get('scientificName', 'N/A')
organism
= next((comment for comment in data.get('comments', []) if comment['commentType'] == "FUNCTION"), None)
function_comment = function_comment['texts'][0]['value'] if function_comment else 'N/A'
function
# Printing the data
print(f"UniProt ID: {primary_accession}")
print(f"Protein Name: {protein_name}")
print(f"Organism: {organism}")
print(f"Function: {function}")
# Replace this with the UniProt ID you want to fetch
= "Q7RTT9"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: Q7RTT9
Protein Name: Equilibrative nucleoside transporter 4
Organism: Homo sapiens
Function: Electrogenic voltage-dependent transporter that mediates the transport of a variety of endogenous bioactive amines, cationic xenobiotics and drugs (PubMed:15448143, PubMed:16099839, PubMed:16873718, PubMed:17018840, PubMed:17121826, PubMed:20592246, PubMed:20858707, PubMed:22396231, PubMed:31537831). Utilizes the physiologic inside-negative membrane potential as a driving force to facilitate cellular uptake of organic cations (PubMed:15448143, PubMed:20592246, PubMed:22396231). Functions as a Na(+)- and Cl(-)-independent bidirectional transporter (PubMed:15448143, PubMed:16099839, PubMed:22396231, PubMed:31537831). Substrate transport is pH-dependent and enhanced under acidic condition, which is most likely the result of allosteric changes in the transporter structure (PubMed:16873718, PubMed:17018840, PubMed:20592246, PubMed:22396231, PubMed:31537831). Implicated in monoamine neurotransmitters uptake such as serotonin, dopamine, adrenaline/epinephrine, noradrenaline/norepinephrine, histamine and tyramine, thereby supporting a role in homeostatic regulation of aminergic neurotransmission in the central nervous system (PubMed:15448143, PubMed:16099839, PubMed:17018840, PubMed:17121826, PubMed:20858707, PubMed:22396231). Also responsible for the uptake of bioactive amines and drugs through the blood-cerebrospinal fluid (CSF) barrier, from the CSF into choroid plexus epithelial cells, thereby playing a significant role in the clearance of cationic neurotoxins, xenobiotics and metabolic waste in the brain (By similarity). Involved in bidirectional transport of the purine nucleoside adenosine and plays a role in the regulation of extracellular adenosine concentrations in cardiac tissues, in particular during ischemia (PubMed:16873718, PubMed:20592246, PubMed:31537831). May be involved in organic cation uptake from the tubular lumen into renal tubular cells, thereby contributing to organic cation reabsorption in the kidney (PubMed:17018840). Also transports guanidine (PubMed:16099839)