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
= "P17181"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P17181
Protein Name: Interferon alpha/beta receptor 1
Organism: Homo sapiens
Function: Together with IFNAR2, forms the heterodimeric receptor for type I interferons (including interferons alpha, beta, epsilon, omega and kappa) (PubMed:10049744, PubMed:14532120, PubMed:15337770, PubMed:2153461, PubMed:21854986, PubMed:24075985, PubMed:31270247, PubMed:33252644, PubMed:35442418, PubMed:7813427). Type I interferon binding activates the JAK-STAT signaling cascade, resulting in transcriptional activation or repression of interferon-regulated genes that encode the effectors of the interferon response (PubMed:10049744, PubMed:21854986, PubMed:7665574). Mechanistically, type I interferon-binding brings the IFNAR1 and IFNAR2 subunits into close proximity with one another, driving their associated Janus kinases (JAKs) (TYK2 bound to IFNAR1 and JAK1 bound to IFNAR2) to cross-phosphorylate one another (PubMed:21854986, PubMed:32972995, PubMed:7665574, PubMed:7813427). The activated kinases phosphorylate specific tyrosine residues on the intracellular domains of IFNAR1 and IFNAR2, forming docking sites for the STAT transcription factors (PubMed:21854986, PubMed:32972995, PubMed:7526154, PubMed:7665574, PubMed:7813427). STAT proteins are then phosphorylated by the JAKs, promoting their translocation into the nucleus to regulate expression of interferon-regulated genes (PubMed:19561067, PubMed:21854986, PubMed:32972995, PubMed:7665574, PubMed:7813427, PubMed:9121453). Can also act independently of IFNAR2: form an active IFNB1 receptor by itself and activate a signaling cascade that does not involve activation of the JAK-STAT pathway (By similarity)