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
= "O14843"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: O14843
Protein Name: Free fatty acid receptor 3
Organism: Homo sapiens
Function: G protein-coupled receptor that is activated by a major product of dietary fiber digestion, the short chain fatty acids (SCFAs), and that plays a role in the regulation of whole-body energy homeostasis and in intestinal immunity. In omnivorous mammals, the short chain fatty acids acetate, propionate and butyrate are produced primarily by the gut microbiome that metabolizes dietary fibers. SCFAs serve as a source of energy but also act as signaling molecules. That G protein-coupled receptor is probably coupled to the pertussis toxin-sensitive, G(i/o)-alpha family of G proteins. Its activation results in the formation of inositol 1,4,5-trisphosphate, the mobilization of intracellular calcium, the phosphorylation of the MAPK3/ERK1 and MAPK1/ERK2 kinases and the inhibition of intracellular cAMP accumulation (PubMed:12711604). Activated by SCFAs and by beta-hydroxybutyrate, a ketone body produced by the liver upon starvation, it inhibits N-type calcium channels and modulates the activity of sympathetic neurons through a signaling cascade involving the beta and gamma subunits of its coupled G protein, phospholipase C and MAP kinases. Thereby, it may regulate energy expenditure through the control of the sympathetic nervous system that controls for instance heart rate. Upon activation by SCFAs accumulating in the intestine, it may also signal to the brain via neural circuits which in turn would regulate intestinal gluconeogenesis. May also control the production of hormones involved in whole-body energy homeostasis. May for instance, regulate blood pressure through renin secretion. May also regulate secretion of the PYY peptide by enteroendocrine cells and control gut motility, intestinal transit rate, and the harvesting of energy from SCFAs produced by gut microbiota. May also indirectly regulate the production of LEP/Leptin, a hormone acting on the CNS to inhibit food intake, in response to the presence of short-chain fatty acids in the intestine. Finally, may also play a role in glucose homeostasis. Besides its role in energy homeostasis, may play a role in intestinal immunity. May mediate the activation of the inflammatory and immune response by SCFAs in the gut, regulating the rapid production of chemokines and cytokines by intestinal epithelial cells. Among SCFAs, the fatty acids containing less than 6 carbons, the most potent activators are probably propionate, butyrate and pentanoate while acetate is a poor activator (PubMed:12496283, PubMed:12711604)