---
## ๐งฌ **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 Comparison

### ๐ Allele Frequencies

---
## ๐ **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.