Skip to content

About

A simple CLI tool for calculating genotype and phenotype percentages using a Punnett square.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

88 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenPunnett

A simple CLI tool for calculating genotype and phenotype percentages using a Punnett square.

Features

  • Calculates genotype percentages
  • Calculates phenotype percentages
  • Shows allele combinations
  • Supports command-line usage
  • Can export results to a file (txt)

Requirements

  • Python 3.x (requirement, no less than that)

Installation (For CLI)

Clone the repository:

git clone https://github.com/ShadowDev7/OpenPunnett.git
cd OpenPunnett 

Or download the .zip I guess

Usage (for CLI)

Run the script with two parent genotypes:

python main.py -p1 Aa -p2 Aa

Format

Each parent must be given as a two-letter genotype:

  • AA
  • Aa
  • aA
  • aa

Example:

python main.py -p1 AA -p2 Aa

Commands

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?)

Examples

Show everything:

python main.py -p1 Aa -p2 Aa

Show only genotype:

python main.py -p1 Aa -p2 Aa --genotype

Show only phenotype:

python main.py -p1 Aa -p2 Aa --phenotype

Save output to a file:

python main.py -p1 Aa -p2 Aa --output result.txt

Example Output

Genotype:
AA: 25.00%
Aa: 50.00%
aa: 25.00%

Phenotype:
A: 75.00%
a: 25.00%

Combinations: ['AA', 'Aa', 'Aa', 'aa']

Valid Inputs

Accepted parent values:

  • AA
  • Aa
  • aA
  • aa

Biology Notes

  • A is treated as the dominant allele
  • a is treated as the recessive allele
  • AA and Aa produce the dominant phenotype
  • aa produces the recessive phenotype
  • A > a

Notes

  1. This tool is designed for simple one-gene Punnett square exercises and educational use and probably some work.

  2. The tool for now is pretty simple. I am working on some more features in the future

  3. I am not a biologist (Just saying it)

  4. 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

License

MIT License

About

A simple CLI tool for calculating genotype and phenotype percentages using a Punnett square.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages