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
= "P58743"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: P58743
Protein Name: Prestin
Organism: Homo sapiens
Function: Voltage-sensitive motor protein that drives outer hair cell (OHC) electromotility (eM) and participates in sound amplification in the hearing organ (By similarity). Converts changes in the transmembrane electric potential into mechanical displacements resulting in the coupling of its expansion to movement of a charged voltage sensor across the lipid membrane (By similarity). The nature of the voltage sensor is not completely clear, and two models compete. In the first model, acts as an incomplete transporter where intracellular chloride anion acts as extrinsic voltage sensor that drives conformational change in the protein which is sufficient to produce a length change in the plane of the membrane and hence in the length of the OHC (By similarity). The second model in which multiple charged amino acid residues are distributed at the intracellular and extracellular membrane interfaces that form an intrinsic voltage sensor, whose movement produces the non-linear capacitance (NLC) (PubMed:34390643). However, the effective voltage sensor may be the result of a hybrid voltage sensor, assembled from intrinsic charge (charged residues) and extrinsic charge (bound anion) (By similarity). Notably, binding of anions to the anion-binding pocket partially neutralizes the intrinsic positive charge rather than to form an electrically negative sensor, therefore remaining charge may serve as voltage sensor that, after depolarization, moves from down (expanded state) to up (contracted) conformation, which is accompanied by an eccentric contraction of the intermembrane cross-sectional area of the protein as well as a major increase in the hydrophobic thickness of the protein having as consequences the plasma membrane thickening and the cell contraction after membrane depolarization (PubMed:34390643). The anion-binding pocket transits from the inward-open (Down) state, where it is exposed toward the intracellular solvent in the absence of anion, to the occluded (Up) state upon anion binding (PubMed:34390643). Salicylate competes for the anion-binding site and inhibits the voltage-sensor movement, and therefore inhibits the charge transfer and electromotility by displacing Cl(-) from the anion-binding site and by preventing the structural transitions to the contracted state (PubMed:34390643). In addition, can act as a weak Cl(-)/HCO3(-) antiporter across the cell membrane and so regulate the intracellular pH of the outer hair cells (OHCs), while firstly found as being unable to mediate electrogenic anion transport (By similarity). Moreover, supports a role in cardiac mechanical amplification serving as an elastic element to enhance the actomyosin- based sarcomere contraction system (By similarity)