{"id":30683269,"url":"https://github.com/waridrox/dna-sequence-classification","last_synced_at":"2026-06-25T01:31:56.749Z","repository":{"id":308553555,"uuid":"873064009","full_name":"waridrox/dna-sequence-classification","owner":"waridrox","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-06T14:07:45.000Z","size":1068,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T19:46:08.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waridrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-15T14:39:30.000Z","updated_at":"2025-08-06T14:07:48.000Z","dependencies_parsed_at":"2025-08-06T16:19:33.737Z","dependency_job_id":null,"html_url":"https://github.com/waridrox/dna-sequence-classification","commit_stats":null,"previous_names":["waridrox/dna-sequence-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/waridrox/dna-sequence-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waridrox%2Fdna-sequence-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waridrox%2Fdna-sequence-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waridrox%2Fdna-sequence-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waridrox%2Fdna-sequence-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waridrox","download_url":"https://codeload.github.com/waridrox/dna-sequence-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waridrox%2Fdna-sequence-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34756205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-01T19:43:17.384Z","updated_at":"2026-06-25T01:31:56.723Z","avatar_url":"https://github.com/waridrox.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNA Sequence Classification using Machine Learning\n\nA machine learning approach for classifying gene families from raw DNA sequences using k-mer counting and natural language processing techniques.\n\n## Overview\n\nThis project demonstrates how to apply machine learning techniques to genomic data by treating DNA sequences as a \"language\" and using k-mer counting with bag-of-words methodology. The model predicts gene families from DNA sequences and validates its effectiveness across different species.\n\n## Features\n\n- **Multiple Encoding Methods**: Implements three different DNA sequence encoding approaches\n  - Ordinal encoding\n  - One-hot encoding  \n  - K-mer counting (bag-of-words)\n- **Cross-Species Validation**: Tests model generalizability on human, chimpanzee, and dog genomes\n- **High Accuracy**: Achieves 94% accuracy on human DNA classification\n- **Biological Sequence Processing**: Uses Biopython for efficient DNA sequence handling\n\n## Dataset\n\nThe project uses DNA sequence data from three species:\n- **Human**: 4,380 sequences across 7 gene families\n- **Chimpanzee**: 1,682 sequences for cross-species validation\n- **Dog**: 820 sequences for divergent species testing\n\n### Gene Family Classes\n1. G protein-coupled receptors\n2. Tyrosine kinases  \n3. Tyrosine phosphatases\n4. Synthetases\n5. Synthases\n6. Ion channels\n7. Transcription factors\n\n## Methodology\n\n### K-mer Counting Approach\nThe project treats DNA sequences as natural language by:\n1. Breaking sequences into overlapping k-mers (default k=6)\n2. Creating \"sentences\" from k-mer \"words\"\n3. Applying bag-of-words vectorization\n4. Training a Multinomial Naive Bayes classifier\n\n### Example\nDNA: \"ATGCATGCA\" → K-mers: ['ATGCAT', 'TGCATG', 'GCATGC', 'CATGCA']\n\n## Requirements\nbiopython\nnumpy\npandas\nscikit-learn\nmatplotlib\n\n\n## Results\n\n| Species | Accuracy | Use Case |\n|---------|----------|----------|\n| Human | 94% | Training and validation |\n| Chimpanzee | High | Close evolutionary relationship |\n| Dog | Moderate | Distant evolutionary relationship |\n\nThe model demonstrates strong performance on human data and maintains good generalizability to closely related species (chimpanzee), with expected performance degradation on more evolutionarily distant species (dog).\n\n## Key Functions\n\n- `Kmers_funct()`: Generates overlapping k-mers from DNA sequences\n- `string_to_array()`: Converts sequence strings to arrays\n- `ordinal_encoder()`: Implements ordinal encoding (A=0.25, C=0.50, G=0.75, T=1.00)\n- `one_hot_encoder()`: Creates one-hot encoded representations\n\n## Model Details\n\n- **Algorithm**: Multinomial Naive Bayes\n- **Features**: 4-gram k-mer counts (vocabulary size varies by dataset)\n- **Alpha**: 0.1 (Laplace smoothing parameter)\n- **Train/Test Split**: 80/20 on human data\n\n## Significance\n\nThis project demonstrates that:\n- DNA sequences can be effectively processed using NLP techniques\n- K-mer counting captures important biological patterns\n- Machine learning models can predict gene function from sequence alone\n- Cross-species classification reveals evolutionary relationships\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaridrox%2Fdna-sequence-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaridrox%2Fdna-sequence-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaridrox%2Fdna-sequence-classification/lists"}