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
= "P49768"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P49768
Protein Name: Presenilin-1
Organism: Homo sapiens
Function: Catalytic subunit of the gamma-secretase complex, an endoprotease complex that catalyzes the intramembrane cleavage of integral membrane proteins such as Notch receptors and APP (amyloid-beta precursor protein) (PubMed:10206644, PubMed:10545183, PubMed:10593990, PubMed:10811883, PubMed:10899933, PubMed:12679784, PubMed:12740439, PubMed:15274632, PubMed:20460383, PubMed:25043039, PubMed:26280335, PubMed:28269784, PubMed:30598546, PubMed:30630874). Requires the presence of the other members of the gamma-secretase complex for protease activity (PubMed:15274632, PubMed:25043039, PubMed:26280335, PubMed:30598546, PubMed:30630874). Plays a role in Notch and Wnt signaling cascades and regulation of downstream processes via its role in processing key regulatory proteins, and by regulating cytosolic CTNNB1 levels (PubMed:10593990, PubMed:10811883, PubMed:10899933, PubMed:9738936). Stimulates cell-cell adhesion via its interaction with CDH1; this stabilizes the complexes between CDH1 (E-cadherin) and its interaction partners CTNNB1 (beta-catenin), CTNND1 and JUP (gamma-catenin) (PubMed:11953314). Under conditions of apoptosis or calcium influx, cleaves CDH1 (PubMed:11953314). This promotes the disassembly of the complexes between CDH1 and CTNND1, JUP and CTNNB1, increases the pool of cytoplasmic CTNNB1, and thereby negatively regulates Wnt signaling (PubMed:11953314, PubMed:9738936). Required for normal embryonic brain and skeleton development, and for normal angiogenesis (By similarity). Mediates the proteolytic cleavage of EphB2/CTF1 into EphB2/CTF2 (PubMed:17428795, PubMed:28269784). The holoprotein functions as a calcium-leak channel that allows the passive movement of calcium from endoplasmic reticulum to cytosol and is therefore involved in calcium homeostasis (PubMed:16959576, PubMed:25394380). Involved in the regulation of neurite outgrowth (PubMed:15004326, PubMed:20460383). Is a regulator of presynaptic facilitation, spike transmission and synaptic vesicles replenishment in a process that depends on gamma-secretase activity. It acts through the control of SYT7 presynaptic expression (By similarity)