Automate batch queries to SwissTargetPrediction using SMILES strings.
This Python script submits molecules, polls for results, and saves predictions to a CSV file.
Note: This tool is unofficial and not affiliated with the Swiss Institute of Bioinformatics (SIB). Please respect their server usage policies.
- Submit multiple SMILES strings in batch
- Automatically poll for job completion (up to 30 seconds by default)
- Parse and save target prediction results with:
- Target name
- UniProt & ChEMBL IDs
- Target class
- Probability score
- Known active compounds (3D/2D similarity)
- Save all results to a structured CSV file
- Python 3.12+
- Required packages:
pip install requests pandas lxml html5lib
-
Clone or download this repository
-
Install dependencies
pip install -r requirements.txt
-
Run the script
python swiss_target_batch.py
The default SMILES list is included for demo purposes. Replace it with your own:
smiles_list = [ "CC(=O)OC1=CC=CC=C1C(=O)O", # Aspirin "CN1C=NC2=C1C(=O)N(C(=O)N2C)C", # Caffeine # Add your SMILES here... ]
-
Results are saved to
swiss_results.csv(configurable viaoutput_csvparameter).
- Rate Limiting: The SwissTargetPrediction server may block or throttle frequent requests. The script includes a 2-second delay between submissions—do not remove it.
- Organism Support: Default is
"Homo_sapiens". Supported values include:"Homo_sapiens""Mus_musculus""Rattus_norvegicus"
| Target | Common name | Uniprot ID | ChEMBL ID | Target Class | Probability* | Known actives (3D/2D) | input_smiles |
|---|---|---|---|---|---|---|---|
| Cyclooxygenase-1 | PTGS1 | P23219 | CHEMBL221 | Oxidoreductase | 0.756002348928 | 3 / 2 | CC(=O)OC1=CC=CC=C1C(=O)O |
This code is released under the ISC License.
The data and predictions are owned by SwissTargetPrediction / SIB.
- SwissTargetPrediction – a free web service for target prediction.
- Swiss Institute of Bioinformatics (SIB)
🙏 Please cite the original SwissTargetPrediction paper if you use this in research!
Daina, A., Michielin, O., & Zoete, V. (2019). SwissTargetPrediction: updated data and new features for efficient prediction of protein targets of small molecules. Nucleic Acids Research, 47(W1), W357–W364. https://doi.org/10.1093/nar/gkz382