A simple CLI tool for calculating genotype and phenotype percentages using a Punnett square.
- Calculates genotype percentages
- Calculates phenotype percentages
- Shows allele combinations
- Supports command-line usage
- Can export results to a file (txt)
- Python 3.x (requirement, no less than that)
Clone the repository:
git clone https://github.com/ShadowDev7/OpenPunnett.git
cd OpenPunnett Or download the .zip I guess
Run the script with two parent genotypes:
python main.py -p1 Aa -p2 AaEach parent must be given as a two-letter genotype:
AAAaaAaa
Example:
python main.py -p1 AA -p2 Aa| Command | Description |
|---|---|
-p1, --parent1 |
Parent 1 genotype (AA, Aa, aA, or aa) |
-p2, --parent2 |
Parent 2 genotype (AA, Aa, aA, or aa) |
--genotype |
Show only genotype results |
--phenotype |
Show only phenotype results |
--output <file> |
Save the result to a file |
-h, --help |
Shows the commands (Well you can just read this file instead I do not know?) |
Show everything:
python main.py -p1 Aa -p2 AaShow only genotype:
python main.py -p1 Aa -p2 Aa --genotypeShow only phenotype:
python main.py -p1 Aa -p2 Aa --phenotypeSave output to a file:
python main.py -p1 Aa -p2 Aa --output result.txtGenotype:
AA: 25.00%
Aa: 50.00%
aa: 25.00%
Phenotype:
A: 75.00%
a: 25.00%
Combinations: ['AA', 'Aa', 'Aa', 'aa']
Accepted parent values:
AAAaaAaa
Ais treated as the dominant alleleais treated as the recessive alleleAAandAaproduce the dominant phenotypeaaproduces the recessive phenotypeA>a
-
This tool is designed for simple one-gene Punnett square exercises and educational use and probably some work.
-
The tool for now is pretty simple. I am working on some more features in the future
-
I am not a biologist (Just saying it)
-
I believe in human creativity. Anyone who decides to commit issues, vibe-coded code (using AI without knowing how it works) or assets with AI/ML is automatically rejected without any further discussion
MIT License