Skip to content

kuennethgroup/PolyToxiQ-Autogluon-Zeroshot

Repository files navigation

PolyToxiQ 🧬 : A Polymer Toxicity Prediction Web Application

🔍 About the Project

PolyToxiQ is a web-based tool that enables real-time toxicity prediction of polymers based on their structural fingerprints. Built using autoGloun based Zeroshot learning toxicity data (Tox21), the app allows users to input polymer structures via PSMILES strings or drawing tools and receive toxicity class ( High, medium and Low), similarity insights, and downloadable reports.

The web app deploys the best-performing Autogluon model results on polymer toxicity class prediction

🧬 Key Features

🚀 Input & Visualization

  • Intuitive Input: Users can either draw polymer structures using the integrated streamlit-ketcher tool or paste PSMILES strings directly.
  • PSMILES Standard: Input must include two [*] markers to clearly define the repeating unit of the polymer.

🧠 Model Inference Pipeline

  • Fingerprint Generation: The polymer structure is converted into a numerical vector (fingerprint) using PolyBERT, a chemical language model inspired by Natural Language Processing (NLP) concepts that treats the polymer structure as a chemical language.
  • Toxicity Prediction: The app uses the pre-trained Autogluon model model to classify the polymer into one of three toxicity concern levels (High, Medium and Low)

🔎 Similarity Matching

  • Cosine Similarity: The PolyBERT-generated fingerprint of the input polymer is compared to a reference database of Tox21 molecule fingerprints.
  • Similarity Ranking: The app displays the top-5 structurally similar Tox21 molecules from Tox21 Database, along with their cosine similarity scores (ranging from 0 to 1) and their known toxicity properties.

💾 Reporting

  • Export Results: Users can download the toxicity predictions and similarity ranking results in CSV format.

Methodology

  • AutoGluon & Scikit-learn: We used AutoGluon's TabularPredictor to build a robust machine learning model that classifies polymers into different toxicity levels ( High, Medium, and Low). The model was trained on a carefully curated dataset of Tox 21 datsets (4974) with their known toxicity level of concern(LoC).

  • Cosine Similarity: We calculate the cosine similarity between the PolyBERT Generated fingerprint of the input polymer and those in our reference database of Tox21 Molecule Fingerprints. This metric measures how similar two molecular structures are in their vector space representation, with values ranging from 0 (completely different) to 1 (identical).

  • Zero-Shot Transfer Learning: Our approach leverages transfer learning principles that allow us to make predictions on novel polymer structures that weren't present in the training data using Transfer learning of pre-trained Autogluon Model of Tox21 Molecule dataset. .


⚠️ Toxicity Classification Levels

Polymers are classified into three concern levels based on the cumulative count of confirmed hazard properties (out of 8 possible criteria, though the model predicts 4): Hazard Criteria (0 ≤ H.C. ≤ 8).

  • High ☣️☣️☣️☣️☣️: (4 < Hazard Criteria ≤ 8)
    • May pose significant health or environmental risks; requires strict handling protocols.
  • Medium ☣️☣️☣️: (2 < Hazard Criteria ≤ 4)
    • Moderately concerning toxicity; requires proper handling and disposal procedures.
  • Low ☣️: (0 ≤ Hazard Criteria ≤ 2)
    • Minimal toxicity concern under normal usage conditions.

🔗 References & Further Reading


⚙️ Installation Instructions

You can run this project locally using standard Python tools, or you can run it using Docker for a fully isolated environment.

Option 1: Local Installation (via pip)

  1. Prerequisites: Ensure you have Python 3.10 or higher installed on your system.
  2. Clone the repository:
    git clone [https://github.com/kuennethgroup/PolyToxiQ-Autogluon-Zeroshot.git](https://github.com/kuennethgroup/PolyToxiQ-Autogluon-Zeroshot.git)
    
  3. Create a virtual environment (Recommended):
 python -m venv venv
 source venv/bin/activate
4. Install dependencies:
 ```bash
 pip install -r requirements.txt

### Option 2: Installation via Docker
If you have Docker installed, you do not need to install Python or any dependencies locally.

1. Clone the Repository
 ```bash
 git clone [https://github.com/kuennethgroup/PolyToxiQ-Autogluon-Zeroshot.git](https://github.com/kuennethgroup/PolyToxiQ-Autogluon-Zeroshot.git)
 cd PolyBiodeg
2. Build the Docker image:
  ```bash
docker build -t polytoxiq-app

### Option 3: Running Instructions
1. Running Locally (Option 1)
 If you installed the project using the local pip method, ensure your virtual environment is activated, then run the following command from the root directory:
 ```bash
 streamlit run PolyToxiQ.py


 

    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors