Skip to content

albert-mathews/TEM_improbability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git repo for this article:

https://open.substack.com/pub/albertmathews/p/improbable-electron-microscope-image?r=4qbc35&utm_campaign=post&utm_medium=web&showWelcomeOnShare=false

Why the “perfect rings” in herpesvirus EM images are geometrically extraordinary

License: MIT

This repository contains pure-Python tools that let anyone reproduce the simple but shocking geometric calculation that can be done to investigate images b and c from: https://pmc.ncbi.nlm.nih.gov/articles/PMC6146708/figure/F8/ (copied versions also in repo for reference). See ref [1] for source publication.

In a random 3D distribution of ~120 nm spherical capsids imaged in an 80 nm thin section, the probability that 25 capsids all show near-perfect 100+ nm rings with no obvious small arcs is approximately 1 in 6 million (and both Figure 8b + 8c together ≈ 1 in a trillion).

This calculation does not need to reference any publications in virology for vlidation, it stands on it's own. Justthe images, geometry and scale bars are needed.

Files

File What it does
capsid_section_probability.py Analytic (exact) calculation of the 1-in-millions result used in the final answer
capsid_section_monte_carlo.py Monte-Carlo version + histogram of expected chord diameters
visualize_random_vs_planar.py 3-D matplotlib visualisation: random distribution (expected) vs perfectly planar (observed)
projected_tem_view_simulation.py Generates fake “TEM micrographs” showing what each scenario actually looks like in 2-D projection

All scripts are heavily commented, require only numpy and matplotlib, and run with a single python scriptname.py.

Quick demo

python capsid_section_probability.py

Output (as of 2025 parameters):

Capsid diameter       : 120.0 nm
Section thickness     : 80.0 nm
Threshold diameter    : 100.0 nm
Probability one capsid looks >= 100 nm : 0.53513

Figure 8b (~25 capsids)       → P(all full) = 1.70e-07  (1 in 5,891,657)
Figure 8c (~20 capsids)       → P(all full) = 1.29e-05  (1 in 77,529)

Run the other scripts to see the histograms and pictures — the visualisations make the statistical claim instantly obvious to anyone.

Why this repository exists

Classic thin-section TEM images of herpesviruses (and many other large viruses) routinely show fields of dozens of nearly identical ~100–120 nm rings.
Under the standard assumptions (spherical particles, random 3-D positions, honest ~70–100 nm sections), this is many-sigma impossible without extreme ordering or selection.

These scripts let anyone verify that claim in < 10 seconds, change the numbers (capsid size, section thickness, threshold), and see for themselves.

References

[1] Mariamé B, Kappler-Gratias S, Kappler M, Balor S, Gallardo F, Bystricky K. Real-Time Visualization and Quantification of Human Cytomegalovirus Replication in Living Cells Using the ANCHOR DNA Labeling Technology. J Virol. 2018 Aug 29;92(18):e00571-18. doi: 10.1128/JVI.00571-18. PMID: 29950406; PMCID: PMC6146708. (https://pmc.ncbi.nlm.nih.gov/articles/PMC6146708/)

License

MIT License – do whatever you want with the code (commercial use, modification, sale, etc.). See LICENSE for the full text.

Feel free to cite or link this repo when you need to show — with actual math — why those “textbook perfect” viral capsid micrographs are geometrically astonishing.

— November 2025

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages