Automate Multi-Target Homology Modeling Using a Single Template with SwissModel API
Swiss-Model Batch Processor is a Python-based automation tool designed to batch submit multiple protein sequences to SwissModel using a single structural template. This script simplifies high-throughput homology modeling by programmatically handling job submissions, monitoring, and structured result retrieval.
- Batch Submission – Automates SwissModel API requests for multiple sequences.
- Single Template Usage – Models all targets against one specified template.
- Parallel Processing – Uses multithreading for faster execution.
- Rate Limit Handling – Prevents exceeding SwissModel’s API limits (100/min, 2000/6h).
- Structured Output Management – Saves models in separate directories based on clusters.
- Separate PDB & CIF Outputs – Organizes PDB and CIF files into dedicated subfolders.
- GUI Interface - Provides a user-friendly GUI for easy usage.
-
Clone the Repository:
git clone https://github.com/Aaryesh-AD/Swiss_Model_Batch_Processor.git cd Swiss_Model_Batch_Processor
-
Install any required dependencies (if not already installed).
SwissModel requires an API Key for authentication. Follow these steps:
-
Retrieve your API Key/Token from the SwissModel Account Page.
-
For the python CLI usage, in the project directory, create a new file called
config.json
and add your API Key/Token:{ "API_KEY": "your_api_key_here" }
For the GUI, the API key can be entered directly in the GUI.
Tip: Make sure
config.json
is kept secure and is not accidentally shared publicly.
- FASTA File: A file containing the target sequences (in standard FASTA format) that you want to model.
- Template PDB File: The single template file (in PDB format) used as the structural basis for modeling all target sequences.
There are two modes to run SwissBatchModeler: GUI and Command-Line Interface (CLI).
-
On Windows:
Double-click on theSwiss-Modeler_Batch_Processor_GUI.exe
file. -
On Linux:
In the program directory, run:./Swiss-Modeler_Batch_Processor_GUI
The GUI provides an interactive interface for selecting input files, configuring options, and viewing progress.
Run the script with the following command:
python SM_batch_processor.py <fasta_file> <template_pdb_file> <output_directory>
python SM_batch_processor.py input.fasta template.pdb results/
Note: Ensure that the
config.json
file is located in the same directory as the script.
Models are saved under output_directory/
in organized folders:
results/
├── cluster_0_model/
│ ├── PDB/
│ │ ├── cluster_0_model_001.pdb
│ │ ├── cluster_0_model_002.pdb
│ ├── CIF/
│ │ ├── cluster_0_model_001.cif
│ │ ├── cluster_0_model_002.cif
├── cluster_1_model/
│ ├── PDB/
│ │ ├── cluster_1_model_001.pdb
│ ├── CIF/
│ │ ├── cluster_1_model_001.cif
│ └── ...
- Authentication: Requires an API token in headers (
Token {API_KEY}
). - Rate Limits:
- Rapid Submission: 100 requests/minute
- Prolonged Submission: 2000 requests/6 hours
- Endpoints:
- Submit Job:
POST https://swissmodel.expasy.org/user_template
- Check Status:
GET https://swissmodel.expasy.org/project/{project_id}/models/summary/
- Submit Job:
Modify batch settings in SM_batch_processor.py
:
RAPID_RATE_LIMIT = 100 # Max 100 requests per minute
REQUEST_INTERVAL = 60 # 1-minute interval if rate is exceeded
MAX_WORKERS = 5 # Adjust thread count for parallel processing
This project is licensed under the MIT License.
Contributions are welcome! To contribute:
- Fork the repo.
- Create a new branch (
feature-name
). - Commit changes and push.
- Submit a pull request.
For issues, please open a GitHub issue or contact adeshpande334@gatech.edu.
-
Waterhouse A, et al. (2018)
SWISS-MODEL: homology modelling of protein structures and complexes.
Nucleic Acids Res 46, W296-W303.
PubMed | DOI -
Bienert S, et al. (2017)
The SWISS-MODEL Repository - new features and functionality.
Nucleic Acids Res 45, D313-D319.
PubMed | DOI -
Guex N, Peitsch MC, Schwede T (2009)
Automated comparative protein structure modeling with SWISS-MODEL and Swiss-PdbViewer: A historical perspective.
Electrophoresis 30, S162-S173.
PubMed | DOI -
Studer G, et al. (2020)
QMEANDisCo - distance constraints applied on model quality estimation.
Bioinformatics 36, 1765-1771.
PubMed | DOI -
Bertoni M, et al. (2017)
Modeling protein quaternary structure of homo- and hetero-oligomers beyond binary interactions by homology.
Scientific Reports 7.
PubMed | DOI