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):
๐ 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
ipywidgetsenvironment 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
histfor property distributions,similarityfor structural clustering, andmatrixfor 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.csvor.xlsxformats, 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ils_screening_tm-0.1.3.tar.gz.
File metadata
- Download URL: ils_screening_tm-0.1.3.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fbe7657e2ca0bf00b488c69e9e904c6dc04512a9c92df12ee108a5ef009d5fa
|
|
| MD5 |
24a39389aaf58a61d8a1388ddcdb8385
|
|
| BLAKE2b-256 |
6dbebacd06e8766c658f22d537b224ccf9325301630005b634707e073406f789
|
File details
Details for the file ils_screening_tm-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ils_screening_tm-0.1.3-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a12ceb38506abdb5263d8aaedba7da046f997095625ec68a57d129d30b9119
|
|
| MD5 |
9ff2a4c37753e417dee65533871d69e0
|
|
| BLAKE2b-256 |
823e215f8a5e41553727ae9804f7e0c04251ea27837a79fd247b85d149435fd4
|