Skip to content

mitkeng/CCS_Focusing

Repository files navigation

python tensorflow user user user

CCS Focusing: conformational space focusing and ensemble distillation


image_1062b0ce

Introduction

CCS Focusing is a sequential machine learning model implemented in a python executable platform for use to reduce the number of conformers sampled post conformation generation, which is often necessary when modeling highly flexible systems like fatty acids. This is done by predicting the gas phase ion-neutral (i.e., $N_{2}$) collisional cross section (a molecular descriptor within the confines of ion-mobility mass spectrometry) values of raw conformers to determine their ion-mobility mass spectrometry (IM-MS) gas phase relevance.
The model is trained on computed CCS values from 3D structures that have been geometry optimized at the density functional theory (DFT) D3BJ-B3LYP/6-31G(d,p) for cation, $[M+H]^+$, and D3BJ-B3LYP/6-31+G(d,p) level of theory for anion, $[M-H]^-$.

The advantages ultimately are reduced computational workload downstream (e.g., quantum mechanical calculations) and improved gas phase structure prediction precision. Currently, the only model in this repository that has been validated for use is the lipid_model.keras for lipids; validations for other biomolecule classes are currently in progress.

Performance

The latest CCS prediction performance using our current dataset for lipid class molecules as compared to DFT derived CCS values is as follow:

focus

📘 Step-by-Step User Guide: CCS Focusing Pipeline

1. Environment Setup

The pipeline requires a mix of scientific libraries and machine learning frameworks.

Automated Installation: Run the provided shell script. It installs scientific packages (PyMOL, RDKit, ASE) via Mamba and Python dependencies via Pip.

chmod +x setup_env.sh
./setup_env.sh

Manual Installation (Fallback): If you prefer manual control, ensure you have a Conda environment active and run:

mamba install -c conda-forge rdkit ase pymol-open-source -y
pip install -r requirements.txt

2. Batch CCS Prediction

To predict CCS values for a folder full of .xyz files and save them to a CSV report:

Command:

python predict_ensemble.py --folder ./your_xyz_folder --output results.csv
  • --folder: Path to your directory containing conformers.
  • --output: The name of the CSV file where predictions will be stored.

3. CCS Focusing (Siphoning)

This command identifies conformers that match your experimental reference value and copies them to a new 'focused' directory.

Command:

python predict_ensemble.py \
    --folder ./your_xyz_folder \
    --target 145.0 \
    --tolerance 0.05 \
    --name MyMolecule \
    --output focused_results.csv

- `--target`: Your experimental CCS value (in Ų).
- `--tolerance`: The allowed deviation (e.g., `0.05` for 5%).
- `--name`: Prefix for the output folder (e.g., `MyMolecule_Target_145.0`).

4. Using the Python API

You can integrate these utilities into your own Python workflow using the ccs_focusing_utils module.

import tensorflow as tf
import ccs_focusing_utils as ccs_utils

# 1. Load the model
model = tf.keras.models.load_model('ML_ccs.keras')

# 2. Predict and siphon match conformers in one go
focused_dir = ccs_utils.filter_and_siphon_conformers(
    model=model,
    folder_path='input_xyz_files',
    experimental_ccs=142.5,
    std_error=0.03,
    compound_name='Inhibitor_Project'
)

print(f"Focused conformers saved in: {focused_dir}")

Remarks and Requirement

This program takes in an ensemble of raw conformers in atomic cartesian xyz format as input. As mentioned prior, CCS is predicted for $N_{2}$ as the neutral IM-MS collision gas. Only filtering and partitioning of conformers are accomplished; no alteration to conformer physical property is done. The filter size is automatically constructed from the model's latest performance standard prediction error and a user input reference CCS value.

Additional unvalidated models for other biomolecule classes are made available as dropdown options for use, but proceed with discretion.

Connection to Google Colab Notebook is required. Connecting to Google Drive for importing and exporting data or results are supported.

Web Application Option

Open In Colab to access CCS Focusing platform.

Complementary

Open In Colab to access proGENi conformation generation platform.

Citation

Keng, M.; Merz, K. M., Jr. Eliminating the Deadwood: A Machine Learning Model for CCS Knowledge-Based Conformational Focusing for Lipids. Journal of Chemical Information and Modeling 2024. DOI: 10.1021/acs.jcim.4c01051.

Acknowledgement

Merz research group

Quantum mechanical calculations and data used in building this model were organically generated through computational resources and services provided by the Institute for Cyber-Enabled Research (ICER) at Michigan State University.



About

Knowledge-based conformation filtering using collision cross section prediction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors