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
= "P36896"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P36896
Protein Name: Activin receptor type-1B
Organism: Homo sapiens
Function: Transmembrane serine/threonine kinase activin type-1 receptor forming an activin receptor complex with activin receptor type-2 (ACVR2A or ACVR2B). Transduces the activin signal from the cell surface to the cytoplasm and is thus regulating a many physiological and pathological processes including neuronal differentiation and neuronal survival, hair follicle development and cycling, FSH production by the pituitary gland, wound healing, extracellular matrix production, immunosuppression and carcinogenesis. Activin is also thought to have a paracrine or autocrine role in follicular development in the ovary. Within the receptor complex, type-2 receptors (ACVR2A and/or ACVR2B) act as a primary activin receptors whereas the type-1 receptors like ACVR1B act as downstream transducers of activin signals. Activin binds to type-2 receptor at the plasma membrane and activates its serine-threonine kinase. The activated receptor type-2 then phosphorylates and activates the type-1 receptor such as ACVR1B. Once activated, the type-1 receptor binds and phosphorylates the SMAD proteins SMAD2 and SMAD3, on serine residues of the C-terminal tail. Soon after their association with the activin receptor and subsequent phosphorylation, SMAD2 and SMAD3 are released into the cytoplasm where they interact with the common partner SMAD4. This SMAD complex translocates into the nucleus where it mediates activin-induced transcription. Inhibitory SMAD7, which is recruited to ACVR1B through FKBP1A, can prevent the association of SMAD2 and SMAD3 with the activin receptor complex, thereby blocking the activin signal. Activin signal transduction is also antagonized by the binding to the receptor of inhibin-B via the IGSF1 inhibin coreceptor. ACVR1B also phosphorylates TDP2