# ๐Ÿš€ **Allelica**

--- ## ๐Ÿงฌ **Allelica** Now, I know what you must be thinking โ€” **โ€œAllelica? Whoโ€™s she?โ€** And no, *Allelica is not a woman.* The name comes from **allele** โ€” alternate forms of a gene. --- ## ๐Ÿง  **Very Quick Genetics (I promise)** Okayโ€ฆ but what is a gene? A **gene** is a segment of DNA that codes for proteins. DNA is the genetic material that stores information and passes it down generations. Now imagine this: * A gene is like a *chapter in a book* (say, eye colour), everyone had the same chapter * The *slightly different versions* of that chapter? โ†’ **alleles** And since you inherit one copy from each parent, you always have **two alleles** โ†’ this pair is your **genotype**. --- ## ๐Ÿ‘€ **Simple Example** Letโ€™s say: * **B** โ†’ brown eyes (dominant) * **b** โ†’ blue eyes (recessive) Then: * **BB** โ†’ brown * **Bb** โ†’ brown (but carries blue) * **bb** โ†’ blue This is why two brown-eyed parents can still have a blue-eyed child. --- ## ๐Ÿงฌ **Tiny Note (before a biologist attacks me)** Yes, this is simplified. Real genetics is messier. This is just enough for this project. --- ## ๐Ÿ“ **The Math Side of Allelica** Allelica works on the **Hardyโ€“Weinberg principle**. $$ p^2 + 2pq + q^2 = 1 $$ Where: * **p** = frequency of dominant allele * **q** = frequency of recessive allele And: * **pยฒ** โ†’ homozygous dominant * **2pq** โ†’ heterozygous * **qยฒ** โ†’ homozygous recessive --- ### ๐Ÿ“Š Example If: * q = 0.3 โ†’ blue allele * p = 0.7 Then: * qยฒ = 0.09 โ†’ **9% blue-eyed** * pยฒ = 0.49 โ†’ **49% BB** * 2pq = 0.42 โ†’ **42% carriers** These values stay constant unless external factors interfere. --- ## ๐Ÿค– **Soโ€ฆ what does Allelica actually do?** She: * Takes allele frequency data * Calculates genotype frequencies using Hardyโ€“Weinberg * Compares and visualizes them across **4 populations** --- ## ๐ŸŒ **Why I made this** This started with me thinking: > *โ€œDoes UV or altitude affect allele frequencies?โ€* Then I found real examples (like malaria resistance varying by region), and that turned into: ๐Ÿ‘‰ *letโ€™s build something that visualizes this* This was originally my class 12 project (very ugly version). This is the upgraded one. --- ## ๐ŸŽฅ **Preview** ### ๐Ÿ“Š Genotype Frequencies ![Genotype](images/Graph1.jpg) ### ๐Ÿ“Š Genotype Comparison ![Genotype](images/Graph2.jpg) ### ๐Ÿ“ˆ Allele Frequencies ![Allele](images/Graph3.jpg) --- ## ๐Ÿ“Š **Data Source** All allele frequency data was sourced from: [gnomAD (Genome Aggregation Database)](https://gnomad.broadinstitute.org/) | Gene | Trait | RS Number | | ------- | ------------------- | ----------- | | TYR | Skin Pigmentation | rs1042602 | | MC1R | Skin Pigmentation | rs1805007 | | SLC24A5 | Skin Pigmentation | rs111310111 | | EPAS1 | Altitude Adaptation | rs6743991 | | HBB | Sickle Cell Trait | rs10768683 | | LCT | Lactase Persistence | rs2304371 | | FTO | Obesity Risk | rs62033438 | | CFTR | Cystic Fibrosis | rs113993960 | | ACKR1 | Malaria Resistance | rs2814778 | | APOE | Alzheimers Risk | rs440446 | --- ## โš™๏ธ **How to Run** Install dependencies: ```bash pip install pandas numpy matplotlib ``` Run: ```bash python Allelica.py ``` --- ## โœจ **Features** * ๐Ÿ“Š Genotype frequency comparison across populations * ๐Ÿ”ฌ Genotype comparison across genes * ๐Ÿ“ˆ Allele frequency visualization * ๐Ÿ“‹ Console summaries with biological interpretation * โœ… Input validation * ๐Ÿ’พ CSV output of results --- ## ๐Ÿš€ **Future Improvements** - ๐Ÿ—บ๏ธ **v1.1** โ€” Allele frequency heatmap across all genes and populations - ๐Ÿงฌ **v2.0** โ€” BioPython integration for direct database querying instead of manual CSV input - ๐Ÿ–ค **v3.0** โ€” Frontend interface (Allelica deserves to look as good as she works) --- ## ๐Ÿ’ก **Final Note** I could keep talking about genetics forever. But this project is basically that โ€” just with Python and graphs.