import requests
def render_html(pdb_id, chain):
if pdb_id is None or chain is None:
return ""
html = f"""
"
"""
iframe = f"""
"""
return iframe
def get_pdb_title(pdb_id: str):
url = f"https://data.rcsb.org/rest/v1/core/entry/{pdb_id}"
response = requests.get(url, timeout=1)
if response.ok:
data = response.json()
protein_name = data["struct"]["title"]
else:
protein_name = "Unknown"
return protein_name