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
= "Q9HBA0"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: Q9HBA0
Protein Name: Transient receptor potential cation channel subfamily V member 4
Organism: Homo sapiens
Function: Non-selective calcium permeant cation channel involved in osmotic sensitivity and mechanosensitivity (PubMed:16293632, PubMed:18695040, PubMed:18826956, PubMed:22526352, PubMed:23136043, PubMed:29899501). Activation by exposure to hypotonicity within the physiological range exhibits an outward rectification (PubMed:18695040, PubMed:18826956, PubMed:29899501). Also activated by heat, low pH, citrate and phorbol esters (PubMed:16293632, PubMed:18695040, PubMed:18826956, PubMed:20037586, PubMed:21964574, PubMed:25256292). Increase of intracellular Ca(2+) potentiates currents. Channel activity seems to be regulated by a calmodulin-dependent mechanism with a negative feedback mechanism (PubMed:12724311, PubMed:18826956). Promotes cell-cell junction formation in skin keratinocytes and plays an important role in the formation and/or maintenance of functional intercellular barriers (By similarity). Acts as a regulator of intracellular Ca(2+) in synoviocytes (PubMed:19759329). Plays an obligatory role as a molecular component in the nonselective cation channel activation induced by 4-alpha-phorbol 12,13-didecanoate and hypotonic stimulation in synoviocytes and also regulates production of IL-8 (PubMed:19759329). Together with PKD2, forms mechano- and thermosensitive channels in cilium (PubMed:18695040). Negatively regulates expression of PPARGC1A, UCP1, oxidative metabolism and respiration in adipocytes (By similarity). Regulates expression of chemokines and cytokines related to pro-inflammatory pathway in adipocytes (By similarity). Together with AQP5, controls regulatory volume decrease in salivary epithelial cells (By similarity). Required for normal development and maintenance of bone and cartilage (PubMed:26249260). In its inactive state, may sequester DDX3X at the plasma membrane. When activated, the interaction between both proteins is affected and DDX3X relocalizes to the nucleus (PubMed:29899501). In neurons of the central nervous system, could play a role in triggering voluntary water intake in response to increased sodium concentration in body fluid (By similarity)