Skip to main content

An interactive screening tool for ionic liquid cation generation, structural filtering, and melting point (Tm) prediction.

Project description

ILs-screening-tm

An interactive, modular screening tool for ionic liquid cation generation, structural filtering, synthetic accessibility scoring, and machine learning-driven melting point ($T_m$) prediction.

This repository decouples core chemical and deep learning calculations from the interactive user interface, providing a clean production pipeline suitable for virtual materials discovery.

You can run the entire interactive pipeline directly in your browser without installing anything locally. Click the badge below to launch the pre-configured environment in Google Colab (remember to run the setup cell at the top to initialize the environment and display the interactive UI):

Open In Colab


Graphical Abstract

๐Ÿ“‚ Repository Structure

The repository is organized into distinct structural layers following software development standards:

Git/
โ”œโ”€โ”€ ils_screening_tm/          # Core production Python package
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py                # Class ILsScreening, Pipeline orchestrator & UI (ipywidgets)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ data/                  # Fixed chemical source libraries
โ”‚   โ”‚   โ”œโ”€โ”€ base_cations.csv
โ”‚   โ”‚   โ”œโ”€โ”€ substituents_library.csv
โ”‚   โ”‚   โ””โ”€โ”€ anions_library.csv
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ Models/                # Deep learning weights & feature scalers
โ”‚       โ”œโ”€โ”€ pscnn_fold_1.keras ... pscnn_fold_5.keras
โ”‚       โ”œโ”€โ”€ scaler_mordred.pkl
โ”‚       โ””โ”€โ”€ for-external.pkl
โ”‚
โ”œโ”€โ”€ tests/                     # Interactive testing & Validation notebooks
โ”‚   โ””โ”€โ”€ test_pipeline.ipynb    # Demo notebook to launch the UI
โ”‚
โ”œโ”€โ”€ training/                  # Research environment for model development
โ”‚   โ”œโ”€โ”€ dataset/
โ”‚   โ”‚   โ””โ”€โ”€ tm_data.csv        # Curated experimental benchmark training set
โ”‚   โ””โ”€โ”€ train_tm_model.py      # Dual-Input Parallel-Scaffold CNN training script
โ”‚
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

โš™ The Screening Pipeline Workflow

The package orchestrates a sequential pipeline using an object-oriented API with method chaining (.generation().sascore().tm()). All calculations modify an internal self.df state registry in memory, bypassing unnecessary disk read/write overhead:

1. Scaffold Selection & UI Interaction (.generation())

  • Interactive Trigger: Launches the interactive ipywidgets environment to choose a base cation, configure anchor sites, and define substituent groups.
  • Library Expansion: Generates functionalized cations based on combinatorial substitution rules, validated against internal structural constraints.

2. Synthetic Accessibility Filtering & Anion Pairing (.sascore())

  • Computes SAScores (via RDKit contributions) and enforces a strict synthesis gate (default threshold=6.0) to discard overly complex entities.
  • Automatically triggers a cross-join with the package's internal anion library to build the complete salt matrix.

3. Deep Learning $T_m$ Prediction (.tm())

  • Computes Mordred structural descriptors and feeds data into a 5-Fold Cross-Validation Ensemble of Parallel-Scaffold Convolutional Neural Networks (PSCNN).
  • Applies a room-temperature/low-melting screening threshold (default $T_m \le 100^\circ\text{C}$).

4. Advanced Diagnostics & Visual Reporting (.plot())

  • Multi-Modal Analytics: Supports diverse representations including hist for property distributions, similarity for structural clustering, and matrix for comparative property grid screening.
  • Automated Rendering: Dynamically handles data scaling, labeling, and layout finalization for publication-quality visual output.

5. Data Serialization & Persistence (.save() & .load())

  • Persistence (.save()): Serializes the internal DataFrame (self.df) into .csv or .xlsx formats, allowing for precise output control via column filtering.
  • Rehydration (.load()): Restores previously saved libraries, ensuring seamless workflow resumption and maintaining consistency across independent sessions.

๐ŸŽ›๏ธ Interactive Dashboard Features

The screening pipeline comes with an intuitive ipywidgets-based graphical interface that allows you to easily configure your structural modifications and screening constraints in real-time.

1. Screening Bounds Settings (Advanced Performance)

At the top of the interface, two numeric entry boxes protect your workstation or server memory against combinatorics explosions:

  • Max Subts: Controls the maximum number of unique substituents loaded from your library for each active chemical site family.
  • Max Comb: Sets a hard absolute ceiling for the total number of generated cation structures. If the combinatorics estimation exceeds this number, the generation safely truncates to prevent Out of Memory crashes.

2. Scaffold Selection & Core Slicing

  • Cation Core Dropdown: Select your available base cation scaffolds from the loaded database: Pyrrolidinium, Pyridinium, Piperidinium, Ammonium, Phosphonium, Sulfonium, Imidazolium.
  • Cut Atoms Selector: Select one or multiple atom indices to dynamically remove them from the structure, opening up new coordination sites for branching.

3. Symmetries & Validation

  • Detected Symmetries: Once an anchor placeholder ([*]) is detected on the remaining core structure, dropdown menus automatically appear to configure architectural symmetries and local substitution groups dynamically.
  • Validate & Launch Screening Button: Automatically triggers the full sequence (.set_scaffold(), .generation(), .sascore(), .tm()) using your custom graphic selections.

๐Ÿš€ Execution & Interactive UI

Testing and running the pipeline is containerized inside the tests/ directory to protect production code from volatile Jupyter execution paths.

1. Initializing the Notebook Environment

To test the pipeline locally, open tests/test_pipeline.ipynb and execute the following setup block. It includes the %autoreload magic extension to seamlessly catch local main.py source modifications:

import os
import sys

# Activate Jupyter auto-reload
%load_ext autoreload
%autoreload 2

# Append parent directory to sys.path so Python detects the package locally
sys.path.append(os.path.abspath('..'))

from ils_screening_tm.main import ILsScreening

# Instantiate the pipeline
ils = ILsScreening()

# Launch the interactive interface
ils.generation()

2. Running a Standalone Python Script (Bypassing UI)

You can entirely bypass the graphical dashboard for non-interactive automated scripts or massive workflows by pre-defining a target atom-mapped scaffold string:

from ils_screening_tm.main import ILsScreening

# Fluent method chaining
ils = ILsScreening()
ils.set_scaffold("C1=[N+]([*:201])CCN1[*:202]") \
   .generation(limit_nb=2) \
   .sascore(threshold=5.5) \
   .tm(threshold_c=80.0) \
   .heatmap(mode='tm') \
   .show(sample_size=4)

๐Ÿ“ฆ Installation & Local Usage

Standard Installation (via PyPI)

If you prefer to run the screening pipeline locally on your machine, the package is officially hosted on PyPI. You can install it and all its core dependencies with a single command:

pip install ils-screening-tm

Local Installation

To install the package in editable development mode (useful if you want to modify the source code), clone the repository and run from the root directory:

pip install -e .

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

ils_screening_tm-0.1.4.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

ils_screening_tm-0.1.4-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file ils_screening_tm-0.1.4.tar.gz.

File metadata

  • Download URL: ils_screening_tm-0.1.4.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.16

File hashes

Hashes for ils_screening_tm-0.1.4.tar.gz
Algorithm Hash digest
SHA256 31bbd7075ddfdeff5b6fac4301ec613729541de481d8992f0f9144142e95e294
MD5 3b7e9e8b122afdda231cc22128a551bf
BLAKE2b-256 f6b779bf84ba9c1568e9aa08b3623c2ee94efb53951f7326beba10cb71f1d08b

See more details on using hashes here.

File details

Details for the file ils_screening_tm-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ils_screening_tm-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a27838cfccfa2642481898f00b2f85613948f3477493527c55bac56274fc2a9b
MD5 840115df8efcf6f011d84e1a4c357104
BLAKE2b-256 2f02c0f25910d6443e32f6947ea5a4c86bd14dce5287bef30d3ac190503d59c6

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