This project is a small, inspectable simulation of the central dogma:
DNA gene --transcription--> messenger RNA --ribosome--> amino-acid sequence / protein
It is intentionally a molecule-count model, not a chemically complete cell. A simulation step represents completed transcription and translation events. The cell keeps track of its genome, individual mRNA molecules, ribosomes, and protein copy counts. mRNA and proteins can degrade over time.
Python is the best starting point for the simulation core because it has a strong scientific ecosystem (NumPy, SciPy, JAX, PyTorch, BioPython) and makes model rules easy to inspect and change. If this becomes an interactive visual application, keep the simulation as a separate Python package or service and add a TypeScript/ JavaScript front end. If performance later becomes a bottleneck, profile first, then move only the hot loops to JAX, Rust, or C++.
No third-party packages are required.
python -m simple_cell examples/minimal_genome.fasta --steps 15 --seed 7
python -m unittest discover -s tests -vThe interactive viewer is a Next.js application in visualizer/. It mirrors the
Python model's update order in the browser and renders the cell with Three.js and
React Three Fiber.
cd visualizer
npm install
npm run devThen open http://localhost:3000. Use Play, Pause, Step, and Reset to control
time; drag the cell to orbit and scroll to zoom.
Each FASTA record is treated as one already-annotated protein-coding gene. For example:
>green_gene
ATGAAACCCGGGTTTTAA
The coding DNA must start with ATG, end with an in-frame stop codon (TAA,
TAG, or TGA), and contain only A, C, G, and T.
Useful options:
python -m simple_cell --help
python -m simple_cell examples/minimal_genome.fasta \
--steps 50 --ribosomes 20 --transcription-rate 0.8transcription_rate: expected completed mRNA copies per gene per unit timetranslation_rate: expected completed proteins per ribosome per unit timeribosomes: a shared translation-capacity limit across all mRNAs- half-lives: stochastic degradation of individual mRNA and protein molecules
This is useful for learning and for establishing the software architecture. It does not yet model promoters, transcription factors, introns, alternative splicing, tRNA abundance, protein folding, metabolism, membranes, cell division, or spatial chemistry.
- Add gene regulation, metabolites, ATP/resource costs, and feedback loops.
- Give each cell a stable
step(dt, environment)interface. - Place many cells on a 2D or 3D grid with nutrient and signal diffusion.
- Add division, death, differentiation, adhesion, and simple mechanics.
- Validate each layer against known behavior before increasing scale.
- Connect a learned world model to predict, control, or accelerate the simulator; keep the mechanistic state and rules as a testable ground truth.
The most important scaling rule is to keep biology, simulation scheduling, and visualization separate. That lets the same Python cell run in a terminal today, inside a tissue simulator later, and behind a browser UI eventually.