A newer version of the Streamlit SDK is available:
1.54.0
metadata
title: GeneTypeClassifier – ML Model for Gene Sequence Classification
emoji: 🧬
colorFrom: purple
colorTo: green
sdk: streamlit
sdk_version: 1.40.0
app_file: app.py
pinned: false
license: mit
GeneTypeClassifier — Fast gene type prediction with a trained Gradient Boosting pipeline
A lightweight Gradio app to classify gene records using a pre-trained Gradient Boosting model. Point it at a nucleotide sequence and a short description, and get a predicted gene type.
Table of Contents
- Demo
- Features
- Installation / Setup
- Usage
- Configuration / Options
- Contributing
- License
- Acknowledgements / Credits
Demo
Below are real assets from ./demo/:
Features
- Pretrained model: Ships with
models/gradient_boosting_pipeline.pklandmodels/label_encoder.pkl. - Simple UI: Gradio interface for quick local testing and sharing.
- Deterministic preprocessing:
get_kmers()utility for k-mer tokenization baked into the pipeline serialization context. - Reproducible setup: Minimal, pinned
requirements.txt.
Installation / Setup
# Create a virtual environment
python -m venv .venv
# Activate it
# On Linux/Mac:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Usage
Run the Gradio app locally:
python app.py
This launches the UI defined in app.py/ui.py and loads the pretrained artifacts from models/:
models/gradient_boosting_pipeline.pklmodels/label_encoder.pkl
In the UI, provide:
Nucleotide Sequence(e.g., ATG...)Description
The app returns the predicted gene type (e.g., PROTEIN_CODING, ncRNA, etc.).
Note: The pickled pipeline expects the helper
get_kmers()fromutils.py. Keep the file layout unchanged when running the app.
Configuration / Options
- Model paths: The UI loads from
models/. To swap models, replace the.pklfiles with compatible artifacts and keep the filenames or update the paths inui.py(pipelineandlabel_encoderloaders). - Gradio server options: To customize host/port, edit
demo.launch()inapp.py, e.g.demo.launch(server_name="0.0.0.0", server_port=7860).
Contributing
- Issues & ideas: Open an issue describing the change and rationale.
- PRs: Keep changes focused, add clear descriptions, and update docs if behavior changes.
- Style: Prefer small, readable functions and explicit dependencies.
License
This project is licensed under the MIT License.
Acknowledgements / Credits
- Built with Gradio for the UI and scikit-learn for the model pipeline. 🧬🚀
