K-BLEND is a hybrid genomic classification framework that pairs a fast, alignment-free k-mer neural ensemble with BLAST as a benchmark for classifying SARS-CoV-2 genomes by strain. A dependency-free C++ feature extractor computes bit-wise 3/5/6-mer frequency features directly from FASTA sequences, which feed a diversified ensemble of 25 neural network classifiers trained in parallel and combined via majority vote. The pipeline was evaluated against traditional BLAST alignment on 11,000 genomes spanning 11 SARS-CoV-2 strains (Alpha, Beta, Delta, Epsilon, Eta, Gamma, Iota, Lambda, Mu, Omicron, Zeta), sourced from NGDC.
This repo contains the full training/evaluation pipeline (ensemble.sh), the BLAST benchmark harness (blastTesting.py), and the dataset splits and results tables used in the paper.
Published in the proceedings of the 2025 IEEE MIT Undergraduate Research Technology Conference (URTC): https://doi.org/10.1109/URTC68753.2025.11533085
L. Agarwal, J. Koothur and J. Wang, "The K-BLEND Framework: A Hybrid Genomic Workflow Integrating Blast with a Kmer-Based Neural Ensemble," 2025 IEEE MIT Undergraduate Research Technology Conference (URTC), Cambridge, MA, USA, 2025, pp. 1-5, doi: 10.1109/URTC68753.2025.11533085.
@INPROCEEDINGS{11533085,
author={Agarwal, Laksh and Koothur, Juan and Wang, Juexin},
booktitle={2025 IEEE MIT Undergraduate Research Technology Conference (URTC)},
title={The K-BLEND Framework: A Hybrid Genomic Workflow Integrating Blast with a Kmer-Based Neural Ensemble},
year={2025},
volume={},
number={},
pages={1-5},
keywords={Modeling;Engines;Genomics;Printing;Tools;Surveillance;Timing;Sequences;Sequential analysis;Machine learning;Hybrid Genomic System;Machine Learning;BLAST;Alignment-Free;K-mer;SARS-CoV-2;Bioinformatics;Diagnostic Workflow;Computational Genomics},
doi={10.1109/URTC68753.2025.11533085}}Use requires linux terminal or ubuntu WSL. WSL setup directions
- Open command prompt run
wsl --install- Download ubuntu for WSL https://ubuntu.com/desktop/wsl
- Open WSL
Virtual Environment setup
git clone https://github.com/Lotion-3/K-BLENDcd K-BLENDsudo apt updatesudo apt install python3-venvpython3 -m venv Ensembleenvsource Ensembleenv/bin/activatepip install -r req.txtAll genomes compressed using 7z
Extraction setup:
sudo apt updatesudo apt install p7zip-fullThis experiment utilized 11000 SARS-CoV-2 genomes from 11 strains. Alpha, Beta, Delta, Epsilon, Eta, Gamma, Iota, Lambda, Mu, Omicron, Zeta
Sourced from NGDC: https://ngdc.cncb.ac.cn/
Full data set is available in rawFastas folder
combine_fasta.py file combined all 11000 into comb11000.fasta and generated key.fasta.
The data set was used to create the 13 splits described in the paper which were generated by using split.py
Available in fullPaperFastas folder. Warning extracts to 20GB data set.
7z x fullPaperFastas.7zRest of tutorial uses sampleFastas data set containing only 2 splits.
Available in sampleFastas folder. Extracts to 635MB.
7z x sampleFastas.7zThe complete tables used in the paper are available in fullPaperTables along with code used to generate figures.
Pre usage setup
- Bash Permissions
chmod +x ensemble.sh- C++ Setup
sudo apt updatesudo apt install build-essential gdb- Jq setup
sudo apt-get install jq- Ramdisk setup This example uses 8G of commited RAM, adjust to device specifications
sudo mkdir -p /mnt/ramdisksudo mount -t tmpfs -o size=8G tmpfs /mnt/ramdisksudo chown $USER:$USER /mnt/ramdiskecho always | sudo tee /sys/kernel/mm/transparent_hugepage/enabledRun the ensemble.sh file, this automated script trains 25 ensemble models and provides evaluation data.
Execution arguments:
./ensemble.sh inputDirectory #cpuCoresThe input directory expects two subdirectories, trainingFastas and testingFastas
The script recognizes 2 naming systems for train test pairs
- Train: train%Train_11000_version# Test: test%test_11000_version#
Ex. Train: train90_11000_5 Test: test10_11000_5
Version numbers must match and percentages must add to 100 - Train: train_#sequences_version# Test: test_#sequences_version#
Ex. Train: train_110_1 Test: test_10890_1
Number of sequences must add to 11000 and version numbers must match
The #cpuCores decides how many system cpuCores are dedicated to the execution.
Train+Test pairs are processed one at a time. The 25 models are distributed amongst dedicated cores. One model per core.
Default is half of system cores. Recommended maximum is the number of system cores -1.
Usage with sampleFastas:
./ensemble.sh sampleFastas 2Evaluation information is saved in the PIPELINE_RESULTS_HPC.csv file.
Models are saved in saved_models/ directory.
When finished clean ramdisk
sudo umount /mnt/ramdisksudo rm -r /mnt/ramdiskDownload NCBI BLAST 2.16.0+ tool from:
https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/
Place in K-BLEND directory
Execution arguments:
python3 blastTesting.py inputDirectoryThe input directory expects two subdirectories, trainingFastas and testingFastas
The script recognizes 2 naming systems for train test pairs
- Train: train%Train_11000_version# Test: test%test_11000_version#
Ex. Train: train90_11000_5 Test: test10_11000_5
Version numbers must match and percentages must add to 100 - Train: train_#sequences_version# Test: test_#sequences_version#
Ex. Train: train_110_1 Test: test_10890_1
Number of sequences must add to 11000 and version numbers must match
Usage with sampleFastas:
python3 blastTesting.py sampleFastasEvaluation information is saved in blast_performance_metrics.csv
Raw results in blastOutput folder
This project is licensed under the MIT License.
