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
= "P07333"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P07333
Protein Name: Macrophage colony-stimulating factor 1 receptor
Organism: Homo sapiens
Function: Tyrosine-protein kinase that acts as a cell-surface receptor for CSF1 and IL34 and plays an essential role in the regulation of survival, proliferation and differentiation of hematopoietic precursor cells, especially mononuclear phagocytes, such as macrophages and monocytes. Promotes the release of pro-inflammatory chemokines in response to IL34 and CSF1, and thereby plays an important role in innate immunity and in inflammatory processes. Plays an important role in the regulation of osteoclast proliferation and differentiation, the regulation of bone resorption, and is required for normal bone and tooth development. Required for normal male and female fertility, and for normal development of milk ducts and acinar structures in the mammary gland during pregnancy. Promotes reorganization of the actin cytoskeleton, regulates formation of membrane ruffles, cell adhesion and cell migration, and promotes cancer cell invasion. Activates several signaling pathways in response to ligand binding, including the ERK1/2 and the JNK pathway (PubMed:20504948, PubMed:30982609). Phosphorylates PIK3R1, PLCG2, GRB2, SLA2 and CBL. Activation of PLCG2 leads to the production of the cellular signaling molecules diacylglycerol and inositol 1,4,5-trisphosphate, that then lead to the activation of protein kinase C family members, especially PRKCD. Phosphorylation of PIK3R1, the regulatory subunit of phosphatidylinositol 3-kinase, leads to activation of the AKT1 signaling pathway. Activated CSF1R also mediates activation of the MAP kinases MAPK1/ERK2 and/or MAPK3/ERK1, and of the SRC family kinases SRC, FYN and YES1. Activated CSF1R transmits signals both via proteins that directly interact with phosphorylated tyrosine residues in its intracellular domain, or via adapter proteins, such as GRB2. Promotes activation of STAT family members STAT3, STAT5A and/or STAT5B. Promotes tyrosine phosphorylation of SHC1 and INPP5D/SHIP-1. Receptor signaling is down-regulated by protein phosphatases, such as INPP5D/SHIP-1, that dephosphorylate the receptor and its downstream effectors, and by rapid internalization of the activated receptor. In the central nervous system, may play a role in the development of microglia macrophages (PubMed:30982608)