I was sitting in biology and we were talking about dihybrid crosses. I wondered if it was possible to create a program that crossed the genotypes for you, so you didn’t have to create the punnet square every time.
The punnet square program takes the parents’ genotypes, which can be any length, and returns the genotypic and phenotypic ratios. The ratios each come up in a separate window and are ordered from largest to smallest.
I created the program in increments. The first thing I did was make a program that could calculate every possible genotype combination, which took a while. I then added the ratios, followed by a GUI. The last thing I added was the phenotypic ratios, as it was a similar process to the genotypic ones.
The biggest challenge I ran into was making sure the program found every possible genotypes. I tried many different ways to include all combinations. Eventually, it clicked when I thought of the genotypes like counting in binary. The actual solution wasn’t exactly like that, since it’s like starting from the highest value and working down, but it helped me realize how I needed to structure the code.
I’m really proud of how expandable the program is. In my research after creating the program, I looked for similar ones online. I found nothing that would give the genotypic and phenotypic ratios for any number of genes. All programs I found had a maximum number, wouldn’t give the ratios, wouldn’t let you enter the genotypes, or some combination of those three.
I learned a lot about logic and GUIs. It took many attempts to get the program’s logic to work correctly but now I am better at figuring out what it needs to do. I also didn’t have much experience with GUIs before this project but I’m better with them now and can use tkinter efficiently.
The next steps for this program are cleanup and expansion. Currently, the code and GUI are a little messy so I want to make them neater. I also want to make this program more readily available. I plan on putting it on a website and making it into an app.
Log in or sign up for Devpost to join the conversation.