Skip to main content

A complete CLI QSAR pipeline for drug discovery and predictive toxicology

Project description

CAG-QSAR CLI Tool

A complete, production-grade command-line QSAR (Quantitative Structure-Activity Relationship) modeling pipeline. This tool automates the process of data curation, molecular descriptor calculation, feature selection, data splitting, model building, and rigorous validation.


Installation

You can install this package in Linux/WSL using three different methods, depending on your environment.

Prerequisites

Make sure you have Python (version >= 3.8) and pip installed:

sudo apt update
sudo apt install python3 python3-pip python3-venv -y

Option A: Install from PyPI (Once Published)

After publishing the package to PyPI, you can create a virtual environment and install the tool globally or locally using pip:

# 1. Create a virtual environment
python3 -m venv qsar_env
source qsar_env/bin/activate

# 2. Install the package from PyPI
pip install cagqsar

# 3. Run the CLI tool
cagqsar --help

Option B: Local Source Install (No root access required)

You can build and install the package locally from the repository folder:

# 1. Navigate to the repository directory
cd git_qsar

# 2. Create and activate a virtual environment
python3 -m venv qsar_env
source qsar_env/bin/activate

# 3. Install the package locally
pip install .

# 4. Run the CLI tool
cagqsar --help

Option C: Editable Development Mode

If you plan to modify the source code of the pipeline and want changes to reflect instantly:

pip install -e .

Command Line Usage

After installation, run the application from any directory in your terminal:

cagqsar --data <dataset_csv> --smiles <smiles_column> --activity <activity_column> [options]

Core CLI Arguments:

  • --data: Path to the CSV dataset (Required).
  • --smiles: Column name containing SMILES strings (Required).
  • --activity: Column name containing activities in nM (Required).
  • --model: Regression algorithm to train: mlr (MLR), pls (PLS), rf (Random Forest), svr (SVM), xgb (XGBoost), or gnn (Graph Neural Network) (Default: pls).
  • --split: Splitting method: random or pca (Kennard-Stone PCA-distance split) (Default: pca).
  • --test_size: Fraction of data allocated to the test set (Default: 0.2).
  • --var_thresh: Variance filter threshold for dropping constant descriptors (Default: 0.01).
  • --corr_thresh: Correlation threshold for collinearity filter (Default: 0.85).
  • --y_rand_runs: Number of Y-randomization validation loops (Default: 50).
  • --fingerprints: Flag to compute 2D fingerprints (Morgan/ECFP + MACCS keys) in addition to physical descriptors.
  • --out_dir: Directory to export curated data, model reports, trained model binaries, and evaluation plots (Default: qsar_output).

Programmatic Import in Python

Once the package is installed, you can import and use any of its internal logic (like the structure curator or descriptor calculator) in your own scripts:

from cagqsar import curate_molecule, get_rdkit_descriptors

# 1. Clean a SMILES structure and remove salt fragments
clean_smiles, mol = curate_molecule("CN(C)C(=O)c1ccccc1.Cl", Chem.SaltRemover.SaltRemover())

# 2. Extract standard RDKit descriptors
descriptors = get_rdkit_descriptors(mol)

Publishing to GitHub & PyPI

Follow these instructions to publish your code for public access.

1. Publishing to GitHub

Initialize the local git repository, commit the files, and push to GitHub:

# 1. Initialize repository
git init

# 2. Add files (automatically respects .gitignore)
git add .

# 3. Create initial commit
git commit -m "feat: initial release of cagqsar v1.0.0"

# 4. Set main branch name
git branch -M main

# 5. Add remote GitHub link and push
git remote add origin https://github.com/YOUR_USERNAME/cagqsar.git
git push -u origin main

2. Publishing to PyPI

To make the tool installable globally via pip install cagqsar, build and upload the package distributions to the Python Package Index (PyPI):

# 1. Install packaging build tools
pip install --upgrade build twine

# 2. Compile source distribution (sdist) and binary wheel (bdist_wheel)
python3 -m build

# 3. Verify build files
twine check dist/*

# 4. Upload to PyPI (requires PyPI API Token)
python3 -m twine upload dist/*

Acknowledgments & Credits

  • Concept, Idea & Planning: Sathish Kumar M Ponnaiya (SKM Ponnaiya).
  • Infrastructure & Support: Ponnaiya's Code And Genome Pvt Ltd, Madurai (System support, server resources, internet facilities, and infrastructure).
  • AI Coding Partner: Pair-programmed and optimized using Antigravity, a Google DeepMind agentic coding system.
  • Large Language Model (LLM): Driven by Google's Gemini 3.5 Flash.
  • Access Provider: Grateful to Jio for enabling Gemini Premium access.
  • Test Dataset: Sourced from the public BindingDB database.

This software is open-access and free for all users under the terms of the MIT License.

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

cagqsar-1.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

cagqsar-1.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file cagqsar-1.1.0.tar.gz.

File metadata

  • Download URL: cagqsar-1.1.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cagqsar-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5aae1575c1ffeaabea83d8a364aecb024bf5f18dd12c53b9fca7580e19e50acd
MD5 48caaae4472a3a6b0e4a4e8db42738f4
BLAKE2b-256 1be226b01635e990083edf752acdf08fb1ae5f870c5b53f63b4cb13681ce3dd9

See more details on using hashes here.

File details

Details for the file cagqsar-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: cagqsar-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cagqsar-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10c4eed220086761ff596238cd886a1918d03591a4f9f6d3fbdab0694a89d1c2
MD5 749fe8c3fcc1072921daba879d8c1878
BLAKE2b-256 8fa6763dae627aaa727b17b2c24c1364c08e47f6279756ea3fb5ba04dcbf2504

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