Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Codecov configuration to make it a bit less noisy
coverage:
status:
patch: false
project:
default:
threshold: 50%
comment:
layout: "header"
require_changes: false
branches: null
behavior: default
flags: null
paths: null
143 changes: 143 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# PyCharm
.idea/

# VS Code
.vscode/

# macOS
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

Moreover, project maintainers will strive to offer feedback and advice to
ensure quality and consistency of contributions to the code. Contributions
from outside the group of project maintainers are strongly welcomed but the
final decision as to whether commits are merged into the codebase rests with
the team of project maintainers.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an
appointed representative at an online or offline event. Representation of a
project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at 'jenke.scheen@choderalab.org'. The project team will
review and investigate all complaints, and will respond in a way that it deems
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details of
specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
[http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include CODE_OF_CONDUCT.md

global-exclude *.py[cod] __pycache__ *.so
94 changes: 12 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,18 @@
# Py-CoMSIA: Pythonic CoMSIA 3D QSAR
pycomsia
==============================
[//]: # (Badges)
[![GitHub Actions Build Status](https://github.com/REPLACE_WITH_OWNER_ACCOUNT/pycomsia/workflows/CI/badge.svg)](https://github.com/REPLACE_WITH_OWNER_ACCOUNT/pycomsia/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/REPLACE_WITH_OWNER_ACCOUNT/pycomsia/branch/main/graph/badge.svg)](https://codecov.io/gh/REPLACE_WITH_OWNER_ACCOUNT/pycomsia/branch/main)

`comsia.py` is a Python implementation of Comparative Molecular Similarity Indices Analysis (CoMSIA), a 3D Quantitative Structure-Activity Relationship (QSAR) method. This tool allows you to analyze molecular fields and predict biological activities based on molecular structures.

## Citing Py-CoMSIA
A short description of the project (less than one line).

If you use Py-CoMSIA in your work, please cite our publication:
### Copyright

Haga, C. L., Le, C. N., Yang, X. D., & Phinney, D. G. (2025). Py-CoMSIA: An Open-Source Implementation of Comparative Molecular Similarity Indices Analysis in Python. Pharmaceuticals, 18(3), 440. https://doi.org/10.3390/ph18030440
Copyright (c) 2026, jscheen

https://www.mdpi.com/1424-8247/18/3/440

## Features

* **CoMSIA Field Calculation:** Calculates steric, electrostatic, hydrophobic, hydrogen bond donor, and hydrogen bond acceptor fields.
* **PLS Regression:** Utilizes Partial Least Squares (PLS) regression for building QSAR models.
* **Flexible Input:** Supports both CSV files (SMILES and activity data) and pre-aligned SDF files.
* **Grid-Based Analysis:** Configurable grid resolution and padding for field calculations.
* **Field Selection:** Allows you to select specific fields for analysis.
* **Visualization:** (Optional) Visualization of the CoMSIA fields and PLS results.
* **Prediction:** Predict activities for new compounds based on the trained model.
* **Column filtering:** option to filter out columns with low variance.

## Installation

1. **Clone the repository:**

```bash
git clone https://github.com/clhaga/pycomsia
cd pycomsia
```

2. **Install dependencies:**

```bash
pip install -r requirements.txt
```

## Usage

```bash
python comsia.py --train_file <train_file> [options]
```

## Arguments
--train_file (required): Path to the training data. Can be a CSV file with SMILES and activity data or an SDF file containing pre-aligned molecules and activity data.

--predict_file: Path to the input CSV or SDF file for prediction.

--sdf_activity: Activity to use for SDF file. Required if using an SDF file.

--grid_resolution: Resolution of the grid used for field calculation. (default: 1.0)

--grid_padding: Padding of the grid used for field calculation. (default: 3.0)

--fields: Fields to use for analysis. Options: steric, electrostatic, hydrophobic, donor, acceptor, all. (default: all)

--num_components: Number of components for PLS analysis. (default: 12)

--column_filter: Column filtering. (default: 0.0)

--disable_visualization: Disable visualization. (default: False)

## Data Format
CSV:
One molecule per row.
A column for SMILES strings.
A column for the activity data.

SDF:
Molecules should be pre-aligned.
The SDF file must contain a property field corresponding to the activity data.
Use --sdf_activity to specify the property name.

## Tests from publication

To run the examples from the publication, simply execute the following:

```bash
python comsiatest.py
```
## Molecule Imager

Creates a png file of molecules in an SDF file with IUPAC names (if available).

```bash
python moleculeimager.py SDF_file_name.sdf
```
#### Acknowledgements

Project based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.11.
Loading