From af91e2f7c1b7554bb82f0d399aceec83b953e531 Mon Sep 17 00:00:00 2001 From: Kyle Beauchamp Date: Mon, 8 Dec 2014 15:08:28 -0500 Subject: [PATCH 01/11] Initial checkin of travis cahnges --- .travis.yml | 13 ++++++------- devtools/ci/install.sh | 20 ++++++++++++++++++++ devtools/conda-recipe/meta.yaml | 32 ++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index a24948c..ee58b9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,16 @@ language: c +branches: + only: + - master + install: - source devtools/ci/install.sh - export PYTHONUNBUFFERED=true script: - - export CC="gcc -std=c89" - - source deactivate - - conda install --yes conda-build + # this builds the binary, unpacks it, and runs the tests - conda build devtools/conda-recipe - - source activate $python - - conda install $HOME/miniconda/conda-bld/linux-64/gaff2xml-dev-* - - conda list -e - - nosetests env: matrix: @@ -28,3 +26,4 @@ after_success: - source devtools/ci/after_sucess.sh +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index 449e24f..83242cc 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -1,3 +1,23 @@ +MINICONDA=Miniconda-latest-Linux-x86_64.sh +MINICONDA_MD5=$(curl -s http://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *\(.*\)<\/td> */\1/p') +wget http://repo.continuum.io/miniconda/$MINICONDA +if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then + echo "Miniconda MD5 mismatch" + exit 1 +fi +bash $MINICONDA -b +PIP_ARGS="-U" + +export PATH=$HOME/miniconda/bin:$PATH + +conda update --yes conda +conda config --add channels http://conda.binstar.org/omnia +source activate $python +conda install --yes conda-build + + + + sudo apt-get update sudo apt-get install -qq -y g++ gfortran csh sudo apt-get install -qq -y g++-multilib gcc-multilib openbabel diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index f85a8ff..6612f6c 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,27 +1,43 @@ package: - name: gaff2xml - version: !!str dev + name: gaff2xml-dev + version: !!str 3.0.0 +#source: +# fn: master.zip +# url: https://github.com/choderalab/gaff2xml/archive/master.zip + +build: + preserve_egg_dir: True + number: 0 requirements: build: - python - - cython + - setuptools + - mdtraj - numpy - scipy - - setuptools - - mdtraj-dev - openmm - - ambermini - + - ambermini run: - python + - setuptools - pandas + - six + - mdtraj + - numpydoc - scipy - - mdtraj-dev - openmm - ambermini +test: + requires: + - nose + imports: + - gaff2xml + commands: + - nosetests gaff2xml -v + about: home: https://github.com/choderalab/gaff2xml license: GNU Lesser General Public License v2 or later (LGPLv2+) From 9536d09b69bcaf48990de1aed4cee8ff64c3ec35 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 15:34:36 -0500 Subject: [PATCH 02/11] Updates --- .travis.yml | 3 --- devtools/ci/install.sh | 17 ++--------------- devtools/ci/requirements-conda.txt | 4 ++-- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee58b9c..94ef08b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,3 @@ env: after_success: - echo "after_success" - source devtools/ci/after_sucess.sh - - -zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index 83242cc..2b19f79 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -10,25 +10,12 @@ PIP_ARGS="-U" export PATH=$HOME/miniconda/bin:$PATH -conda update --yes conda -conda config --add channels http://conda.binstar.org/omnia -source activate $python -conda install --yes conda-build - - - - sudo apt-get update -sudo apt-get install -qq -y g++ gfortran csh -sudo apt-get install -qq -y g++-multilib gcc-multilib openbabel -wget http://repo.continuum.io/miniconda/Miniconda-3.6.0-Linux-x86_64.sh -bash Miniconda-3.6.0-Linux-x86_64.sh -b -PIP_ARGS="-U" - -export PATH=$HOME/miniconda/bin:$PATH +sudo apt-get install -qq -y g++ gfortran csh g++-multilib gcc-multilib openbabel conda update --yes conda conda config --add channels http://conda.binstar.org/omnia conda config --add channels https://conda.binstar.org/ric conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt source activate $python +conda install --yes conda-build diff --git a/devtools/ci/requirements-conda.txt b/devtools/ci/requirements-conda.txt index fae9ac3..c742b70 100644 --- a/devtools/ci/requirements-conda.txt +++ b/devtools/ci/requirements-conda.txt @@ -6,8 +6,8 @@ pandas pyyaml pip nose -mdtraj-dev -openmm +mdtraj>=1.2 +openmm>=6.1 ambermini jinja2 #rdkit # rdkit conda packages are only available on python 2.7, so this will cause travis to screw up. From 14f462caf2c03e1beb829565d3f79ca4a02542a7 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 15:58:16 -0500 Subject: [PATCH 03/11] Updates --- devtools/ci/install.sh | 2 ++ devtools/conda-recipe/build.sh | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index 2b19f79..1cd6b64 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -14,8 +14,10 @@ sudo apt-get update sudo apt-get install -qq -y g++ gfortran csh g++-multilib gcc-multilib openbabel conda update --yes conda +echo "Update conda" conda config --add channels http://conda.binstar.org/omnia conda config --add channels https://conda.binstar.org/ric conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt source activate $python conda install --yes conda-build +echo "install conda build" diff --git a/devtools/conda-recipe/build.sh b/devtools/conda-recipe/build.sh index fff95df..d3e1d70 100755 --- a/devtools/conda-recipe/build.sh +++ b/devtools/conda-recipe/build.sh @@ -1,10 +1,5 @@ #!/bin/bash - cp -r $RECIPE_DIR/../.. $SRC_DIR +$PYTHON setup.py clean $PYTHON setup.py install -# Add more build steps here, if they are necessary. - -# See -# http://docs.continuum.io/conda/build.html -# for a list of environment variables that are set during the build process. From dcea0206d06e124d38028c1bbf54ba94979b37ae Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 16:20:22 -0500 Subject: [PATCH 04/11] Some updates --- devtools/ci/install.sh | 2 +- devtools/conda-recipe/meta.yaml | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index 1cd6b64..a7e334b 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -17,7 +17,7 @@ conda update --yes conda echo "Update conda" conda config --add channels http://conda.binstar.org/omnia conda config --add channels https://conda.binstar.org/ric -conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt +#conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt # Now using conda to automatically handle environment creation / testing source activate $python conda install --yes conda-build echo "install conda build" diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 6612f6c..a83e4b4 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -14,21 +14,24 @@ requirements: build: - python - setuptools - - mdtraj + - mdtraj>=1.2 - numpy - scipy - - openmm + - pandas + - openmm>=6.1 - ambermini + - jinja2 run: - python - setuptools - pandas - six - - mdtraj + - mdtraj>=1.2 - numpydoc - scipy - - openmm - - ambermini + - openmm>=6.1 + - ambermini + test: requires: @@ -41,4 +44,3 @@ test: about: home: https://github.com/choderalab/gaff2xml license: GNU Lesser General Public License v2 or later (LGPLv2+) - From bd03376947cd3977b9cb17c7ba4935d3f4dda8f9 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 16:43:50 -0500 Subject: [PATCH 05/11] Updates --- devtools/conda-recipe/meta.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index a83e4b4..5b1fdc7 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -14,11 +14,11 @@ requirements: build: - python - setuptools - - mdtraj>=1.2 + - mdtraj - numpy - scipy - pandas - - openmm>=6.1 + - openmm - ambermini - jinja2 run: @@ -26,12 +26,12 @@ requirements: - setuptools - pandas - six - - mdtraj>=1.2 + - mdtraj - numpydoc - scipy - - openmm>=6.1 + - openmm - ambermini - + - jinja2 test: requires: From f108f18b38e290954da7095c37f4a89d7a1883ea Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 17:07:58 -0500 Subject: [PATCH 06/11] Include tests in package --- {tests => gaff2xml/tests}/test_drugs.py | 18 ++++++++++++++++-- .../tests}/test_drugs_no_oechem.py | 0 {tests => gaff2xml/tests}/test_freesolv.py | 0 {tests => gaff2xml/tests}/test_openeye.py | 0 {tests => gaff2xml/tests}/test_packmol.py | 0 {tests => gaff2xml/tests}/test_utils.py | 0 setup.py | 2 +- 7 files changed, 17 insertions(+), 3 deletions(-) rename {tests => gaff2xml/tests}/test_drugs.py (58%) rename {tests => gaff2xml/tests}/test_drugs_no_oechem.py (100%) rename {tests => gaff2xml/tests}/test_freesolv.py (100%) rename {tests => gaff2xml/tests}/test_openeye.py (100%) rename {tests => gaff2xml/tests}/test_packmol.py (100%) rename {tests => gaff2xml/tests}/test_utils.py (100%) diff --git a/tests/test_drugs.py b/gaff2xml/tests/test_drugs.py similarity index 58% rename from tests/test_drugs.py rename to gaff2xml/tests/test_drugs.py index 45784fb..1b519fe 100644 --- a/tests/test_drugs.py +++ b/gaff2xml/tests/test_drugs.py @@ -2,7 +2,21 @@ from gaff2xml import utils import os -@skipIf(os.environ.get("TRAVIS", None) == 'true', "Skip testing of entire drug database on Travis.") +try: + oechem = utils.import_("openeye.oechem") + if not oechem.OEChemIsLicensed(): raise(ImportError("Need License for OEChem!")) + oequacpac = utils.import_("openeye.oequacpac") + if not oequacpac.OEQuacPacIsLicensed(): raise(ImportError("Need License for oequacpac!")) + oeiupac = utils.import_("openeye.oeiupac") + if not oeiupac.OEIUPACIsLicensed(): raise(ImportError("Need License for OEOmega!")) + oeomega = utils.import_("openeye.oeomega") + if not oeomega.OEOmegaIsLicensed(): raise(ImportError("Need License for OEOmega!")) + HAVE_OE = True +except: + HAVE_OE = False + + +@skipIf(not HAVE_OE, "Cannot run test_drugs() module without OpenEye tools.") def test_drugs(): import openeye.oechem database_filename = utils.get_data_filename("chemicals/drugs/Zdd.mol2.gz") @@ -12,7 +26,7 @@ def test_drugs(): molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule) yield utils.tag_description(lambda : utils.test_molecule(molecule_name, tripos_mol2_filename), "Testing drugs %s" % molecule_name) -@skipIf(os.environ.get("TRAVIS", None) == 'true', "Skip testing of entire drug database on Travis.") +@skipIf(not HAVE_OE, "Cannot test test_drug() without OpenEye tools.") def test_drug(): import openeye.oechem database_filename = utils.get_data_filename("chemicals/drugs/Zdd.mol2.gz") diff --git a/tests/test_drugs_no_oechem.py b/gaff2xml/tests/test_drugs_no_oechem.py similarity index 100% rename from tests/test_drugs_no_oechem.py rename to gaff2xml/tests/test_drugs_no_oechem.py diff --git a/tests/test_freesolv.py b/gaff2xml/tests/test_freesolv.py similarity index 100% rename from tests/test_freesolv.py rename to gaff2xml/tests/test_freesolv.py diff --git a/tests/test_openeye.py b/gaff2xml/tests/test_openeye.py similarity index 100% rename from tests/test_openeye.py rename to gaff2xml/tests/test_openeye.py diff --git a/tests/test_packmol.py b/gaff2xml/tests/test_packmol.py similarity index 100% rename from tests/test_packmol.py rename to gaff2xml/tests/test_packmol.py diff --git a/tests/test_utils.py b/gaff2xml/tests/test_utils.py similarity index 100% rename from tests/test_utils.py rename to gaff2xml/tests/test_utils.py diff --git a/setup.py b/setup.py index 6109eb3..6dced58 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ url='http://github.com/choderalab/gaff2xml', platforms=['Linux', 'Mac OS-X', 'Unix'], classifiers=CLASSIFIERS.splitlines(), - packages=["gaff2xml"], + packages=["gaff2xml", "gaff2xml.tests"], zip_safe=False, scripts=['scripts/generate_example_data.py', 'scripts/processAmberForceField.py'], ext_modules=extensions, From a8a4fe2a1a13370e4766b2668cb3c1d2198d1136 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 17:18:34 -0500 Subject: [PATCH 07/11] Use updated rdkit repo --- devtools/ci/install.sh | 2 +- devtools/conda-recipe/meta.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index a7e334b..15123c5 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -16,7 +16,7 @@ sudo apt-get install -qq -y g++ gfortran csh g++-multilib gcc-multilib openbabel conda update --yes conda echo "Update conda" conda config --add channels http://conda.binstar.org/omnia -conda config --add channels https://conda.binstar.org/ric +conda config --add channels https://conda.binstar.org/rdkit #conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt # Now using conda to automatically handle environment creation / testing source activate $python conda install --yes conda-build diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 5b1fdc7..2b40bc1 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -21,6 +21,7 @@ requirements: - openmm - ambermini - jinja2 + - rdkit run: - python - setuptools @@ -31,7 +32,8 @@ requirements: - scipy - openmm - ambermini - - jinja2 + - jinja2 + - rdkit test: requires: From 9db3adefd932c363a37208ea95dfaaf664c9c32b Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 17:28:33 -0500 Subject: [PATCH 08/11] Updates --- README.md | 23 ++++++++++++++++++++--- devtools/conda-recipe/meta.yaml | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 18957eb..dc68c9c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ [![Build Status](https://travis-ci.org/choderalab/gaff2xml.svg)](https://travis-ci.org/choderalab/gaff2xml) [![Code Health](https://landscape.io/github/choderalab/gaff2xml/master/landscape.svg)](https://landscape.io/github/choderalab/gaff2xml/master) -## gaff2xml: Converting Antechamber GAFF files to OpenMM XML format +## gaff2xml: Tools for Small Molecules, Antechamber, OpenMM, and More. -This set of tools allows users to automate the conversion of ligand -force field parameters from Antechamber formats to OpenMM XML format. +This set of tools allows users to automate the conversion of GAFF ligand +force field parameters from Antechamber formats to OpenMM XML format. +It also contains several python tools for working with small molecules, +packing boxes (python wrappers for packmol), and parameterizing small +molecules. This tool is in BETA testing: use at your own risk! @@ -13,7 +16,21 @@ Installation: ``` python setup.py install + +or + +conda config --add channels http://conda.binstar.org/omnia +conda config --add channels https://conda.binstar.org/rdkit +conda install gaff2xml + +``` + +To test your installation, use the following command: + ``` +nosetests gaff2xml -v +``` + Usage: diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 2b40bc1..d4ccb00 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - openmm - ambermini - jinja2 - - rdkit + - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. run: - python - setuptools @@ -33,7 +33,7 @@ requirements: - openmm - ambermini - jinja2 - - rdkit + - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. test: requires: From 3099981c349830618c1ee8206d42760a3c237fa2 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 18:13:41 -0500 Subject: [PATCH 09/11] Don't include rdkit in conda recipe. --- devtools/conda-recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index d4ccb00..4bae78b 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -21,7 +21,7 @@ requirements: - openmm - ambermini - jinja2 - - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. +# - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. run: - python - setuptools @@ -33,7 +33,7 @@ requirements: - openmm - ambermini - jinja2 - - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. +# - rdkit # rdkit is an optional dependency, may want to comment this out for the release version. test: requires: From dc6224aa9d20e96f47527fd931d3484f3498d857 Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 18:43:51 -0500 Subject: [PATCH 10/11] More cleanup --- devtools/ci/install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/devtools/ci/install.sh b/devtools/ci/install.sh index 15123c5..31c7734 100755 --- a/devtools/ci/install.sh +++ b/devtools/ci/install.sh @@ -14,10 +14,7 @@ sudo apt-get update sudo apt-get install -qq -y g++ gfortran csh g++-multilib gcc-multilib openbabel conda update --yes conda -echo "Update conda" conda config --add channels http://conda.binstar.org/omnia conda config --add channels https://conda.binstar.org/rdkit -#conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt # Now using conda to automatically handle environment creation / testing source activate $python conda install --yes conda-build -echo "install conda build" From 3ab253c9014bc550dde02ab83b2ae4f73719ca3e Mon Sep 17 00:00:00 2001 From: kyleabeauchamp Date: Mon, 8 Dec 2014 18:44:31 -0500 Subject: [PATCH 11/11] Don't need requirements-conda anymore --- devtools/ci/requirements-conda.txt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 devtools/ci/requirements-conda.txt diff --git a/devtools/ci/requirements-conda.txt b/devtools/ci/requirements-conda.txt deleted file mode 100644 index c742b70..0000000 --- a/devtools/ci/requirements-conda.txt +++ /dev/null @@ -1,13 +0,0 @@ -numpy -scipy -pytables -cython -pandas -pyyaml -pip -nose -mdtraj>=1.2 -openmm>=6.1 -ambermini -jinja2 -#rdkit # rdkit conda packages are only available on python 2.7, so this will cause travis to screw up.