This workflow implements a deep learning pipeline for DNA sequence classification using an LSTM-based neural network. It takes raw DNA sequences in FASTA format and their labels in tabular format, processes them into numerical representations, trains a model, and evaluates its performance.
The workflow can be used to perform DNA sequence classification on splice-junction gene sequences. In an example task, the workflow takes raw DNA sequence data as input and classifies each sequence according to whether it contains an exon–intron boundary, an intron–exon boundary, or no splice junction using an LSTM-based deep learning model. These classes correspond to donor sites (EI), acceptor sites (IE), and neither (N). The biological goal of such a task is to identify where RNA splicing occurs. During splicing, non-coding introns are removed and coding exons are joined together before a gene is translated into a protein. Detecting these splice-junction boundaries from DNA sequences helps in understanding gene structure and function. More information about such a dataset can be found in this blogpost
- End-to-end pipeline in Galaxy
- DNA sequence encoding using k-mer representation
- Deep learning model built with Keras
- LSTM-based architecture for sequence learning
- Automatic train/test split
- Model evaluation with metrics and confusion matrix
- Prediction of class labels and probabilities
The workflow requires two datasets:
- DNA sequences (FASTA format)
- Labels for sequences (tabular format)
- DNA sequences are converted into numerical format using:
- k-mer encoding (k=3)
- Output: encoded feature matrix
- Encoded sequences are merged with labels
- Dataset is split into:
- Training set (75%)
- Test set (25%)
- Training and test datasets are split into:
- X (features): encoded sequences
- y (labels): class labels
- Labels are converted to categorical (one-hot encoding)
The workflow builds a Sequential Keras model with:
-
Embedding layer:
- Input dim: 130
- Output dim: 128
-
LSTM layers:
- LSTM (256 units, return sequences)
- LSTM (256 units)
-
Dense layers:
- Dense (64 units, ELU activation)
- Output Dense (3 units, Softmax)
- Optimizer: Adam
- Loss function: categorical crossentropy
- Metrics: categorical accuracy
Training parameters:
- Epochs: 10
- Batch size: 32
- Validation split: 10%
-
Metrics reported:
- Accuracy
- F1-score (macro)
- Recall (macro)
-
Outputs:
- Predictions on test data
- Class probabilities
- Confusion matrix visualization
- Trained model
- Prediction results (labels)
- Prediction probabilities
- Evaluation metrics
- Confusion matrix plot
- Ensure DNA sequences are properly formatted (FASTA)
- Labels must align with input sequences
- GPU acceleration is enabled (if available)
- Suitable for multi-class classification problems
MIT License
Anup Kumar
ORCID: 0000-0002-2068-4695