Skip to content

YumeAyai/swiss_target_batch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwissTargetPrediction Batch Client

English | 中文

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.


✨ Features

  • 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

🛠️ Requirements

  • Python 3.12+
  • Required packages:
    pip install requests pandas lxml html5lib

🚀 Usage

  1. Clone or download this repository

  2. Install dependencies

    pip install -r requirements.txt
  3. 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...
    ]
  4. Results are saved to swiss_results.csv (configurable via output_csv parameter).


⚠️ Important Notes

  • 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"

📄 Example Output (swiss_results.csv)

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

📜 License

This code is released under the ISC License.
The data and predictions are owned by SwissTargetPrediction / SIB.


💡 Acknowledgments


🙏 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

About

Automated batch client for SwissTargetPrediction — Submit SMILES strings programmatically, retrieve protein target predictions (including UniProt/ChEMBL IDs, probability scores, and known actives), and export results to CSV. Unofficial, lightweight, and research-friendly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages