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
= "O15146"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: O15146
Protein Name: Muscle, skeletal receptor tyrosine-protein kinase
Organism: Homo sapiens
Function: Receptor tyrosine kinase which plays a central role in the formation and the maintenance of the neuromuscular junction (NMJ), the synapse between the motor neuron and the skeletal muscle (PubMed:25537362). Recruitment of AGRIN by LRP4 to the MUSK signaling complex induces phosphorylation and activation of MUSK, the kinase of the complex. The activation of MUSK in myotubes regulates the formation of NMJs through the regulation of different processes including the specific expression of genes in subsynaptic nuclei, the reorganization of the actin cytoskeleton and the clustering of the acetylcholine receptors (AChR) in the postsynaptic membrane. May regulate AChR phosphorylation and clustering through activation of ABL1 and Src family kinases which in turn regulate MUSK. DVL1 and PAK1 that form a ternary complex with MUSK are also important for MUSK-dependent regulation of AChR clustering. May positively regulate Rho family GTPases through FNTA. Mediates the phosphorylation of FNTA which promotes prenylation, recruitment to membranes and activation of RAC1 a regulator of the actin cytoskeleton and of gene expression. Other effectors of the MUSK signaling include DNAJA3 which functions downstream of MUSK. May also play a role within the central nervous system by mediating cholinergic responses, synaptic plasticity and memory formation (By similarity)