Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/savinrazvan/heredity
An AI that assesses the likelihood of genetic traits in individuals using a Bayesian Network to analyze family genetic data, modeling genetic inheritance and mutations to infer probabilities of gene presence and trait expression.
https://github.com/savinrazvan/heredity
ai bayesian-network biological-data-analysis data-analysis educational-project family-genetics genetic-inheritance genetic-traits heredity mutation-modeling probability-calculation python
Last synced: 8 days ago
JSON representation
An AI that assesses the likelihood of genetic traits in individuals using a Bayesian Network to analyze family genetic data, modeling genetic inheritance and mutations to infer probabilities of gene presence and trait expression.
- Host: GitHub
- URL: https://github.com/savinrazvan/heredity
- Owner: SavinRazvan
- License: mit
- Created: 2024-07-28T17:28:01.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T23:37:01.000Z (6 months ago)
- Last Synced: 2024-11-11T16:25:08.287Z (2 months ago)
- Topics: ai, bayesian-network, biological-data-analysis, data-analysis, educational-project, family-genetics, genetic-inheritance, genetic-traits, heredity, mutation-modeling, probability-calculation, python
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Heredity
This project involves creating an AI to assess the likelihood that a person will have a particular genetic trait based on their family's genetic information. The project uses a Bayesian Network to model the inheritance of a gene and the corresponding trait expression.
## Project Description
### Overview
The AI assesses the likelihood of genetic traits in individuals by using a Bayesian Network to analyze family data. The network accounts for genetic inheritance and mutations, allowing the AI to infer probabilities of gene presence and trait expression. The primary goal is to accurately model genetic inheritance patterns and predict the probability of traits appearing in family members.### How It Works
1. **Data Input**: The program reads family genetic data from a CSV file.
2. **Probability Calculation**: It calculates the joint probability of various gene/trait combinations using the Bayesian Network, considering both genetic inheritance and mutation probabilities.
3. **Probability Update**: It updates the probability distributions for each person based on the joint probabilities.
4. **Normalization**: It normalizes these probabilities to ensure they sum to 1.
5. **Output**: The program outputs the probabilities of each person having 0, 1, or 2 copies of the gene and whether or not they exhibit the trait.### Gene Values Explained
- **2**: The individual has two copies of the gene.
- **1**: The individual has one copy of the gene.
- **0**: The individual has no copies of the gene.### Files
- **data/family0.csv**: Sample data file containing family genetic information.
- **data/family1.csv**: Sample data file containing family genetic information.
- **data/family2.csv**: Sample data file containing family genetic information.
- **heredity.py**: Main Python script to implement the AI.### Key Functions Implemented
- **joint_probability**: Calculates the joint probability of a gene/trait distribution.
- **update**: Updates the probability distributions with a new joint probability.
- **normalize**: Normalizes the probabilities to sum to 1.### Usage
```bash
python heredity.py data/family0.csv
```
```bash
python heredity.py data/family1.csv
```
```bash
python heredity.py data/family2.csv
```### Example Output
```bash
python heredity.py data/family1.csv
Arthur:
Gene:
2: 0.0329
1: 0.1035
0: 0.8636
Trait:
True: 0.0000
False: 1.0000
Charlie:
Gene:
2: 0.0018
1: 0.1331
0: 0.8651
Trait:
True: 0.0000
False: 1.0000
Fred:
Gene:
2: 0.0065
1: 0.6486
0: 0.3449
Trait:
True: 1.0000
False: 0.0000
Ginny:
Gene:
2: 0.0027
1: 0.1805
0: 0.8168
Trait:
True: 0.1110
False: 0.8890
Molly:
Gene:
2: 0.0329
1: 0.1035
0: 0.8636
Trait:
True: 0.0000
False: 1.0000
Ron:
Gene:
2: 0.0027
1: 0.1805
0: 0.8168
Trait:
True: 0.1110
False: 0.8890
```