Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoist LAURENT committed Jul 25, 2017
2 parents e30a651 + 981f2c5 commit 20347bc
Show file tree
Hide file tree
Showing 19 changed files with 286 additions and 8,421 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ python:

before_install:
- sudo apt-get update -qq
- cat docker/requirements_system.txt | sudo xargs apt-get install -y
- cat requirements_apt-get.txt | sudo xargs apt-get install -y

install:
- pip install -r docker/requirements_python.txt
- pip install -r requirements_python.txt
- make install

script: "cd Tests && make unittests"
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@
- docking.py: fix error in read_rotations(), minor mods, identifier changes (zwopi->twopi, nrot->nchi, ...)
- changed Tests directory name functionnal --> functional

17 - 21 July 2017 CHR, NB
- remove f2c dependency, add gfortran dependency
- modify setup.py to compile lbfgsb.f directly
- added chrg_scorpion_wrap.cpp to interface with chrg_scorpion.f
- shortened test for reduce scorpion --cgopt
8 changes: 5 additions & 3 deletions Tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import pytest

# Fixture to ignore some test not working on OS X.
skip_on_osx = pytest.mark.skipif(sys.platform == 'darwin',
reason="currently not working on OS X")
#skip_on_osx = pytest.mark.skipif(sys.platform == 'darwin',
# reason="currently not working on OS X")
skip_on_osx = lambda x : False


TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
Expand Down Expand Up @@ -62,6 +63,7 @@
# ---------------------------------------------------------------------------
TEST_REDUCE_DATA_DIR = os.path.join(TEST_DATA_DIR, 'reduce')
TEST_LIGAND_PDB = os.path.join(TEST_REDUCE_DATA_DIR, '1FIN_r.pdb')
TEST_LIGAND_PDB_CGOPT = os.path.join(TEST_REDUCE_DATA_DIR, '1FIN_r_trunc.pdb')

# Attract1 reduced topology.
# Generated from f46b895 with:
Expand All @@ -88,7 +90,7 @@
# python reduce_scorpion.py --cgopt 1FIN_r.pdb > 1FIN_r.scorpion.red
# Input topology has been adapted to acomodate the fact that reduce_scorpion.py
# did not handle OT2 atoms: last atom from 1FIN_r.pdb has been renamed OT2 => OT.
TEST_LIGAND_RED_SCORPION_CGOPT = os.path.join(TEST_REDUCE_DATA_DIR, '1FIN_r.scorpion_cgopt.red')
TEST_LIGAND_RED_SCORPION_CGOPT = os.path.join(TEST_REDUCE_DATA_DIR, '1FIN_r_trunc.scorpion_cgopt.red')


# ---------------------------------------------------------------------------
Expand Down
61 changes: 61 additions & 0 deletions Tests/data/reduce/1FIN_r_trunc.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
ATOM 1 N MET 1 -13.434 190.993 108.831 7 1 1.47 pep0 0.75
ATOM 2 CA MET 1 -14.035 190.087 107.812 7 1 2.03 pep0 0.20
ATOM 3 CB MET 1 -15.308 190.718 107.248 6 0 1.99 pep0 0.00
ATOM 4 CG MET 1 -16.159 189.782 106.402 16 1 1.99 pep0 0.06
ATOM 5 SD MET 1 -16.111 190.144 104.629 16 0 1.76 pep0 -0.12
ATOM 6 CE MET 1 -17.743 189.545 104.144 17 1 1.94 pep0 0.06
ATOM 7 C MET 1 -13.002 189.792 106.703 3 1 1.67 pep0 0.60
ATOM 8 O MET 1 -11.926 190.390 106.698 4 1 1.38 pep0 -0.55
ATOM 9 N GLU 2 -13.329 188.866 105.797 1 0 1.63 pep0 -0.15
ATOM 10 CA GLU 2 -12.443 188.440 104.706 2 1 2.03 pep0 0.10
ATOM 11 CB GLU 2 -12.979 187.177 104.022 6 1 1.99 pep0 0.00
ATOM 12 CG GLU 2 -12.999 185.929 104.891 16 1 1.99 pep0 0.00
ATOM 13 CD GLU 2 -14.341 185.697 105.577 9 1 1.67 pep0 0.14
ATOM 14 OE1 GLU 2 -15.327 185.362 104.872 9 1 1.48 pep0 -0.57
ATOM 15 OE2 GLU 2 -14.400 185.833 106.823 9 1 1.48 pep0 -0.57
ATOM 16 C GLU 2 -12.139 189.452 103.623 3 1 1.67 pep0 0.60
ATOM 17 O GLU 2 -11.025 189.501 103.120 4 1 1.38 pep0 -0.55
ATOM 18 N ASN 3 -13.142 190.212 103.212 1 0 1.63 pep0 -0.15
ATOM 19 CA ASN 3 -12.939 191.204 102.168 2 1 2.03 pep0 0.10
ATOM 20 CB ASN 3 -14.277 191.717 101.654 6 1 1.99 pep0 0.00
ATOM 21 CG ASN 3 -15.060 190.661 100.938 11 1 1.67 pep0 0.55
ATOM 22 OD1 ASN 3 -14.989 190.545 99.716 11 1 1.38 pep0 -0.55
ATOM 23 ND2 ASN 3 -15.812 189.873 101.690 11 1 1.63 pep0 0.00
ATOM 24 C ASN 3 -12.132 192.389 102.651 3 0 1.67 pep0 0.60
ATOM 25 O ASN 3 -12.021 193.393 101.944 4 0 1.38 pep0 -0.55
ATOM 26 N PHE 4 -11.583 192.290 103.852 1 0 1.63 pep0 -0.15
ATOM 27 CA PHE 4 -10.819 193.386 104.413 2 0 2.03 pep0 0.10
ATOM 28 CB PHE 4 -11.678 194.147 105.432 6 0 1.99 pep0 0.00
ATOM 29 CG PHE 4 -12.885 194.808 104.829 16 0 1.82 pep0 0.00
ATOM 30 CD1 PHE 4 -14.090 194.121 104.714 16 0 1.78 pep0 0.00
ATOM 31 CD2 PHE 4 -12.806 196.110 104.335 16 0 1.78 pep0 0.00
ATOM 32 CE1 PHE 4 -15.196 194.720 104.109 16 1 1.78 pep0 0.00
ATOM 33 CE2 PHE 4 -13.901 196.717 103.732 16 0 1.78 pep0 0.00
ATOM 34 CZ PHE 4 -15.100 196.018 103.616 16 1 1.78 pep0 0.00
ATOM 35 C PHE 4 -9.539 192.944 105.086 3 0 1.67 pep0 0.60
ATOM 36 O PHE 4 -9.541 191.994 105.866 4 1 1.38 pep0 -0.55
ATOM 37 N GLN 5 -8.433 193.601 104.752 1 0 1.63 pep0 -0.15
ATOM 38 CA GLN 5 -7.171 193.290 105.410 2 1 2.03 pep0 0.10
ATOM 39 CB GLN 5 -5.988 193.245 104.425 6 1 1.99 pep0 0.00
ATOM 40 CG GLN 5 -5.705 194.529 103.653 16 0 1.99 pep0 0.00
ATOM 41 CD GLN 5 -4.373 194.492 102.892 11 1 1.67 pep0 0.55
ATOM 42 OE1 GLN 5 -3.326 194.888 103.419 11 1 1.38 pep0 -0.55
ATOM 43 NE2 GLN 5 -4.415 194.027 101.642 11 1 1.63 pep0 0.00
ATOM 44 C GLN 5 -6.982 194.371 106.474 3 0 1.67 pep0 0.60
ATOM 45 O GLN 5 -6.935 195.563 106.160 4 0 1.38 pep0 -0.55
ATOM 46 N LYS 6 -7.021 193.968 107.738 1 1 1.63 pep0 -0.15
ATOM 47 CA LYS 6 -6.855 194.911 108.834 2 0 2.03 pep0 0.10
ATOM 48 CB LYS 6 -7.156 194.263 110.189 6 1 1.99 pep0 0.00
ATOM 49 CG LYS 6 -8.554 193.643 110.304 16 1 1.99 pep0 0.00
ATOM 50 CD LYS 6 -8.853 193.135 111.732 8 1 1.99 pep0 0.00
ATOM 51 CE LYS 6 -9.940 192.037 111.766 7 1 1.99 pep0 0.25
ATOM 52 NZ LYS 6 -11.237 192.415 111.110 7 0 1.47 pep0 0.75
ATOM 53 C LYS 6 -5.417 195.360 108.798 3 0 1.67 pep0 0.60
ATOM 54 O LYS 6 -4.506 194.527 108.764 4 1 1.38 pep0 -0.55
ATOM 55 N VAL 7 -5.215 196.667 108.720 1 0 1.63 pep0 -0.15
ATOM 56 CA VAL 7 -3.867 197.196 108.678 2 1 2.03 pep0 0.10
ATOM 57 CB VAL 7 -3.727 198.430 107.731 6 1 2.03 pep0 0.00
ATOM 58 CG1 VAL 7 -4.385 198.164 106.382 17 1 1.94 pep0 0.00
ATOM 59 CG2 VAL 7 -4.296 199.656 108.361 17 1 1.94 pep0 0.00
ATOM 60 C VAL 7 -3.428 197.535 110.094 3 1 1.67 pep0 0.60
ATOM 61 O VAL 7 -2.277 197.302 110.459 4 1 1.38 pep0 -0.55
20 changes: 20 additions & 0 deletions Tests/data/reduce/1FIN_r_trunc.scorpion_cgopt.red
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
HEADER SCORPION REDUCED PDB FILE
ATOM 1 CA MET 1 -13.099 190.315 107.511 1 1.153 0 0
ATOM 2 CB MET 1 -15.733 190.250 106.825 18 0.486 0 0
ATOM 3 CG MET 1 -16.927 189.844 104.387 19 0.036 0 0
ATOM 4 CA GLU 2 -12.234 189.065 104.311 1 -0.925 0 0
ATOM 5 CB GLU 2 -12.989 186.553 104.457 10 0.746 0 0
ATOM 6 CG GLU 2 -14.689 185.631 105.757 11 -1.330 0 0
ATOM 7 CA ASN 3 -12.559 191.800 102.494 1 0.044 0 0
ATOM 8 CB ASN 3 -15.034 190.699 100.999 5 -0.103 0 0
ATOM 9 CA PHE 4 -10.370 192.654 104.804 1 -0.392 0 0
ATOM 10 CB PHE 4 -12.865 194.797 104.828 20 0.606 0 0
ATOM 11 CG PHE 4 -14.732 195.818 103.819 21 -0.288 0 0
ATOM 12 CA GLN 5 -7.380 194.206 105.699 1 -0.459 0 0
ATOM 13 CB GLN 5 -5.847 193.887 104.039 8 0.734 0 0
ATOM 14 CG GLN 5 -4.038 194.469 102.651 9 -0.271 0 0
ATOM 15 CA LYS 6 -5.950 194.692 108.534 1 0.408 0 0
ATOM 16 CB LYS 6 -7.855 193.953 110.246 16 -0.185 0 0
ATOM 17 CG LYS 6 -10.010 192.529 111.536 17 1.100 0 0
ATOM 18 CA VAL 7 -3.697 197.175 109.488 1 -1.794 0 0
ATOM 19 CB VAL 7 -4.136 198.750 107.491 29 0.433 0 0
5 changes: 2 additions & 3 deletions Tests/functional/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ..utils import mk_tmp_file

from .. import (TEST_LIGAND_PDB,
TEST_LIGAND_PDB_CGOPT,
TEST_LIGAND_RED_ATTRACT1,
TEST_LIGAND_RED_ATTRACT2,
TEST_LIGAND_RED_SCORPION,
Expand Down Expand Up @@ -63,10 +64,8 @@ def test_reduce_scorpion(self):
cmd_args.func(cmd_args)
self.assertTrue(filecmp.cmp(TEST_LIGAND_RED_SCORPION, self.output_name))

@skip_on_osx
@pytest.mark.skip('Too slow')
def test_reduce_scorpion_cgopt(self):
args = ['reduce', TEST_LIGAND_PDB, '-o', self.output_name, '--ff', 'scorpion', '--cgopt']
args = ['reduce', TEST_LIGAND_PDB_CGOPT, '-o', self.output_name, '--ff', 'scorpion', '--cgopt']
cmd_args = ptools_cli.parse_command_line(args)
cmd_args.func(cmd_args)
self.assertTrue(filecmp.cmp(TEST_LIGAND_RED_SCORPION_CGOPT, self.output_name))
Expand Down
6 changes: 3 additions & 3 deletions bindings/_cgopt.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cdef extern from "chrg_scorpion.h":
int chrg_scorpion__(int *, double *, double *,
cdef extern from "chrg_scorpion_wrap.cpp":
void chrg_scorpion_(int *, double *, double *,
double *, double* ,
double *, int *, double* ,
double *, double* ,
Expand All @@ -26,7 +26,7 @@ def optimize(int natom, charge, radius, cx, cy, cz, int nbead, cgch, cgr, cgx, c
ccgy[i] = cgy[i]
ccgz[i] = cgz[i]

result = chrg_scorpion__( &natom, ccharge, cradius, ccx, ccy, ccz, &nbead, ccgch, ccgr, ccgx, ccgy, ccgz,&delgrid)
result = chrg_scorpion_( &natom, ccharge, cradius, ccx, ccy, ccz, &nbead, ccgch, ccgr, ccgx, ccgy, ccgz,&delgrid)

output = []
for i in range(nbead):
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
FROM debian:latest

# Install system dependecies.
COPY requirements_system.txt /opt/
RUN apt-get update && cat /opt/requirements_system.txt | xargs apt-get install -y
COPY requirements_apt-get.txt /opt/
RUN apt-get update && cat /opt/requirements_apt-get.txt | xargs apt-get install -y

# Install python dependencies
COPY requirements_python.txt /opt/
RUN pip install --upgrade pip && pip install -r /opt/requirements_python.txt

# The entrypoint script is executed everytime the container starts.
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
38 changes: 31 additions & 7 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,51 @@ in a Python virtual environment.

First, install all system dependencies.
This requires administrator permissions.
E.g., for a debian- or ubuntu-like system::

1. Install git and download PTools last release::
Here are examples of installing system-level dependencies for one or two systems:

+ For a __debian__- or __ubuntu__-like system::

1. Install git and download PTools last release::

$ sudo apt-get update
$ sudo apt-get install -y git
$ git clone https://github.com/ptools/ptools.git
$ cd ptools

2. Install system requirements::
2. Install system requirements::

$ cat requirements_system.txt | xargs sudo apt-get install -y

+ For __macos__ (with MacPorts installed)::

1. Download PTools last release::

$ git clone https://github.com/ptools/ptools.git
$ cd ptools

2. Install system requirements::

The rest can be installed as a normal user::
$ cat requirements_system_macos.txt | xargs sudo port install -N

1. Create and activate the virtual environment::
3. Select the gcc compiler::

$ virtualenv venv-ptools
$ sudo port select gcc mp-gcc6

4. _Note: after installation is complete_ return to the macos default compiler

$ sudo port select gcc none


The rest should be installed as a normal user::

1. Create and activate the virtual environment (can be anywhere)::

$ virtualenv ../venv-ptools
$ source venv-ptools/bin/activate

An alias to the second command is recommended, as the virtual environment must be activated when installing or using PTools.

2. Install ptools dependencies::

(venv-ptools) $ pip install -r requirements_python.txt
Expand All @@ -42,6 +66,6 @@ The rest can be installed as a normal user::

(venv-ptools) $ make install

4. Test everything went fine::
4. Test to see that everything went fine::
(venv-ptools) $ make test
File renamed without changes.
3 changes: 3 additions & 0 deletions requirements_macports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
boost
gcc6
py-virtualenv
Loading

0 comments on commit 20347bc

Please sign in to comment.