Skip to content
Merged
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
139 changes: 139 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

#ignore lightning_logs folder anywhere in source tree
lightning_logs/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# 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/
.coverage
.coverage.*
.cache
.pytest_cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# DS Store:
.DS_Store

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# DS Store
.DS_Store

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Pycharm settings
.idea
*.iml
*.iws
*.ipr

# Ignore Sublime Text settings
*.sublime-workspace
*.sublime-project

# vim swap
*.swp

# mkdocs documentation
/site

# mypy
.mypy_cache/

# PyTorch Lightning logs
lightning_logs/
**/lightning_logs/

# profraw files from LLVM? Unclear exactly what triggers this
# There are reports this comes from LLVM profiling, but also Xcode 9.
*profraw

# In-tree generated files
*/_version.py
*/*/_version.py

# Cookiecutter-CMS Test Artifacts
/tests/CI_files
Empty file added pycomisa/__init__.py
Empty file.
29 changes: 17 additions & 12 deletions comsia.py → pycomisa/comsia.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from src.DataLoader import DataLoader
from src.MoleculeAligner import MoleculeAligner
from src.MolecularGridCalculator import MolecularGridCalculator
from src.MolecularFieldCalculator import MolecularFieldCalculator
from src.MolecularVisualizer import MolecularVisualizer
from src.PLSAnalysis import PLSAnalysis
from src.ContourPlotVisualizer import ContourPlotVisualizer
from pycomisa.src.DataLoader import DataLoader
from pycomisa.src.MoleculeAligner import MoleculeAligner
from pycomisa.src.MolecularGridCalculator import MolecularGridCalculator
from pycomisa.src.MolecularFieldCalculator import MolecularFieldCalculator
from pycomisa.src.MolecularVisualizer import MolecularVisualizer
from pycomisa.src.PLSAnalysis import PLSAnalysis
from pycomisa.src.ContourPlotVisualizer import ContourPlotVisualizer
import os
import argparse
from datetime import datetime
from datetime import datetime


data_loader = DataLoader()
aligner = MoleculeAligner()
field_calculator = MolecularFieldCalculator()
Expand All @@ -27,7 +29,7 @@
}


def main(input_file, sdf_activity, predict_file, grid_resolution, grid_padding, num_components, column_filter, visualization, fields):
def run_comisa(input_file, sdf_activity, predict_file, grid_resolution, grid_padding, num_components, column_filter, visualization, fields):
# Create the directory system for results
current_time = datetime.now()
directory_name = current_time.strftime("%Y-%m-%d_%H-%M-%S")
Expand Down Expand Up @@ -159,10 +161,13 @@ def create_parser():

return parser

if __name__ == "__main__":
def main():
parser = create_parser()
args = parser.parse_args()

main(args.train_file, args.sdf_activity, args.predict_file,
args.grid_resolution, args.grid_padding, args.num_components,
run_comisa(args.train_file, args.sdf_activity, args.predict_file,
args.grid_resolution, args.grid_padding, args.num_components,
args.column_filter, not args.disable_visualization, args.fields)

if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[build-system]
requires = ["setuptools>=61.0", "versioningit~=2.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pycomisa"
description = "A short description of the project (less than one line)."
dynamic = ["version"]
readme = "README.md"
license = { text = "MIT" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.10"

# Declare any run-time dependencies that should be installed with the package.
dependencies = [
"numpy",
"pyvista",
"pandas",
"rdkit",
"scikit-learn",
"matplotlib",
"seaborn",
"pubchempy"

]

[project.urls]

[project.optional-dependencies]
test = [
"pytest>=6.1.2",
]

[project.scripts]
pycomisa = "pycomisa.comsia:main"

[tool.setuptools]
# This subkey is a beta stage development and keys may change in the future, see https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html for more details
#
# As of version 0.971, mypy does not support type checking of installed zipped
# packages (because it does not actually import the Python packages).
# We declare the package not-zip-safe so that our type hints are also available
# when checking client code that uses our (installed) package.
# Ref:
# https://mypy.readthedocs.io/en/stable/installed_packages.html?highlight=zip#using-installed-packages-with-mypy-pep-561
zip-safe = false
# Let setuptools discover the package in the current directory,
# but be explicit about non-Python files.
# See also:
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration
# Note that behavior is currently evolving with respect to how to interpret the
# "data" and "tests" subdirectories. As of setuptools 63, both are automatically
# included if namespaces is true (default), even if the package is named explicitly
# (instead of using 'find'). With 'find', the 'tests' subpackage is discovered
# recursively because of its __init__.py file, but the data subdirectory is excluded
# with include-package-data = false and namespaces = false.
include-package-data = true
[tool.setuptools.packages.find]
namespaces = true
where = ["."]

[tool.setuptools.package-data]
"pycomisa.tests" = ["**"]



[tool.versioningit]
default-version = "1+unknown"

[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"

[tool.versioningit.vcs]
# The method key:
method = "git" # <- The method name
# Parameters to pass to the method:
match = ["*"]
default-tag = "0.0.0"