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
= "P78536"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P78536
Protein Name: Disintegrin and metalloproteinase domain-containing protein 17
Organism: Homo sapiens
Function: Transmembrane metalloprotease which mediates the ectodomain shedding of a myriad of transmembrane proteins including adhesion proteins, growth factor precursors and cytokines important for inflammation and immunity (PubMed:24226769, PubMed:24227843, PubMed:28060820, PubMed:28923481). Cleaves the membrane-bound precursor of TNF-alpha to its mature soluble form (PubMed:9034191, PubMed:36078095). Responsible for the proteolytical release of soluble JAM3 from endothelial cells surface (PubMed:20592283). Responsible for the proteolytic release of several other cell-surface proteins, including p75 TNF-receptor, interleukin 1 receptor type II, p55 TNF-receptor, transforming growth factor-alpha, L-selectin, growth hormone receptor, MUC1 and the amyloid precursor protein (PubMed:12441351). Acts as an activator of Notch pathway by mediating cleavage of Notch, generating the membrane-associated intermediate fragment called Notch extracellular truncation (NEXT) (PubMed:24226769). Plays a role in the proteolytic processing of ACE2 (PubMed:24227843). Plays a role in hemostasis through shedding of GP1BA, the platelet glycoprotein Ib alpha chain (By similarity). Mediates the proteolytic cleavage of LAG3, leading to release the secreted form of LAG3 (By similarity). Mediates the proteolytic cleavage of IL6R, leading to the release of secreted form of IL6R (PubMed:26876177, PubMed:28060820). Mediates the proteolytic cleavage and shedding of FCGR3A upon NK cell stimulation, a mechanism that allows for increased NK cell motility and detachment from opsonized target cells. Cleaves TREM2, resulting in shedding of the TREM2 ectodomain (PubMed:28923481)