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
= "Q9Y6L6"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: Q9Y6L6
Protein Name: Solute carrier organic anion transporter family member 1B1
Organism: Homo sapiens
Function: Mediates the Na(+)-independent uptake of organic anions (PubMed:10358072, PubMed:15159445, PubMed:17412826). Shows broad substrate specificity, can transport both organic anions such as bile acid taurocholate (cholyltaurine) and conjugated steroids (dehydroepiandrosterone 3-sulfate, 17-beta-glucuronosyl estradiol, and estrone 3-sulfate), as well as eicosanoids (prostaglandin E2, thromboxane B2, leukotriene C4, and leukotriene E4), and thyroid hormones (T4/L-thyroxine, and T3/3,3',5'-triiodo-L-thyronine) (PubMed:10358072, PubMed:10601278, PubMed:10873595, PubMed:11159893, PubMed:12196548, PubMed:12568656, PubMed:15159445, PubMed:15970799, PubMed:16627748, PubMed:17412826, PubMed:19129463, PubMed:26979622). Can take up bilirubin glucuronides from plasma into the liver, contributing to the detoxification-enhancing liver-blood shuttling loop (PubMed:22232210). Involved in the clearance of endogenous and exogenous substrates from the liver (PubMed:10358072, PubMed:10601278). Transports coproporphyrin I and III, by-products of heme synthesis, and may be involved in their hepatic disposition (PubMed:26383540). May contribute to regulate the transport of organic compounds in testes across the blood-testis-barrier (Probable). Can transport HMG-CoA reductase inhibitors (also known as statins), such as pravastatin and pitavastatin, a clinically important class of hypolipidemic drugs (PubMed:10601278, PubMed:15159445, PubMed:15970799). May play an important role in plasma and tissue distribution of the structurally diverse chemotherapeutic drug methotrexate (PubMed:23243220). May also transport antihypertension agents, such as the angiotensin-converting enzyme (ACE) inhibitor prodrug enalapril, and the highly selective angiotensin II AT1-receptor antagonist valsartan, in the liver (PubMed:16624871, PubMed:16627748). Shows a pH-sensitive substrate specificity towards prostaglandin E2 and T4 which may be ascribed to the protonation state of the binding site and leads to a stimulation of substrate transport in an acidic microenvironment (PubMed:19129463). Hydrogencarbonate/HCO3(-) acts as the probable counteranion that exchanges for organic anions (PubMed:19129463)