Metadata-Version: 2.4
Name: pKaPredict
Version: 0.1.6
Summary: pKaPredict project
Project-URL: source, https://github.com/candicehbt/pKaPredict
Project-URL: tracker, https://github.com/candicehbt/pKaPredict/issues
Author-email: Anastasia&Candice <anastasia.floris@epfl.ch>
License: MIT License
        
        Copyright (c) 2024 by Anastasia&Candice <anastasia.floris@epfl.ch candice.habert@epfl.ch>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.10
Requires-Dist: ipython
Requires-Dist: lazypredict
Requires-Dist: lightgbm
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: rdkit
Requires-Dist: requests
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: seaborn
Requires-Dist: tqdm
Provides-Extra: doc
Requires-Dist: furo; extra == 'doc'
Requires-Dist: myst-parser; extra == 'doc'
Requires-Dist: sphinx-copybutton; extra == 'doc'
Requires-Dist: sphinx>=5; extra == 'doc'
Provides-Extra: test
Requires-Dist: genbadge[coverage]; extra == 'test'
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: tox; extra == 'test'
Description-Content-Type: text/markdown

![Project Logo](assets/banner.png)

![Coverage Status](assets/coverage-badge.svg)

<h1 align="center">
pKaPredict
</h1>

<br>




## 📦 Overview

*pKaPredict* is a cheminformatics tool that predicts the acid dissociation constant (pKa) of chemical compounds from their SMILES strings.  The package is designed to be easily pip-installable and modular, making it ideal for cheminformatics applications. The package combines RDKit generated molecular descriptors with a pre-trained LGBMRegressor model for fast, reproducible predictions. The workflow includes training data preprocessing, descriptor generation, model loading, prediction, and result visualization.

💡 Main Functions :

*Functions used to train the machine learning model on a training dataset*

→ **clean_and_visualize_pka**
Cleans the training dataset by removing duplicates and missing values; also provides basic visualizations for data exploration.

→ **RDKit_descriptors**
Transforms a DataFrame of SMILES into molecular descriptors, used for training the model.
    
→ **plot_data**
Creates scatter plots comparing predicted vs. experimental pKa values to evaluate model performance and choose the most adapted model for this usage.

*Core functions for predicting pKa from user-provided SMILES inputs*

→ **load_model**
Loads the pre-trained LightGBM model optimized for pKa prediction.

→ **smiles_to_rdkit_descriptors**
Converts a user-provided SMILES input into a vector of RDKit molecular descriptors.

→ **predict_pKa**
Takes molecular descriptors as input and returns predicted pKa values using the loaded model.


## 👩‍💻 Installation

1. **Clone the repository**:

```bash
git clone https://github.com/anastasiafloris/pKaPredict.git
cd pKaPredict
```
2. **Create and activate the conda environnement**:
```bash
conda create -n pkapredict_env python=3.10 -y
conda activate pkapredict_env
```
3. **Install the package**:
```bash 
pip install pKaPredict
```

🍏 For macOS users (⚠ required for LightGBM to work):

4. **Install the system library libomp**:
```bash
brew install libomp
```
If brew is not installed, follow the instructions here: https://brew.sh

5. **Navigate to the root source of the package from your terminal**:
```bash
cd src
cd pkapredict
```
6. **The package is yours 🎁**:

Run the test_package.py file in your terminal to predict the pKa of a molecule of your choice, using its SMILES string:
```bash
python test_package.py
```

## 🪪 License 

This project is licensed under the MIT License.  
You are free to use, modify, and distribute it with proper attribution.


## 📗 References

The dataset used in this project is the [test_acids_bases_descfinal_nozwitterions.csv](https://github.com/cbio3lab/pKa/blob/main/Data/test_acids_bases_descfinal_nozwitterions.csv) file from the cbio3lab repository.  
It was originally extracted from the Harvard [Dataverse](https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/6A67L9).

## 👯‍♀️ Authors

This project was completed as part of the EPFL course *Practical Programming in Chemistry*.
- [Anastasia Floris](https://github.com/anastasiafloris)  
- [Candice Habert](https://github.com/candicehbt)