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
= "P48551"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P48551
Protein Name: Interferon alpha/beta receptor 2
Organism: Homo sapiens
Function: Together with IFNAR1, forms the heterodimeric receptor for type I interferons (including interferons alpha, beta, epsilon, omega and kappa) (PubMed:10049744, PubMed:10556041, PubMed:21854986, PubMed:26424569, PubMed:28165510, PubMed:32972995, PubMed:7665574, PubMed:7759950, PubMed:8181059, PubMed:8798579, PubMed:8969169). 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:17517919, PubMed:21854986, PubMed:26424569, PubMed:28165510, PubMed:32972995, PubMed:7665574, PubMed:7759950, PubMed:8181059, PubMed:8798579, PubMed:8969169). 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:10556041, PubMed:11682488, PubMed:12105218, PubMed:21854986, PubMed:32972995). The activated kinases phosphorylate specific tyrosine residues on the intracellular domains of IFNAR1 and IFNAR2, forming docking sites for the STAT transcription factors (STAT1, STAT2 and STAT) (PubMed:11682488, PubMed:12105218, PubMed:21854986, PubMed:32972995). STAT proteins are then phosphorylated by the JAKs, promoting their translocation into the nucleus to regulate expression of interferon-regulated genes (PubMed:12105218, PubMed:28165510, PubMed:9121453)