Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comparative Sequence & Mutation Analysis (BioPython) — HBB / Sickle Cell

A Python/BioPython project that compares a reference human gene sequence against a patient sample, detects mutations at the nucleotide level, classifies each as synonymous or non-synonymous, translates both to protein, and cross-references detected changes against known clinically significant variants.

Built around a real, well-documented case: the HBB (beta-globin) gene and the classic sickle cell mutation (HbS).

Note on the data: live queries to NCBI weren't reachable from the environment this was built in, so the reference CDS was sourced from a published, cross-validated document (US patent 6,780,892) and verified by translating it and confirming an exact match against the canonical UniProt HBB protein sequence (P68871) before use — see docs/01_reference_validation.md. The "patient" sample was then constructed by introducing the real, clinically documented HbS mutation (HBB:c.20A>T, codon 6 GAG→GTG, p.Glu6Val — confirmed against the IthaGenes mutation database) at the correct position, so the biology being detected is genuine even though the sample itself is a controlled demonstration rather than raw sequencing output from an individual.

What it does

Reference FASTA + Sample FASTA
        │
        ▼
Nucleotide-level diff (position-by-position)
        │
        ▼
Codon-level translation (BioPython Seq.translate)
        │
        ▼
Classify each change: synonymous vs non-synonymous
        │
        ▼
Cross-reference against known pathogenic variant database
        │
        ▼
JSON + text report  +  visualizations

Results

Sample 1 — reference vs. a sample carrying only the HbS mutation:

Nucleotide difference Position 17: A → T
Codon affected Codon 6: GAG (Glu) → GTG (Val)
Classification Non-synonymous
Matched known variant HbS (Sickle Cell)HBB:c.20A>T — p.Glu6Val — Pathogenic

Sequence diff

Sample 2 — reference vs. a sample carrying a synonymous demo change and the real HbS mutation, to confirm the classifier correctly tells them apart:

Codon Change Classification Known variant match
1 GTG → GTA (Val → Val) Synonymous — (constructed demo)
6 GAG → GTG (Glu → Val) Non-synonymous HbS, pathogenic

Classification

Full reports: results/mutation_report.txt, results/mixed_sample/mutation_report.txt

Repository structure

.
├── data/
│   ├── HBB_reference.fasta              # Verified real human HBB CDS
│   ├── HBB_patient_sample.fasta         # Reference + real HbS mutation
│   └── HBB_patient_sample2_mixed.fasta  # + synonymous demo mutation
├── scripts/
│   ├── 01_compare_sequences.py          # Core diff/translate/classify engine
│   └── 02_visualize_mutations.py        # Plots
├── results/                             # Reports + plots for both samples
└── docs/                                # Step-by-step write-up

How to reproduce

pip install biopython matplotlib

python3 scripts/01_compare_sequences.py \
    data/HBB_reference.fasta data/HBB_patient_sample.fasta results

python3 scripts/02_visualize_mutations.py \
    data/HBB_reference.fasta data/HBB_patient_sample.fasta \
    results/mutation_report.json results/plots

Skills demonstrated

  • BioPython: SeqIO, Seq.translate(), codon table handling
  • Sequence file parsing and handling (FASTA I/O)
  • Biological data processing: nucleotide-to-protein translation, mutation classification (synonymous/non-synonymous), variant nomenclature (HGVS)
  • Cross-referencing findings against a curated clinical variant database
  • Result visualization (matplotlib)

Author

Harshita

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages