Explore a Cancer Protein with AlphaFold
Fetch p53 data, mark R175, and report AlphaFold confidence limits.
Introduction
30 Second Summary
A colourful scientific picture can feel convincing before you know where its numbers came from. Public data becomes easier to judge when every claim leads back to its source.
In this project, you will turn public records for the human p53 protein into a local 3D view with position 175 marked. You will write a plain-English report whose numbers trace back to UniProt and the AlphaFold Protein Structure Database.
What You'll Build
Your finished page at http://localhost:8000/viewer.html lets you spin the normal p53 model around a magenta R175 marker while your sourced report explains exactly what the picture supports.
By the end of this project, you'll have:
- A repeatable p53 check that uses public REST APIs to print the protein name, gene, length, reference residue, local confidence, and model version.
- An interactive 3D viewer built with 3Dmol.js and served from a local server. You can spin normal p53, zoom into its shape, and spot R175 against colours that represent pLDDT confidence.
- A traceable plain-English report where every number can be checked against protein_facts.json. Its limits make clear that the normal model does not show the R175H mutant or predict its effect.
- Secret Mission: Generalise the explorer to compare confidence at KRAS position 12 and BRAF position 600 while keeping both displayed structures normal.
Are there any prerequisites?
This project needs an internet-connected Mac running macOS 13.0+ or a Windows computer running Windows 10 1809+.
Claude Code requires an eligible paid Claude or Console account, with Claude Pro costing $20 for one month when billed monthly before applicable tax.
Step 1 walks you through installing Claude Code and Python 3.15.2.
Before We Start
Before any tools or files enter the picture, lock in the purpose and limits of this exploration. You are examining position 175 on normal human p53 as a learning exercise without drawing a medical conclusion.
Set Up Claude Code and Python
This project needs one AI coding tool and one standard runtime before it can create or run any files. You will prepare Claude Code and Python for that work.
Claude Code will create the project files from your requests. Python will run the data-fetching script using its standard library.
In this step, get ready to:
- Install Claude Code. Its version check shows a version number followed by (Claude Code).
- Install Python 3.15.2. Its version check shows Python 3.15.2.
- Create the Desktop folder protein-explorer. Claude Code reports that it is running from that folder.
Prepare Claude Code
Claude Code runs inside a terminal session. Its native installer sets up the command that starts the tool.
macOS
- Press Cmd+Space to open macOS search.
- Search for your terminal app.
- Select the terminal app from the results.
- Install Claude Code by running this command:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?
This command downloads Anthropic's native macOS installer script. The script installs the claude command on your computer.
You should see the installer finish without an error.
Windows
- Press the Windows key to open Windows search.
- Type PowerShell.
- Select Windows PowerShell from the results.
- Install Claude Code by running this command:
irm https://claude.ai/install.ps1 | iex
What does this command do?
This command downloads Anthropic's native PowerShell installer script. The script installs the claude command on your computer.
You should see the installer finish without an error.
- Close the terminal window used for installation.
- Select the close control on the terminal window.
- Start a fresh terminal session.
macOS
- Press Cmd+Space to open macOS search.
- Search for your terminal app.
- Select the terminal app from the results.
Windows
- Press the Windows key to open Windows search.
- Type PowerShell.
- Select Windows PowerShell from the results.
- Verify the Claude Code installation by running:
claude --version
What does this command do?
The version check asks your installed Claude Code command to identify itself. It confirms that the fresh terminal session can find the installation.
You should see a version number followed by (Claude Code).
Claude command still unavailable?
If the terminal cannot find claude, close every terminal window. Start a new terminal session before trying the version check again.
If Windows shows 'irm' is not recognized, run the installer in PowerShell. Command Prompt does not recognise that PowerShell command.
Help me diagnose my Claude Code installation.
Prepare Python
The project uses Python's standard library to request public protein data. Python 3.15.2 provides everything the script needs without installing extra packages.
macOS
- Open the Python macOS downloads page.
- Download the signed .pkg installer for Python 3.15.2.
- Find the Python 3.15.2 release on the downloads page.
- Select its macOS installer package.
- Install Python 3.15.2 with the downloaded .pkg package.
- Open your browser's downloads list.
- Open the downloaded .pkg package.
- Continue through the installer using its default options.
You should see the installer report that Python was installed successfully.
Windows
- Open the Python Windows downloads page.
- Download the Python install manager from python.org.
- Find the Python install manager on the downloads page.
- Select its download for Windows.
- Install the downloaded Python install manager.
- Open the downloaded installer package.
- Select Install when prompted.
The manager may ask you to confirm the runtime download. That confirmation authorises the Python installation on your computer.
- Install the current Python 3.15 runtime by running:
py install 3.15
What does this command do?
The Python install manager downloads the current release in the Python 3.15 series. The current release is Python 3.15.2.
- Approve the runtime installation if the manager asks for confirmation.
You should see the runtime download and installation complete.
The version check now tells you whether the correct Python runtime is active.
macOS
- Verify Python by running:
python3 --version
What does this command do?
The python3 command starts the installed Python 3 runtime. The version option prints its release number without opening an interactive session.
You should see Python 3.15.2.
Windows
- Verify Python by running:
py --version
What does this command do?
The py command launches the default runtime managed on Windows. The version option prints its release number without opening an interactive session.
You should see Python 3.15.2.
✔️ I see Python 3.15.2
Python 3.15.2 is ready for the project.
ⓧ I see an older version
An older runtime cannot confirm the environment required by this project. Update the installation before continuing.
macOS
- Return to the Python macOS downloads page.
- Download the signed .pkg installer for Python 3.15.2.
- Install the downloaded package using its default options.
- Verify the updated runtime by running:
python3 --version
What does this command do?
This check prints the version used by the python3 command after the update.
You should now see Python 3.15.2.
Windows
- Open the official Python Windows installation guide.
- Use its Python install manager instructions to update your Python 3.15 runtime.
- Verify the updated runtime by running:
py --version
What does this command do?
This check prints the default runtime version selected by the Python install manager.
You should now see Python 3.15.2.
ⓧ Command not found
The terminal cannot reach a Python launcher yet. Reinstall the platform-specific tool before repeating the check.
macOS
- Open the Python macOS downloads page.
- Download the signed .pkg installer for Python 3.15.2.
- Install the downloaded package using its default options.
- Cancel any offer to install command line developer tools.
- Verify the new installation by running:
python3 --version
What does this command do?
This check asks the newly installed python3 launcher to print its version.
You should see Python 3.15.2.
Windows
- Open the Python Windows downloads page.
- Download the Python install manager.
- Install the downloaded manager.
- Start a fresh PowerShell session.
- Install the current Python 3.15 runtime by running:
py install 3.15
What does this command do?
The manager downloads the current Python 3.15 runtime for Windows.
- Verify the installed runtime by running:
py --version
What does this command do?
This check prints the default Python runtime version selected on Windows.
You should see Python 3.15.2.
Connect Claude Code to the project folder
A terminal command runs from its current folder. Starting Claude Code inside protein-explorer gives it the correct workspace for every file created later.
The browser handles your account credentials during the first sign-in. Your password stays out of the terminal.
- Create the Desktop project folder and start Claude Code inside it by running these commands:
cd ~/Desktop
mkdir protein-explorer
cd protein-explorer
claude
What does this command do?
- The first command moves the terminal to your Desktop.
- The second command creates the protein-explorer folder.
- The third command moves the terminal into that folder.
- The final command starts Claude Code from the folder.
You should see Claude Code start in the terminal. First-time users see a browser sign-in request.
- Complete the browser sign-in with an eligible Claude Pro, Max, Ultra, Team, Enterprise, or Console account.
- Follow the sign-in prompt from Claude Code into your browser.
- Finish the account authorisation in the browser.
- Return to the original terminal session.
You should return to a running Claude Code session in the terminal.
Sign-in blocked by your plan?
Claude Code requires an eligible Pro, Max, Ultra, Team, Enterprise, or Console account. The free Claude plan does not include Claude Code.
Help me understand my Claude Code access options.
Before you ask, where do you think Claude Code will say it is working?
- Ask Claude Code to report its current folder by entering:
What folder are we in?
What does this prompt do?
Claude Code checks the terminal's current folder. Its response confirms which workspace it can use for future file edits.
Claude Code's wording can vary. The path it reports ends in protein-explorer.
You have cleared the setup hurdle. Claude Code is running from the empty folder that will hold the project files.
Your coding environment is ready. Next, you will fetch checked facts about normal human p53 and download its predicted model.
Fetch Normal p53 Data
Your Claude Code session is ready inside protein-explorer. You can now turn public protein records into evidence stored on your computer.
The public viewer gives you an early look at normal p53, but it cannot yet support a checked report or identify R175 for this project.
In this step, get ready to:
- Inspect normal p53 in Mol*. Confirm position 175 has no project marker.
- Create fetch_protein.py. It records UniProt facts in protein_facts.json plus the API-provided AlphaFold model.
- Run the script. Its output shows the checked p53 values plus both generated filenames.
Inspect the normal p53 model
The Mol* Viewer can load the public normal p53 prediction directly. This gives you a quick visual check before you create any local files.
Before you open the model, do you think the public view will already identify position 175 for your report?
- Open the Mol* p53 viewer.
- Drag the model to spin it.
You'll see the normal p53 model. Position 175 has no project marker.
That shortfall is intentional. The public model proves the structure is accessible, while the missing marker shows why your project needs its own checked data and viewer.
Create the data-fetching script
The script fetches the reviewed UniProt record through a REST API. AlphaFold Protein Structure Database metadata supplies the model address that Python downloads.
- Switch back to the Claude Code session from earlier.
- Ask Claude Code to create the script by pasting this exact request:
Create `fetch_protein.py` using only Python's standard library. It asks UniProt for P04637 at `https://rest.uniprot.org/uniprotkb/P04637.json` and AlphaFold DB at `https://alphafold.ebi.ac.uk/api/prediction/P04637`. Save the model from the `pdbUrl` field into this folder with Python, not curl. Save the protein name, gene, length, the UniProt function text, the UniProt natural variant at position 175 that changes R to H, the residue at position 175, the pLDDT at residue 175 read from the model file's B-factor column, and the model version into `protein_facts.json`. Print each one on its own line. Don't run it yet.
What does this request ask Claude Code to build?
- The standard-library requirement keeps the project free from package installation and environment setup.
- The pdbUrl field lets the AlphaFold API choose the current model filename.
- The model's B-factor column stores per-residue pLDDT confidence values.
- Approve the proposed edit to fetch_protein.py.
- When Claude Code asks for file-edit permission, choose the option that approves this edit.
You'll see a proposed file named exactly fetch_protein.py.
The finished script should match the baseline below before you run it.
✔️ My file matches
- Save fetch_protein.py.
ⓧ Let me check the full code
- Use this exact baseline to correct any differences in fetch_protein.py.
import json
from pathlib import Path
from urllib.request import Request, urlopen
UNIPROT_URL = "https://rest.uniprot.org/uniprotkb/P04637.json"
ALPHAFOLD_API_URL = "https://alphafold.ebi.ac.uk/api/prediction/P04637"
USER_AGENT = "Mozilla/5.0 protein-explorer-learning-project"
def fetch_bytes(url):
request = Request(url, headers={"User-Agent": USER_AGENT})
with urlopen(request) as response:
return response.read()
def fetch_json(url):
return json.loads(fetch_bytes(url).decode("utf-8"))
def find_r175h_variant(features):
for feature in features:
location = feature.get("location", {})
start = location.get("start", {}).get("value")
end = location.get("end", {}).get("value")
alternative = feature.get("alternativeSequence", {})
if (
feature.get("type") == "Natural variant"
and start == 175
and end == 175
and alternative.get("originalSequence") == "R"
and "H" in alternative.get("alternativeSequences", [])
):
return {
"feature_id": feature.get("featureId"),
"change": "R175H",
"description": feature.get("description"),
}
raise ValueError("UniProt did not return the expected R175H natural variant.")
def read_ca_plddt(pdb_text, residue_number):
for line in pdb_text.splitlines():
if not line.startswith("ATOM"):
continue
atom_name = line[12:16].strip()
residue = int(line[22:26])
if atom_name == "CA" and residue == residue_number:
return round(float(line[60:66]), 2)
raise ValueError(f"No CA atom found for residue {residue_number}.")
def main():
uniprot = fetch_json(UNIPROT_URL)
predictions = fetch_json(ALPHAFOLD_API_URL)
model = next(
item
for item in predictions
if item.get("entryId") == "AF-P04637-F1"
and item.get("uniprotAccession") == "P04637"
)
pdb_url = model["pdbUrl"]
model_filename = pdb_url.rsplit("/", 1)[-1]
pdb_bytes = fetch_bytes(pdb_url)
Path(model_filename).write_bytes(pdb_bytes)
pdb_text = pdb_bytes.decode("utf-8")
function_text = next(
comment["texts"][0]["value"]
for comment in uniprot["comments"]
if comment.get("commentType") == "FUNCTION"
)
sequence = uniprot["sequence"]["value"]
facts = {
"protein_name": uniprot["proteinDescription"]["recommendedName"]["fullName"]["value"],
"gene": uniprot["genes"][0]["geneName"]["value"],
"length": uniprot["sequence"]["length"],
"function": function_text,
"variant": find_r175h_variant(uniprot["features"]),
"position": 175,
"reference_residue": sequence[174],
"plddt_at_175": read_ca_plddt(pdb_text, 175),
"model_version": model["latestVersion"],
"model_file": model_filename,
"sources": {
"uniprot": UNIPROT_URL,
"alphafold": ALPHAFOLD_API_URL,
},
}
Path("protein_facts.json").write_text(
json.dumps(facts, indent=2, ensure_ascii=False),
encoding="utf-8",
)
print(f"Protein: {facts['protein_name']}")
print(f"Gene: {facts['gene']}")
print(f"Length: {facts['length']}")
print(f"Variant: {facts['variant']['change']}")
print(f"Residue 175: {facts['reference_residue']}")
print(f"pLDDT at 175: {facts['plddt_at_175']:.2f}")
print(f"Model version: {facts['model_version']}")
print(f"Model file: {facts['model_file']}")
print("Facts file: protein_facts.json")
if __name__ == "__main__":
main()
- Save fetch_protein.py after correcting the differences.
Run the script and check the evidence
The script writes the normal p53 model as a PDB file before saving its checked facts as JSON. Its printed lines give you a quick way to compare the downloaded data with the expected record.
- Keep the Claude Code session from earlier running in the first terminal.
- Start a second terminal window.
- Press Cmd+Space on macOS or the Windows key on Windows to open your search bar.
- Type Terminal on macOS or PowerShell on Windows.
- Press Enter to start the second terminal.
- Move the second terminal into protein-explorer by running the commands for your operating system:
macOS
cd ~/Desktop
cd protein-explorer
What do these commands do?
The first command moves to your Desktop. The second command enters the existing protein-explorer folder.
Windows
cd ~/Desktop
cd protein-explorer
What do these commands do?
The first command moves to your Desktop. The second command enters the existing protein-explorer folder.
Before you run the script, which p53 facts and generated filenames do you expect the terminal to show?
- Run fetch_protein.py with the command for your operating system:
macOS
python3 fetch_protein.py
What does this command do?
Python runs fetch_protein.py from the current folder. The script fetches both public records before writing the facts file and model file.
Windows
py fetch_protein.py
What does this command do?
The Python launcher runs fetch_protein.py from the current folder. The script fetches both public records before writing the facts file and model file.
You'll see Cellular tumor antigen p53, TP53, and length 393 in the printed checks.
The variant checks show R175H plus reference residue R at position 175.
The confidence checks show pLDDT 96.62 plus model version 6.
The final lines name AF-P04637-F1-model_v6.pdb plus protein_facts.json.
That is your evidence chain working. The normal p53 model and its traceable facts now live together in protein-explorer.
Download or residue check failed?
- If the download mentions HTTP Error 403, ask Claude Code to keep Python's urllib.request download and send a browser-style User-Agent header.
- If pLDDT is above 100 or the residue is wrong, ask Claude Code to read only the CA atom for residue 175.
Help me diagnose my p53 data-fetching script.
Your checked p53 data is ready. Next, you'll turn the downloaded model into a local 3D view with position 175 clearly marked.
Mark Position 175 in 3D
Your checked p53 facts and downloaded AlphaFold DB model are ready in protein-explorer. Now you can turn those files into a visual that points directly to the position discussed in your report.
The public viewer leaves position 175 unmarked for your report.
In this step, get ready to:
- Create a local viewer that colours normal p53 by confidence and marks position 175.
- Serve the viewer from protein-explorer on port 8000.
- Confirm the magenta R175 marker appears in a blue very-high-confidence region and capture a screenshot.
Build the marked viewer
The downloaded PDB file stores each residue's pLDDT in its B-factor field.
3Dmol.js 2.5.5 can turn those values into four confidence colours. A separate magenta style makes position 175 easy to find.
- In Claude Code from earlier, create viewer.html by pasting this exact request:
Create `viewer.html` that loads 3Dmol.js 2.5.5 from `https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.5.5/3Dmol-min.js`, loads `AF-P04637-F1-model_v6.pdb` from this folder, shows it as a cartoon coloured by the B-factor (pLDDT) from orange for low to blue for high, shows residue 175 as sticks in magenta with a label `R175`, adds a small colour key for the four pLDDT bands, and zooms to fit.
What does this request do?
- The page loads the exact model file downloaded by fetch_protein.py.
- The plddtColour(atom) function maps B-factor values to the four confidence colours.
- The resi: 175 selection adds magenta sticks and the R175 label.
- The page states the normal-model limitation beside the viewer.
- Approve the proposed viewer.html edit in Claude Code.
- At Claude Code's permission prompt, choose the option that allows this file edit.
You should see a new file named viewer.html in protein-explorer.
The exact filenames and selectors matter because the browser loads your downloaded model by name.
✔️ I'll try it first
Your viewer file is ready for its browser check.
ⓧ Let me check my work
- Compare viewer.html with this complete reference:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Normal p53 with position 175 marked</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.5.5/3Dmol-min.js"></script>
<style>
html, body { height: 100%; margin: 0; font-family: Arial, sans-serif; }
#viewer { position: absolute; inset: 0; }
.panel {
position: absolute; z-index: 2; top: 16px; left: 16px;
max-width: 330px; padding: 12px; border-radius: 8px;
background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.panel h1 { margin: 0 0 8px; font-size: 18px; }
.panel p { margin: 6px 0; font-size: 14px; line-height: 1.35; }
.key { display: grid; grid-template-columns: 16px 1fr; gap: 6px 8px; align-items: center; }
.swatch { width: 16px; height: 16px; border-radius: 3px; }
.very-high { background: #0053d6; }
.confident { background: #65cbf3; }
.low { background: #ffdb13; }
.very-low { background: #ff7d45; }
#status { font-weight: 700; }
</style>
</head>
<body>
<div id="viewer"></div>
<section class="panel">
<h1>Normal human p53</h1>
<p id="status">Loading the model...</p>
<p>Magenta marks position 175. This is not a mutant model and does not show the effect of R175H.</p>
<div class="key" aria-label="pLDDT colour key">
<span class="swatch very-high"></span><span>Above 90: very high</span>
<span class="swatch confident"></span><span>70 to 90: confident</span>
<span class="swatch low"></span><span>50 to 70: low</span>
<span class="swatch very-low"></span><span>Below 50: very low</span>
</div>
</section>
<script>
const viewerElement = document.getElementById("viewer");
const viewer = new $3Dmol.GLViewer(viewerElement, { backgroundColor: "white" });
function plddtColour(atom) {
if (atom.b > 90) return "#0053d6";
if (atom.b >= 70) return "#65cbf3";
if (atom.b >= 50) return "#ffdb13";
return "#ff7d45";
}
fetch("AF-P04637-F1-model_v6.pdb")
.then((response) => {
if (!response.ok) throw new Error(`Model request failed: ${response.status}`);
return response.text();
})
.then((pdbText) => {
viewer.addModel(pdbText, "pdb");
viewer.setStyle({}, { cartoon: { colorfunc: plddtColour } });
viewer.addStyle({ resi: 175 }, { stick: { colorscheme: "magentaCarbon", radius: 0.3 } });
const ca = viewer.selectedAtoms({ resi: 175, atom: "CA" })[0];
viewer.addLabel("R175", {
position: ca,
fontColor: "white",
backgroundColor: "magenta",
backgroundOpacity: 0.9,
borderThickness: 1,
borderColor: "white",
inFront: true
});
viewer.zoomTo();
viewer.render();
document.getElementById("status").textContent = "Model loaded. Drag to spin and scroll to zoom.";
})
.catch((error) => {
document.getElementById("status").textContent = error.message;
});
</script>
</body>
</html>
What does this code do?
- The HTML builds a full-screen viewer with a small information panel.
- The script colours each atom using the b value read from the PDB file.
- The residue selection marks position 175 without changing the normal model.
- The status text reports whether the model loaded successfully.
- Correct any differences in viewer.html before continuing.
Serve the project folder locally
The viewer fetches the model as a separate local file. A local server gives the page a browser address that can serve both files.
The server keeps the second terminal busy until you stop it with Ctrl+C.
macOS
- In the second terminal from earlier, start the server from protein-explorer by running this command:
python3 -m http.server 8000
What does this command do?
The -m option runs Python's standard-library http.server module.
The value 8000 sets the local port used by your browser.
Windows
- In the second terminal from earlier, start the server from protein-explorer by running this command:
py -m http.server 8000
What does this command do?
The py launcher starts Python. The -m option runs the standard-library http.server module.
The value 8000 sets the local port used by your browser.
You should see the second terminal remain active while the server waits for browser requests.
Verify the R175 view
Your fetched facts record a pLDDT of 96.62 at position 175. The viewer's colour key places values above 90 in its very-high-confidence band.
Before you open the page, which colour band do you expect position 175 to use?
- Open http://localhost:8000/viewer.html in your browser.
You should see the normal p53 cartoon with a magenta R175 label in a blue very-high-confidence region.
The panel identifies the structure as normal human p53. It also states that the viewer does not show a mutant model or the effect of R175H.
- Spin the model to view the R175 marker from another angle.
- Drag anywhere on the 3D model.
- Zoom until the marker and nearby structure are clear.
- Scroll over the 3D model.
You should still see the magenta marker attached to position 175 as the model moves.
Can't see the R175 marker?
- If the page was opened directly from the file, return to http://localhost:8000/viewer.html.
- If port 8000 is occupied, stop the process already using that port before restarting the server.
- If the model stays one colour, ask Claude Code to colour by the atom b property while keeping the four pLDDT bands.
Help me debug my local p53 viewer.
That is the visual proof in place: your normal p53 model now shows exactly where position 175 sits. Next, you will turn the checked facts into a plain-English report.
Write a Plain-English Report
Claude Code has turned public data into a viewer where position 175 is visible on normal p53. Your final deliverable needs a written explanation whose limits are as prominent as its picture.
Raw protein data and a striking 3D picture are easy to overstate, so this step makes every claim traceable to protein_facts.json.
In this step, get ready to:
- Create report.md with its learning caution, five requested sections, four pLDDT bands, and source links.
- Verify 393, 175, 96.62, and 6 against protein_facts.json so every reported value matches.
- State that AlphaFold DB supplies a normal model that cannot show what R175H does or predict mutation effects.
Create the report from checked facts
A Markdown report keeps the explanation readable beside its source data. Clear data provenance lets someone trace each reported value back to the downloaded record.
- Paste this exact request into Claude Code:
Write `report.md` for someone with no biology background. Use only facts in `protein_facts.json`. Sections: What p53 does, Where R175H sits, How sure AlphaFold is (explain the pLDDT bands: above 90 very high, 70 to 90 confident, 50 to 70 low, below 50 very low), What this model can't tell us, and Sources with the UniProt and AlphaFold links. Start with one line saying it is for learning, not medical advice. Don't suggest any treatment and don't use the word cure.
What does this prompt do?
- The source boundary limits every factual statement to protein_facts.json.
- The requested headings give confidence and model limitations dedicated sections.
- The Sources section points readers to the recorded UniProt and AlphaFold DB links.
- Approve the report.md file edit when Claude Code asks for permission.
Good progress. You should see report.md appear beside protein_facts.json with the learning caution on its first line.
Don't see report.md?
- Check that Claude Code is still working inside protein-explorer.
- Paste the original report request again if Claude Code only explains the task without proposing a file edit.
Help me create report.md in the correct project folder.
Check each number against the JSON record
The JSON file is the report's evidence record. Each number earns its place when the report and record agree exactly.
- Open the report in one browser window at http://localhost:8000/report.md.
- Open the source data in a second browser window at http://localhost:8000/protein_facts.json.
- Position the report window on the left half of your screen.
- Drag the report window by its title bar.
- Resize the report window from its right edge.
- Position the JSON window on the right half of your screen.
- Drag the JSON window by its title bar.
- Resize the JSON window from its left edge.
- Match 393 in the report to length in the JSON.
- Match 175 in the report to position in the JSON.
- Match 96.62 in the report to plddt_at_175 in the JSON.
- Match 6 in the report to model_version in the JSON.
You should find the same four values in both files. Each match proves that the report is using the downloaded record.
- Ask Claude Code to remove unsupported sentences by pasting this request:
Remove any sentence from `report.md` whose fact is absent from `protein_facts.json`.
Why run this source check?
The request uses the JSON as a boundary for the report. This keeps plausible-sounding additions from becoming unsupported claims.
Claude Code should remove any unsupported sentence or confirm that every report fact appears in protein_facts.json.
Confirm the report's safety limits
A confidence score describes the model at a particular position. The report also needs to state what the normal AlphaFold model cannot establish.
- Confirm the first line says the report is for learning and not medical advice.
- Confirm the report contains the headings What p53 does, Where R175H sits, How sure AlphaFold is, What this model can't tell us, and Sources.
- Confirm the confidence section describes above 90 as very high.
- Confirm the confidence section describes 70 to 90 as confident.
- Confirm the confidence section describes 50 to 70 as low.
- Confirm the confidence section describes below 50 as very low.
- Confirm the Sources section contains the URLs recorded under sources in protein_facts.json.
The JSON contains no facts about Rosie. A reference to her would fall outside the evidence boundary for this report.
- Confirm the limits section says AlphaFold DB supplies a normal human p53 model.
- Confirm the limits section says the viewer only marks position 175.
- Confirm the limits section says the model cannot show what R175H does.
- Confirm the limits section says AlphaFold has not been validated for predicting mutation effects.
- Remove any line that introduces treatments, survival figures, drug names, or facts outside protein_facts.json.
- Remove any mention of Rosie because her story is absent from protein_facts.json.
- Confirm the report does not use the word cure.
Before the final check, do you expect every number and limitation in the report to trace back to the JSON record?
- Refresh the report page at http://localhost:8000/report.md.
- Press Cmd+R on macOS or Ctrl+R on Windows.
You should see the learning caution first. The requested sections should follow with the checked values, source links, four confidence bands, and normal-model limitation.
You now have a sourced report that explains the p53 data without stretching beyond what the downloaded evidence supports.
Secret mission
Compare a Confident Position with an Unsure Position
Generalize your explorer so it can load KRAS position 12 and BRAF position 600. Compare their local pLDDT bands, then add the normal-model limitation to your report.
Clean Up Your Resources
Clean Up Your Resources
Your project files and Python local server are local resources with no ongoing cloud costs. Decide whether to keep the project active, pause the server for later, or remove the local folder.
Claude Billing Stays Separate
Deleting protein-explorer does not cancel the Claude plan that gives you access to Claude Code. Its charges continue according to your existing subscription.
Resources you used:
- The Desktop protein-explorer folder containing your scripts, report, JSON facts files, and downloaded PDB models.
- The Python local server serving your viewer on port 8000.
Keep everything running
No action needed. Choose this if you are still comparing protein positions or updating your report.
- Leave the terminal running the local server open while you use the viewer.
- Keep protein-explorer on your Desktop for future comparisons.
- Leave Claude Code open if you plan to continue editing the explorer.
Pause - I'll come back to this later
Stop the local server to free port 8000 while preserving every project file. You can restart it from the same folder when you return.
- Return to the terminal running the Python local server.
- Press Ctrl+C to stop the server.
You should see the terminal return to a command prompt.
- Leave protein-explorer on your Desktop.
Restarting the server makes the viewer available again. The server takes over that terminal until you stop it with Ctrl+C.
macOS
- Restart the local server from the terminal still set to protein-explorer by running this command:
python3 -m http.server 8000
What does this command do?
Python starts a basic web server on port 8000 from the folder selected in the terminal.
- Return to http://localhost:8000/viewer.html in your browser.
You should see the normal p53 model with position 175 selected by default.
Windows
- Restart the local server from the terminal still set to protein-explorer by running this command:
py -m http.server 8000
What does this command do?
Python starts a basic web server on port 8000 from the folder selected in the terminal.
- Return to http://localhost:8000/viewer.html in your browser.
You should see the normal p53 model with position 175 selected by default.
Delete - I don't want to use this again
This deletion only affects the local project folder and its running server. Your Claude plan remains separate from these resources.
- Return to the terminal running the Python local server.
- Press Ctrl+C to stop the server.
- Close the terminal window running Claude Code.
- Move protein-explorer to Trash on macOS or Recycle Bin on Windows.
- Confirm that protein-explorer no longer appears on your Desktop.
- Cancel your Claude subscription separately in Claude account billing if you no longer want it.
Cleanup complete. Your local project is no longer active on your Desktop.
Nice Work!
Nice Work!
Strong finish! You built a local protein explorer that turns public records into an interactive view. Your sourced report keeps every claim tied to the downloaded data.
You've learned how to:
- Build a standard-library Python script that fetches protein facts from UniProt. The script follows the AlphaFold DB API model link. It records local pLDDT from the downloaded structure.
- Serve an interactive 3Dmol.js viewer that colours normal predicted proteins by confidence. The viewer marks a selected residue without presenting a mutant structure or mutation effect.
- Use data provenance to trace report numbers back to protein_facts.json. Explain model confidence in plain English. Keep medical claims outside the evidence.
- Secret Mission: Generalised the explorer to compare very-high-confidence KRAS position 12 with very-low-confidence BRAF position 600. Both markers remain grounded in normal predicted proteins.
Ready to quiz yourself?