Skip to content
This repository was archived by the owner on Apr 8, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
e715d24
change the code and test code to be compatible with networkx 2
shuail Apr 23, 2018
adfe11e
update the networkx version in meta.yaml
shuail Apr 23, 2018
d5887d2
cupdate the readme file
shuail Apr 23, 2018
83868c5
change the travis python testing version to skip python 3.4
shuail Apr 30, 2018
840454f
change the networkx version
shuail Apr 30, 2018
69fa219
change the pyqt version in the run section of meta.yaml file
shuail May 4, 2018
b7f6473
update rdkit version to pass the python 3.5 test
shuail Aug 13, 2018
e760130
update rdkit version to pass the python 3.5 test
shuail Aug 13, 2018
bf65090
roll back to rdkit default version
shuail Aug 13, 2018
f79d82a
adding versioneer to repo
ppxasjsm Oct 16, 2018
d9b5cb8
tidying repository and setup.py
ppxasjsm Oct 16, 2018
2e6a3b7
adding python realted gitignore
ppxasjsm Oct 16, 2018
5c9ccdb
adding changelog information for future versions
ppxasjsm Oct 16, 2018
3a5f2ab
testing CI on networkx branch without conda
ppxasjsm Oct 16, 2018
a9ff6e1
the long quest of getting travis to run on networkx branch
ppxasjsm Oct 16, 2018
ef5f57b
tinkering with travis
ppxasjsm Oct 16, 2018
2df5d20
travis tinkering still
ppxasjsm Oct 16, 2018
17c77d1
updating manifest for travis
ppxasjsm Oct 16, 2018
b05ffdc
updated init for versioning
ppxasjsm Oct 16, 2018
8342b90
fix in setup
ppxasjsm Oct 16, 2018
673b6fc
yey travis
ppxasjsm Oct 16, 2018
528cc55
testing python 3 not 2
ppxasjsm Oct 16, 2018
a7545be
trying to fix python version issue
ppxasjsm Oct 16, 2018
7f3ace4
all the travis fun
ppxasjsm Oct 16, 2018
20e1a55
fixing Pep* convention and trailing whitespaces issue
ppxasjsm Oct 16, 2018
fa24ec7
ugh travis
ppxasjsm Oct 16, 2018
7d5a346
ugh travis again
ppxasjsm Oct 16, 2018
67ee935
are you a valid yml?
ppxasjsm Oct 16, 2018
fe3bd91
are you a valid yml?
ppxasjsm Oct 16, 2018
d61ab1b
adding pyqt4 dependcy to travis
ppxasjsm Oct 16, 2018
787f1ba
welcome to conda dependency hell
ppxasjsm Oct 16, 2018
dba977b
matplotlib 1.5
ppxasjsm Oct 16, 2018
9e97a08
adding pygraphviz
ppxasjsm Oct 16, 2018
f0d52a1
only build for devel and master
ppxasjsm Oct 16, 2018
934e341
adding code coverage
ppxasjsm Oct 17, 2018
503a1df
coverage with feture branch
ppxasjsm Oct 17, 2018
cfba8e0
removing pyqt4 dependency using xdpyinfo for screen resolution instead
ppxasjsm Oct 18, 2018
313a888
explicit adding of numpy to travis
ppxasjsm Oct 18, 2018
ea9e6ff
proting first lomap tests to pytest and updating travis to test with …
ppxasjsm Oct 18, 2018
3123d54
trying to get a code coverage report
ppxasjsm Oct 18, 2018
1ce6c1e
updating pickle files to be compatible with networkx >2
ppxasjsm Oct 23, 2018
60e4b6d
porting of nose to pytest with network generation
ppxasjsm Oct 23, 2018
0b32a94
updated pickle graph for basic network generation
ppxasjsm Oct 23, 2018
a800db5
removing poor white spacings
ppxasjsm Oct 23, 2018
aa8fb0e
updating path in example scripts
ppxasjsm Oct 23, 2018
c8918f6
updated readme
ppxasjsm Oct 23, 2018
b5cab9b
improving readme documentaiton
ppxasjsm Oct 23, 2018
4e76405
temporarily removing codecoverage from travis
ppxasjsm Oct 23, 2018
90b3731
more verbose for travis
ppxasjsm Oct 27, 2018
714605c
whitespace issues
ppxasjsm Oct 27, 2018
d289159
going back to old files for unit tests
ppxasjsm Oct 27, 2018
0b5b02c
white spaces
ppxasjsm Oct 29, 2018
e15d254
fixing tests
ppxasjsm Oct 29, 2018
d95425c
more white spaces
ppxasjsm Oct 29, 2018
6b16900
cahnging rdkit version
ppxasjsm Oct 29, 2018
fa24882
adding version to argprase printout
ppxasjsm Nov 19, 2018
bba4256
refactoring method names away from camel case
ppxasjsm Nov 19, 2018
3ed43ea
some small reformatting of code for PEP8
ppxasjsm Nov 21, 2018
a0086d5
refactor of writing graph function
ppxasjsm Dec 6, 2018
994251d
fixing typo
ppxasjsm Jan 22, 2019
ad881bf
Merge pull request #48 from MobleyLab/feat_pytest
ppxasjsm Jan 22, 2019
e08fca9
Improvements to lomap:
mark-mackey-cresset Mar 6, 2019
b6f1fd4
Added support for SDF files as well as mol2
mark-mackey-cresset Mar 6, 2019
bac6c64
Improved error handling and behaviour of -l option
mark-mackey-cresset Mar 6, 2019
c364e7d
Improvements to lomap:
mark-mackey-cresset Mar 13, 2019
852079e
More improvements: fixed bug with max3d parameter to mcs, added code to
mark-mackey-cresset Mar 13, 2019
7be917f
Updated lomap algorithm to try to avoid acyclic edges in the graph,
mark-mackey-cresset Mar 14, 2019
b574b18
Minor efficiency improvement in graph cycle calculations
mark-mackey-cresset Mar 14, 2019
1261e71
Improved atomic_number rule to be more consistent with the others. Ad…
mark-mackey-cresset Mar 14, 2019
826ab5a
Added the start of a proper unit test set for the features in lomap.
mark-mackey-cresset Mar 14, 2019
dd484d2
Added transmute_methyl_into_ring rule. Doesn't currently work properly
mark-mackey-cresset Mar 15, 2019
66642bd
New testing file
mark-mackey-cresset Mar 15, 2019
577ca4b
Added command line option '--output-no-images' which disabled the image
Mar 26, 2019
63fd168
Improved the parsing of the linksfile commandline option.
Mar 26, 2019
8393035
Added --output-no-graph option to disable generation on the graph (.d…
Mar 27, 2019
1ccfa13
Deleted temp file
mark-mackey-cresset May 7, 2019
fa42938
Added new test files
mark-mackey-cresset May 7, 2019
6a9f6b1
Implemented new scoring rules (sulfonamides, heterocycles,
mark-mackey-cresset May 8, 2019
621159b
Store the MCS data for each molecule pair until the end of the
mark-mackey-cresset May 8, 2019
2b8879e
Fixes for hydrogen mapping code in the MCS. Added lots of test cases.
mark-mackey-cresset May 8, 2019
f53f79f
Fixed argument parsing in lomap
mark-mackey-cresset May 17, 2019
ac0bbef
Removed getMapping function as this is unused.
mark-mackey-cresset May 17, 2019
d7d918c
Updated lomap test suite
mark-mackey-cresset May 17, 2019
2909573
Improved unit tests
mark-mackey-cresset May 17, 2019
937b227
Minor improvements to test suite
mark-mackey-cresset May 17, 2019
91e1dca
Verbosity improvements
mark-mackey-cresset May 17, 2019
262a05b
Updated lomap to be more intelligent regarding halogen transformations.
mark-mackey-cresset May 17, 2019
f535fab
Added edge labels to the default png/pdf graphs
mark-mackey-cresset May 20, 2019
c1c88e0
Print MCS exceptions in non-pedantic mode
mark-mackey-cresset May 20, 2019
0fac171
Added rule for disallowing transforming a ring into a ring of differe…
mark-mackey-cresset May 20, 2019
5891e5e
Implemented ring size rule in final scoring
mark-mackey-cresset May 20, 2019
864a0b3
Merge branch 'devel' of https://github.com/mark-cresset/Lomap-private
May 30, 2019
03541fe
Fixed argument parsing
mark-mackey-cresset May 30, 2019
4f67f73
Don't save the MCS result as a member varibale in mcs.py as it can't …
mark-mackey-cresset May 30, 2019
b135831
Compute the MCS for all links, even the prespecified ones. Also fix h…
mark-mackey-cresset Jun 4, 2019
dfbcc22
Store the original strict score in the "ecr" matrix, as we really don…
mark-mackey-cresset Aug 9, 2019
373afb2
Fixed formatting of out_score_with_connection.txt file
mark-mackey-cresset Aug 9, 2019
7089865
Enabled output of atom mappings in parallel mode SFT-14385
mark-mackey-cresset Aug 9, 2019
25724da
Fixed python2-to-python3 bugs coming from change of behaviour of zip
mark-mackey-cresset Aug 16, 2019
ea3f20a
Output the tmcsr score in the log
mark-mackey-cresset Aug 16, 2019
ef97b11
Added test molecules for testing chirality.
mark-mackey-cresset Aug 16, 2019
5a572b4
More chirality tests
mark-mackey-cresset Aug 16, 2019
638ae69
Fixed utterly broken chirality handling.
mark-mackey-cresset Aug 16, 2019
2105cfe
More test cases for chirality handling in LOMAP
mark-mackey-cresset Aug 19, 2019
b926d3b
Added proper chirality check to LOMAP algorithms, and added test case…
mark-mackey-cresset Aug 19, 2019
031093f
Added rule for transforming Cl/Br/I into alkyl - penalises by 2 atoms.
mark-mackey-cresset Aug 19, 2019
878efee
- Removed the tmcsr rule - no longer relevant for us
mark-mackey-cresset Aug 19, 2019
8a4e9fc
Added table of #atoms-changed to score for reference as a comment.
mark-mackey-cresset Aug 19, 2019
8cee433
Made beta in mcs a global variable rather than being passed separatel…
mark-mackey-cresset Aug 20, 2019
61fa768
Added code to ensure that if atoms are removed from the MCS by 3D coo…
mark-mackey-cresset Aug 28, 2019
5ab6a15
Output atom maps sorted by the first atom index, for reproducibility …
mark-mackey-cresset Aug 29, 2019
4c6ef10
Fixed atom mapping output to map hydrogens correctly.
mark-mackey-cresset Sep 16, 2019
8cb5703
Fixed 1-character typo that meant that the graph diameter parameter w…
mark-mackey-cresset Sep 16, 2019
e7026e6
Added hybridization rule, and removed alkyl-to-halogen rule.
mark-mackey-cresset Sep 20, 2019
d4be9b7
Updated test script for new hybridization rule.
mark-mackey-cresset Sep 20, 2019
d0cfd17
Increased default transmuting_methyl_into_ring_rule penalty to 6 atoms.
mark-mackey-cresset Sep 24, 2019
05aa6fa
Fixed hybridization bug (RDKit has a daft interpretation of
mark-mackey-cresset Oct 1, 2019
35a506c
Changed hybridization change penalty from 1 atom to 1.5 atoms.
mark-mackey-cresset Oct 1, 2019
a24cac3
Added test cases for chirality inversion checks - currently found to be
mark-mackey-cresset Oct 3, 2019
09d3ac8
Additional test case molecules
mark-mackey-cresset Oct 3, 2019
4f46dac
Fixed bug with detecting chirality inversion in the MCS - due to RDKit's
mark-mackey-cresset Oct 3, 2019
fc58fd0
Removed debugging print.
mark-mackey-cresset Oct 3, 2019
d1169e9
Added rule to detect broken MCSes from RDKit (ring bond matches
mark-mackey-cresset Oct 4, 2019
9bb9c1f
Minor tweak to avoid trying to recentre when 3D information is not be…
mark-mackey-cresset Oct 7, 2019
564a0b5
Merge branch 'master' of gitlab.com:cresset/private/lomap
mark-mackey-cresset Oct 7, 2019
d8d6807
Fixed compiler error with networkx>=2.4
Dec 5, 2019
cc59235
Merge branch 'master' of gitlab.com:cresset/private/lomap
mark-mackey-cresset Jan 20, 2020
da65edd
Added logic to ensure that hydrogen mappings obey 3D coordinate close…
mark-mackey-cresset Jan 20, 2020
f9ef894
Added "max-dist-from-actives" option to force the graph to be more co…
mark-mackey-cresset Mar 6, 2020
465d1c1
Removed fingerprint option as it's not used by us and clutters the co…
mark-mackey-cresset Nov 25, 2020
2c6112a
FIxed syntax errors from previous commit
mark-mackey-cresset Nov 26, 2020
2176ac1
Ensure that links with similarity 1 are included in the final graph (…
mark-mackey-cresset Nov 26, 2020
2413b93
Updated LOMAP tests to add a funn functionality test and a test for t…
mark-mackey-cresset Nov 26, 2020
27ff7f2
Renamed ecr_similarity to true_strict_similarity as that's what we've…
mark-mackey-cresset Nov 26, 2020
10e45ae
Added extended linksfile options to allow prespecifying link scores
mark-mackey-cresset Nov 26, 2020
f5302e9
Added test for parallel execution
mark-mackey-cresset Nov 27, 2020
c1baa55
Fixed failure to close files when writing final output
mark-mackey-cresset Nov 27, 2020
6d1b2d3
Fixed typo
mark-mackey-cresset Dec 1, 2020
7ac5bfd
Added -T/--allow-tree argument to remove the requirement for a cycle
mark-mackey-cresset Dec 3, 2020
d098839
Fixed syntax error in hybridization logging.
mark-mackey-cresset Dec 4, 2020
320e586
Changed ring size change rule to return a very low score (0.1) rather
mark-mackey-cresset Dec 4, 2020
fa90d91
Make package relocatable.
lohedges Jul 6, 2021
4a010aa
Let RDKit figure out bondLineWidth instead of specifying it.
JenkeScheen Jul 6, 2021
f27c67f
Remove Cresset hydrogen ordering restriction. (For old RDKit issue.)
JenkeScheen Jul 6, 2021
b56fe2d
fixed some typos and updated authorship
JenkeScheen Jul 9, 2021
55dd981
Merge remote-tracking branch 'michellab/master'.
lohedges Jul 15, 2021
78fdebd
Reinstate getMapping method and trim whitespace. [ref #54]
lohedges Aug 25, 2021
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Lomap/_version.py export-subst
lomap/_version.py export-subst
111 changes: 111 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# 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/
*.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
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

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

# 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

# celery beat schedule file
celerybeat-schedule

# 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
69 changes: 36 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
language: python

sudo: false
matrix:
include:
- os: linux
python: 3.6
env:
- PYTHON_VER=3.6
- os: linux
python: 3.5
env:
- PYTHON_VER=3.5

branches:
only:
- devel
- master


before_install:
- source devtools/travis-ci/install.sh
- export PYTHONUNBUFFERED=true


install: true


script:
- conda config --add channels ${ORGNAME}
- conda build devtools/conda-recipe
- conda create -n _test --yes
- source activate _test
- conda install --use-local lomap --yes
- conda install --yes pip nose
- pip install nose-timer
- nosetests -v

env:
matrix:
- CONDA_PY=27
- CONDA_PY=34

global:
- ORGNAME="nividic"
- PACKAGENAME="lomap"

- feat_pytest

before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test-env python=$TRAVIS_PYTHON_VERSION
- source activate test-env
- conda install networkx
- conda install numpy
- conda install matplotlib
- conda install -c rdkit rdkit=2018.03.4
- conda install pip pytest
- pip install codecov
install: yes

script:
- python setup.py install
- pytest -v test/test_lomap.py

after_success:
- echo "...DONE..."

- codecov
notifications:
email: false
email: false
19 changes: 19 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*********
CHANGELOG
*********

0.0.x
=====

Internal Alpha version
----------------------
- Basic functionality of preparing a Perturbation map for alchemical free energy calculations

1.0.0
=====

- added versioning
- support for python 3.5 and networkx2
- improved visualisation of output networks
- better enforcement of PEP8 style python
- no longer support for python 2.7
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ recursive-include test *
include MANIFEST.in
include README.md
include LICENCE.txt
include example.py
include examples/example.py
include versioneer.py
include lomap/_version.py
58 changes: 25 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
[![Anaconda Badge](https://anaconda.org/nividic/lomap/badges/version.svg)](https://anaconda.org/nividic/lomap)

[![Build Status](https://travis-ci.org/MobleyLab/Lomap.svg?branch=master)](https://travis-ci.org/MobleyLab/Lomap)
[![codecov](https://codecov.io/gh/MobleyLab/Lomap/branch/devel/graph/badge.svg)](https://codecov.io/gh/MobleyLab/Lomap)


# Lomap
Alchemical free energy calculations hold increasing promise
as an aid to drug discovery efforts. However, applications of
these techniques in discovery projects have been relatively
few, partly because of the difficulty of planning and setting up
rare, partly because of the difficulty of planning and setting up
calculations. The lead optimization mapper (LOMAP) was
introduced as an automated algorithm to plan efficient relative
free energy calculations between potential ligands within
a substantial of compounds. The original LOMAP code was mainly
based on commercial APIs such as OpenEye and Schrodinger. The aim
of this project is to deveop a new version of LOMAP based on free
of this project is to develop a new version of LOMAP based on free
avalaible APIs such as RDKit offering the scientific community a
free tool to plan in advance binding free energy calculations
free tool to plan in advance binding free energy calculations.


## Prerequisites
* RDKit Release >2015.09.2
* Graphviz 2.38
* pygraphviz
* NetworkX
* Matplotlib > 2.0
* PyQt 4.11
* RDKit Release
* NetworkX
* Matplotlib
* python > 3.5

Authors
-------
* Gaetano Calabro' <gcalabro@uci.edu>
* David Mobley <dmobley@uci.edu>

## Installation

Add to the conda channels:

conda config --add channels nividic
* Mark Mackey
* Lester Hedges
* Antonia S J S Mey
* Jenke Scheen

and then:

conda install lomap

or
## Installation

Add to the conda channels:
`python setup.py install`

conda config --add channels mobleylab
Usage
-----
As a commandline tool LOMAP can be simply used as:
`
lomap test/basic/
`

and then:
For a basic example run:
`python examples/example.py`

conda install lomap
For generating radial graphs with a hub, run:
`python examples/example_radial.py`

If you would rather use the API directly, try:

Usage
-----
```python
import lomap

Expand Down Expand Up @@ -101,10 +100,3 @@ nx_graph = db_mol.build_graph()
```



## Issues
* Lomap is in debugging stage and it has been tested on Ubuntu 14.04 and OSX Yosemite
* Lomap has been developed in python 2.7 and 3.4

## Disclaimers
* This code is currently in alpha release status. Use at your own risk. We will almost certainly be making changes to the API in the near future.
8 changes: 4 additions & 4 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requirements:
- rdkit
- matplotlib
- pyqt ==4.11.4
- networkx ==1.11
- networkx >=2.0
- graphviz
- pygraphviz
- pillow
Expand All @@ -28,10 +28,10 @@ requirements:
run:
- python
- boost
- rdkit
- rdkit
- matplotlib
- pyqt
- networkx ==1.11
- pyqt ==4.11.4
- networkx >=2.0
- graphviz
- pygraphviz
- pillow
Expand Down
4 changes: 2 additions & 2 deletions devtools/travis-ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MINICONDA=Miniconda2-latest-Linux-x86_64.sh
MINICONDA=Miniconda3-latest-Linux-x86_64.sh
MINICONDA_MD5=$(curl -s https://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget http://repo.continuum.io/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
Expand All @@ -10,5 +10,5 @@ PIP_ARGS="-U"

export PATH=$HOME/miniconda/bin:$PATH

conda install --yes conda-build jinja2 anaconda-client pip
conda install --yes pip

2 changes: 1 addition & 1 deletion example.py → examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The DBMolecule class must be created with a valid
# directory name

db_mol = lomap.DBMolecules('test/basic/', output=True)
db_mol = lomap.DBMolecules('../test/basic/', output=True)

# db_mol = lomap.DBMolecules('test/basic/', output=True, display=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The DBMolecule class must be created with a valid
# directory name

db_mol = lomap.DBMolecules('test/radial/', output=True, radial=True )
db_mol = lomap.DBMolecules('../test/radial/', output=True, radial=True )
#use the radial option with hub ligand set as
#db_mol = lomap.DBMolecules('test/radial/', output=True, radial=True, hub="ejm_46.mol2")

Expand Down
13 changes: 8 additions & 5 deletions lomap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@
nx_graph = db_mol.build_graph()
"""

from lomap.dbmol import DBMolecules
from lomap.dbmol import SMatrix
from lomap.dbmol import Molecule
from lomap.mcs import MCS
from .dbmol import DBMolecules
from .dbmol import SMatrix
from .dbmol import Molecule
from .mcs import MCS

del dbmol
del graphgen
del mcs

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
Loading