Skip to main content

A tool for the evaluation of molecules smiles

Project description

Molecules Evaluator: A Tool for the Evaluation of Molecule SMILES (a.k.a. mol_eval)

icon

Overview

mol_eval is a tool for evaluating SMILES data, particularly for distinguishing between real and fake SMILES sequences. It uses configurable thresholds and molecular descriptors to assess similarity and other properties such as solubility.

Coverage PyPI Latest Release Unit Tests Powered by TaccLab License


Features

  • Real vs Fake SMILES Evaluation: Compare real and synthetic SMILES sequences based on various similarity thresholds.
  • Similarity Metrics: Uses Levenshtein distance, Tanimoto coefficient, and molecular descriptors for comparison.
  • Configurable Analysis: Easily tweak similarity thresholds, solubility labels, and molecular descriptors through a configuration file.
  • Reports: Generate detailed evaluation reports based on the results.

Installation

To install mol_eval, you can use pip:

pip install mol_eval

Configuration

Before running the tool, you'll need to prepare your dataset and configuration file.

Step 1: Prepare Your Dataset Files

real_data.csv: This file should contain two columns:
    cmpd_name: The name of the compound.
    smile: The SMILES string representing the molecule.
fake_data.csv: This file should contain one column:
    smile: The SMILES string of synthetic molecules.

Step 2: Configuration File (config.json)

The configuration file allows you to set various thresholds and other parameters used in the evaluation. Here's an example configuration file:

{
    "LEVENSHTEIN_THRESHOLD": 0.5,
    "VERY_HIGH_SIMILARITY_THRESHOLD": 0.9,
    "HIGH_SIMILARITY_THRESHOLD": 0.88,
    "LOW_SIMILARITY_THRESHOLD": 0.3,
    "SOLUBILITY_THRESHOLDS": {
        "VERY_HIGH": -1,
        "HIGH": 0,
        "MODERATE": 2,
        "LOW": 4,
        "VERY_LOW": "Infinity"
    },
    "RELEVANT_DESCRIPTORS": [
        "MolWt", "MolLogP", "TPSA"
    ],
    "TANIMOTO_THRESHOLDS": {
        "VERY_HIGH": 0.9,
        "HIGH": 0.88,
        "MODERATE": 0.3
    },
    "VALID_SOLUBILITY_LABELS": ["VERY_HIGH", "HIGH", "MODERATE"],
    "VALID_TANIMOTO_LABELS": ["HIGH", "MODERATE", "LOW"],
    "MAX_SUBSTRUCTURES_MATCHES": 0,
    "REPORT_FOLDER": "./report"
}

Key Parameters Explained:

  • Thresholds: Customize similarity and solubility thresholds for better evaluation.
  • Descriptors: Choose molecular descriptors for evaluation, such as molecular weight (MolWt), logP (MolLogP), and polar surface area (TPSA).
  • Tanimoto and Levenshtein: Fine-tune the thresholds for calculating molecular similarity.
  • Solubility Labels: Define the solubility categories based on the solubility values.
  • Report Folder: Define where to save evaluation reports.

Usage

After installing the package and preparing your dataset and configuration file, you can run the evaluation tool via the command line. Run the Evaluation

Use the following command to evaluate your datasets:

mol_eval --real_data /path/to/real_data.csv --fake_data /path/to/fake_data.csv --configs /path/to/config.json
usage: mol_eval [-h] --real_data REAL_DATA --fake_data FAKE_DATA --configs CONFIGS

Molecule Evaluator: Evaluate real and fake SMILES data using a configuration file.

options:
  -h, --help            Show this help message and exit.
  --real_data REAL_DATA Path to the real SMILES data file (CSV).
  --fake_data FAKE_DATA Path to the fake SMILES data file (CSV).
  --configs CONFIGS     Path to the configuration JSON file.

Report Generation

The tool generates a report in the folder specified by REPORT_FOLDER in the configuration file (default is ./report). The report contains detailed information on the evaluation of the SMILES sequences, including similarity metrics, solubility predictions, and substructure matching.


Contributing

Contributions are welcome! Feel free to open issues or submit pull requests. Please ensure all tests pass and that the code follows the PEP 8 style guide.


License

This project is licensed under the terms of the GNU General Public License, Version 3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mol_eval-0.1.1.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mol_eval-0.1.1-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file mol_eval-0.1.1.tar.gz.

File metadata

  • Download URL: mol_eval-0.1.1.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for mol_eval-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8abe88864f0b74a320835d6b4f88be21c1720849dfa894f49ea24aa5ec1bf546
MD5 afc50e7e44796a4ee315d86f4bbb81eb
BLAKE2b-256 93bae83784c834a05fe1659f57c2d0bd7b58b20e0b3cb9d5b0c99cb0ea7d48b0

See more details on using hashes here.

File details

Details for the file mol_eval-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mol_eval-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for mol_eval-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc0acb8f2a635e05b5574d69088bfd54302c5fb97a5d2921dcfee83fd425fb28
MD5 a286013530718a7b9b1388ec0919daa6
BLAKE2b-256 b85669706bd12db21b511e54cfd492f15f273802f2f5b2218e71458d8cc21622

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page