EpiPred - Epitope Prediction Web Tool
A web-based tool for predicting B-cell and T-cell epitopes from protein sequences using advanced deep learning with attention mechanisms and bidirectional LSTM networks.
Features
- Advanced Deep Learning: Attention-based neural networks with bidirectional LSTM
- Multi-target Prediction: Both B-cell and T-cell epitope prediction
- Interactive Interface: User-friendly web interface similar to BepiPred-2.0
- Flexible Input: Support for text input and file upload (FASTA format)
- Real-time Visualization: Interactive sequence markup and confidence scoring
- Multiple Export Formats: Download results in CSV or JSON format
- Responsive Design: Works on desktop and mobile devices
Installation
Prerequisites
- Python 3.8 or higher
- pip (Python package installer)
Setup
Clone or download the application files
cd app/Install dependencies
pip install -r requirements.txtEnsure model files are available
The application looks for trained model files in the following locations (in order of preference):
models/epitope_model.kerasmodels/epitope_model.h5models/epitope_model_savedmodel/../epitope_model.keras../epitope_model.h5../epitope_model_savedmodel/epitope_model.kerasepitope_model.h5epitope_model_savedmodel/
The model files should be placed in the
models/directory within the app folder.Run the application
python run.pyOr alternatively:
python app.pyAccess the web interface
Open your web browser and navigate to:
http://localhost:5000
Usage
Input Formats
The tool accepts protein sequences in FASTA format:
>Sequence_Name_1
MKLLILTCLVAVALARPKHPIKHQGLPQEVLNENLLRFFVAPFPEVFGKEKVNEL
>Sequence_Name_2
CARFASLIYGKFVRQPQVWLRIQNYSVMDICDEHQGVMVPGVGVPQALQKYNPD
Submission Limits
- Maximum sequences: 50 per submission
- Maximum total length: 300,000 amino acids
- Sequence length range: 10-6,000 amino acids each
- File size limit: 16 MB
Input Methods
- Text Input: Paste sequences directly into the text area
- File Upload: Upload FASTA files (.txt, .fasta, .fa, .fas)
Results Interpretation
- Confidence Scores: Range from 0.0 to 1.0 (higher = more confident)
- Sequence Markup:
B= B-cell epitope regionsT= T-cell epitope regions.= Non-epitope regions
- Interactive Threshold: Adjust confidence threshold to filter results
- Position Ranges: 1-based indexing (first amino acid = position 1)
Configuration
Environment Variables
FLASK_DEBUG: Set to 'true' for debug mode (default: false)FLASK_HOST: Host address (default: 0.0.0.0)FLASK_PORT: Port number (default: 5000)
Example
export FLASK_DEBUG=true
export FLASK_PORT=8080
python run.py
Sample Input Files
Two sample FASTA files are provided for testing:
test_sequences.fasta- Small test file with 3 sequences (good for quick testing)sample_input.fasta- Larger sample with 10 diverse protein sequences including:- Human Insulin chains
- Viral proteins (SARS-CoV-2, HIV, Influenza, Zika)
- Bacterial antigens (Tuberculosis, Hepatitis B)
- Cancer-related proteins (p53)
- Parasitic proteins (Malaria)
How to Use Sample Files:
Via Web Interface:
- Go to http://localhost:5000
- Click "Upload a FASTA file"
- Select either
test_sequences.fastaorsample_input.fasta - Click "Predict Epitopes"
Copy and Paste:
- Open either sample file in a text editor
- Copy the contents
- Paste into the text area on the web interface
- Click "Predict Epitopes"
File Structure
app/
βββ app.py # Main Flask application
βββ model_predictor.py # Model loading and prediction logic
βββ run.py # Application launcher
βββ test_app.py # Test script
βββ start.sh # Linux/Mac startup script
βββ start.bat # Windows startup script
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ test_sequences.fasta # Small test file
βββ sample_input.fasta # Larger sample file
βββ models/ # Model files directory
β βββ epitope_model.keras
β βββ epitope_model.h5
β βββ epitope_model_savedmodel/
βββ templates/ # HTML templates
β βββ base.html
β βββ index.html
β βββ results.html
β βββ instructions.html
β βββ about.html
βββ static/ # Static files
βββ css/
β βββ style.css
βββ js/
β βββ main.js
βββ uploads/ # Temporary file storage
API Endpoints
GET /- Main pagePOST /predict- Submit sequences for predictionGET /instructions- Usage instructionsGET /about- Method informationGET /download/<job_id>/<format>- Download results
Troubleshooting
Common Issues
Model not found error
- Ensure model files are in the correct location
- Check file permissions
Import errors
- Install all dependencies:
pip install -r requirements.txt - Check Python version (3.8+ required)
- Install all dependencies:
Memory errors
- Reduce batch size for large sequences
- Process fewer sequences at once
Port already in use
- Change port:
export FLASK_PORT=8080 - Or kill existing process
- Change port:
Performance Tips
- Use smaller batch sizes for very long sequences
- Consider using GPU acceleration for TensorFlow if available
- Limit concurrent users in production environments
Development
Adding New Features
- Backend: Modify
app.pyandmodel_predictor.py - Frontend: Update templates and static files
- Styling: Modify
static/css/style.css - JavaScript: Update
static/js/main.js
Testing
# Test with example sequences
curl -X POST http://localhost:5000/predict \
-F "sequence_text=>Test\nMKLLILTCLVAVALARPKHPIKHQGLPQEVLNENLLRFFVAPFPEVFGKEKVNEL"
License
This project is provided as-is for research and educational purposes.
Support
For technical issues or questions about the method, please refer to:
- Instructions page in the web interface
- About page for method details
- This README file for setup help
Citation
If you use EpiPred in your research, please cite:
EpiPred: Advanced Epitope Prediction Using Attention-based Deep Learning.
Bioinformatics and Computational Biology (2024)
DOI: 10.xxxx/xxxxxx