Skip to content
 
 

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

BLSTM Peptide Stimulation Classifier

A Bidirectional LSTM (BLSTM) deep learning model that predicts whether a peptide is immune-stimulatory or non-stimulatory, reproducing the approach from "Development and optimization of an activity-trained deep learning model."

The model is trained and evaluated separately on peptide datasets from two disease contexts:

  • COVID-19
  • M. tuberculosis (M.tb)

How It Works

  1. Data loading — Peptide sequences and binary activity labels (stimulatory = 1, non-stimulatory = 0) are read from an Excel file (Data/data.xlsx), one sheet per disease.
  2. Encoding — Each peptide is encoded as a sequence of integers over the 20 canonical amino acids, then padded to the longest sequence in the dataset.
  3. ArchitectureEmbedding → Masking → Bidirectional LSTM → Bidirectional LSTM → Dense (ReLU) → Dense (Sigmoid), trained with binary cross-entropy loss.
  4. Hyperparameter tuningGridSearchCV (via scikeras) searches over BLSTM units, dense units, dropout, learning rate, batch size, and epochs.
  5. Class imbalance handling — Class weights are computed and applied during training to correct for imbalance between stimulatory and non-stimulatory peptides.
  6. Training — 60/20/20 train/validation/test split (stratified), with early stopping on validation loss.
  7. Evaluation & outputs — For each dataset, the script saves:
    • A metrics table image (precision/recall/F1 per class, per split)
    • Loss, accuracy, and ROC curve plots
    • Confusion matrices for train/validation/test
    • The trained Keras model (.keras file)

Requirements

pip install tensorflow==2.15.0
pip install keras scikit-learn pandas numpy openpyxl matplotlib seaborn scikeras

Usage

  1. Place your peptide dataset as Data/data.xlsx, with one sheet per disease (e.g. COVID-19, M.tb), each containing peptide and label columns.
  2. Run the script:
    python Code/BLSTM_activity_trained_model.py
  3. Outputs (plots and saved models) are written to the Data/ folder.

Repository Structure

BLSTM/
└── Code/
    └── BLSTM_activity_trained_model.py   # Main training & evaluation script

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages