A Python-based visualization tool that demonstrates genetic inheritance patterns across multiple generations. The program creates SVG diagrams showing how genetic traits are passed down through families, using a grid-based representation for genetic information.
- Clone the repository:
git clone https://github.com/DigitalArchivst/genetic-inheritance-visualizer.git
cd genetic-inheritance-visualizer
- Install dependencies:
pip install -r requirements.txt
- Visualizes 2-4 generations of genetic inheritance
- Uses an 8x8 grid to represent 64 pieces of genetic information for each individual
- Simulates inheritance through independent probability for each genetic position
- Generates clear, scalable SVG diagrams
- Supports multiple trait pairs with different colors
Run the script and follow the prompts to specify the number of generations (2-4):
python genetic-inheritance-complete-v21.py
The program will generate an SVG file that can be viewed in any web browser.
Each person is represented by an 8x8 grid of cells, where each cell represents a piece of genetic information. When creating a child:
- For each of the 64 positions in the grid
- A coin is flipped to determine which parent contributes that piece
- The trait (color) is inherited from the chosen parent for that position
This simulates how genetic information is passed down through generations, with each piece of genetic information having an equal chance of coming from either parent.
DigitalArchivst
This project is licensed under the MIT License - see the LICENSE file for details.