Skip to content

ntua-unit-of-control-and-informatics/jaqpot-pyrosage-model

Repository files navigation

Jaqpot Pyrosage Model

Docker image for deploying Pyrosage AttentiveFP models on the Jaqpot platform. This service provides predictions for environmental and toxicity properties of chemical compounds using Graph Neural Networks.

Available Models

Classification Models

  • AMES: Mutagenicity prediction
  • Endocrine_Disruption_NR-AR: Androgen receptor disruption
  • Endocrine_Disruption_NR-AhR: Aryl hydrocarbon receptor disruption
  • Endocrine_Disruption_NR-ER: Estrogen receptor disruption
  • Endocrine_Disruption_NR-aromatase: Aromatase disruption
  • Irritation_Corrosion_Eye_Corrosion: Eye corrosion prediction
  • Irritation_Corrosion_Eye_Irritation: Eye irritation prediction

Regression Models

  • FBA: Bioaccumulation Factor
  • FBC: Bioconcentration Factor
  • KH: Henry's Law Constant
  • KOA: Octanol-Air Partition Coefficient
  • KOC: Soil/Water Partition Coefficient
  • KOW: Octanol-Water Partition Coefficient (LogP)
  • LC50: Aquatic toxicity
  • LD50_Zhu: Acute oral toxicity
  • PLV: Vapor pressure related
  • SW: Water solubility
  • TBP: Biodegradation related
  • TMP: Melting point related
  • kAOH: Aqueous hydroxyl rate
  • pKa_acidic: Acidic pKa
  • pKa_basic: Basic pKa
  • tbiodeg: Biodegradation time
  • tfishbio: Fish bioaccumulation time

Usage

Input Format

The service expects input with two required columns:

  • smiles: SMILES string representation of the molecule
  • model_name: Name of the model to use for prediction

Example input:

{
  "dataset": {
        "type": "PREDICTION",
        "entryType": "ARRAY",
        "input": [
            {
                "smiles": "CCO",  # Ethanol
                "model_name": "AMES",
                "jaqpotRowId": 1
            },
            {
                "smiles": "c1ccccc1",  # Benzene
                "model_name": "KOW",
                "jaqpotRowId": 2
            }
        ]
    },
    "model": {
        "id": 1,
        "type": "SKLEARN_ONNX",
        "task": "MULTICLASS_CLASSIFICATION",
        "rawModel": "pyrosage_attentivefp",
        "independentFeatures": [
            {"key": "smiles", "name": "SMILES", "featureType": "STRING"},
            {"key": "model_name", "name": "Model Name", "featureType": "STRING"}
        ],
        "dependentFeatures": [
            {"key": "prediction", "name": "Prediction", "featureType": "CATEGORICAL"}
        ]
    }
}

Output Format

The service returns predictions with metadata:

For classification models (returns 0/1):

{
  "predictions": [
    {
      "prediction": 1,
      "jaqpotMetadata": {
        "jaqpotRowId": 1,
        "model_name": "AMES",
        "model_type": "classification",
        "smiles": "CCO",
        "probability": 0.557,
        "predicted_class": 1
      }
    }
  ]
}

For regression models (returns continuous values):

{
  "predictions": [
    {
      "prediction": 2.15,
      "jaqpotMetadata": {
        "jaqpotRowId": 2,
        "model_name": "KOW",
        "model_type": "regression", 
        "smiles": "c1ccccc1"
      }
    }
  ]
}

Building and Running

Build Docker Image

docker build -t jaqpot-pyrosage-model .

Run Locally

docker run -p 8000:8000 jaqpot-pyrosage-model

Test Health Check

curl http://localhost:8000/health

Test Prediction

curl -X POST "http://localhost:8000/infer" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset": {
      "type": "TABULAR",
      "entryType": "ARRAY",
      "input": [
        {
          "smiles": "CCO",
          "model_name": "AMES",
          "jaqpotRowId": 1
        }
      ]
    },
    "model": {
      "type": "TORCH_GEOMETRIC",
      "task": "MULTICLASS_CLASSIFICATION",
      "rawModel": "pyrosage_attentivefp",
      "independentFeatures": [
        {"key": "smiles", "name": "SMILES", "featureType": "TEXT"},
        {"key": "model_name", "name": "Model Name", "featureType": "TEXT"}
      ],
      "dependentFeatures": [
        {"key": "prediction", "name": "Prediction", "featureType": "NUMERIC"}
      ]
    }
  }'

Model Details

All models are based on AttentiveFP (Attention-based Fingerprint) architecture:

  • Input: Enhanced molecular graphs with 10-dimensional atom features and 6-dimensional bond features
  • Architecture: Graph Neural Network with attention mechanism
  • Features:
    • Atom features: atomic number, degree, formal charge, hydrogens, radical electrons, aromaticity, ring membership, hybridization
    • Bond features: bond type, conjugation, ring membership

Error Handling

If a prediction fails (e.g., invalid SMILES, unknown model), the service returns:

{
  "predictions": [
    {
      "prediction": null,
      "error": "Error description",
      "jaqpotMetadata": {
        "jaqpotRowId": 1,
        "model_name": "AMES",
        "smiles": "invalid_smiles",
        "status": "failed"
      }
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published