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
= "Q7RTM1"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: Q7RTM1
Protein Name: Proton channel OTOP1
Organism: Homo sapiens
Function: Proton-selective ion channel (PubMed:29371428, PubMed:36266567). Biphasically modulated by acid and alkali, mediating proton influx and efflux in response to extracellular acid and base stimulation, respectively. Sour taste receptor, which carries inward currents in response to extracellular acidification (By similarity). Sensor for ammonium chloride (NH(4)Cl) in taste receptor cells (PubMed:37798269). NH(4)Cl acts by increasing the intracellular pH, thereby generating a driving force for proton entry through OTOP1 channel (PubMed:37798269). Might also participate in alkaline sensation. Plays a role in the regulation of Ca(2+) flux in response to purigenic (ATP, ADP and UDP) stimuli, leading to increase in cytosolic Ca(2+) due to influx of extracellular calcium. May play this role by inhibiting P2Y purinoceptor-mediated Ca(2+) release in a Ca(2+)-dependent manner and promote an influx of Ca(2+) in response to ATP. Through this mechanism and possibly others, plays a role in the formation and function of calcium carbonate-based structures in the vestibular system of the inner ear, called otoconia, that sense gravity and linear acceleration. In obesity, may attenuate adipose tissue inflammation, through the negative regulation of IFNG signaling, hence may play an adaptive role in the maintainance of metabolic homeostasis. Following alkali activation, may also be permeable Na(+), K(+), Cs(+) and Li(+) (By similarity)