From 25d8f96d651392cd8ff10e98832d395cf9dffdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Wed, 7 Apr 2021 10:34:29 +0200 Subject: [PATCH 01/10] Update requirements.txt --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 1ca1ffb6..3e376198 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ Sphinx==3.1.2 sphinx-rtd-theme==0.5.0 m2r==0.2.1 +peleffy From 0b4fce24136b7ee64cee30fcd2c466cd95bebf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Wed, 7 Apr 2021 10:37:10 +0200 Subject: [PATCH 02/10] Update master.yml --- .github/workflows/master.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 38b41568..5c7c5a5d 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -29,7 +29,12 @@ jobs: run: | cd docs/ make github - + + - name: Build sphinx documentation (again) + shell: bash -l {0} + run: | + make github + # https://github.com/peaceiris/actions-gh-pages - name: Deploy documentation if: success() From 2dc110d1bc8751ce027b667facd9e3df5a2bc806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Wed, 7 Apr 2021 10:40:03 +0200 Subject: [PATCH 03/10] Update master.yml --- .github/workflows/master.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5c7c5a5d..c3d106e9 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -28,11 +28,7 @@ jobs: shell: bash -l {0} run: | cd docs/ - make github - - - name: Build sphinx documentation (again) - shell: bash -l {0} - run: | + make html make github # https://github.com/peaceiris/actions-gh-pages From ed38c8057d6dff5ce2d424e8556cf6af02ba858a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Mon, 12 Apr 2021 18:20:28 +0200 Subject: [PATCH 04/10] Freeze docutils version in docs Credit goes to @frumpowy --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 3e376198..a89dfbf8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,5 @@ Sphinx==3.1.2 sphinx-rtd-theme==0.5.0 m2r==0.2.1 +docutils==0.16 peleffy From a1f6818cda23103a6d080f352c40c196ab56e5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Mon, 12 Apr 2021 18:51:24 +0200 Subject: [PATCH 05/10] Generate docs from conda installation --- .github/workflows/master.yml | 59 ++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index c3d106e9..4f077dd3 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -11,33 +11,40 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 + - name: Setup conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + python-version: 3.7 + conda-channels: anaconda, conda-forge - - name: Install dependencies - shell: bash -l {0} - run: | - python -m pip install --upgrade pip - if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi + - name: Install doc dependencies + shell: bash + run: | + python -m pip install --upgrade pip + if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi - - name: Build sphinx documentation - shell: bash -l {0} - run: | - cd docs/ - make html - make github + - name: Install latest peleffy version + shell: bash + run: | + conda config --add channels omnia --add channels conda-forge --add channels martimunicoy + conda install peleffy + + - name: Build sphinx documentation + shell: bash + run: | + cd docs/ + make github - # https://github.com/peaceiris/actions-gh-pages - - name: Deploy documentation - if: success() - uses: peaceiris/actions-gh-pages@v3 - with: - publish_branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/html/ - user_name: 'Martí Municoy' - user_email: 'martimunicoy@gmail.com' + # https://github.com/peaceiris/actions-gh-pages + - name: Deploy documentation + if: success() + uses: peaceiris/actions-gh-pages@v3 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/html/ + user_name: 'Martí Municoy' + user_email: 'martimunicoy@gmail.com' From 62fe0331b3452bafea0c2723e196588bd311d1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Mon, 12 Apr 2021 19:06:49 +0200 Subject: [PATCH 06/10] Minor changes --- .github/workflows/master.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4f077dd3..ba7ed8ef 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -18,7 +18,7 @@ jobs: with: update-conda: true python-version: 3.7 - conda-channels: anaconda, conda-forge + conda-channels: anaconda, omnia, conda-forge, martimunicoy - name: Install doc dependencies shell: bash @@ -27,10 +27,7 @@ jobs: if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi - name: Install latest peleffy version - shell: bash - run: | - conda config --add channels omnia --add channels conda-forge --add channels martimunicoy - conda install peleffy + run: conda install peleffy - name: Build sphinx documentation shell: bash From c3b235222d13cbca6469e4036c0d9c82e0fb53e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Tue, 20 Apr 2021 17:05:41 +0200 Subject: [PATCH 07/10] Deploy for Python 3.8 --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 65ea837f..e8f5e761 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest] - python-version: [3.6, 3.7] + python-version: [3.6, 3.7, 3.8] name: Python ${{ matrix.python-version }} at ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 22fb64169a6f4f3db452bdabaa1b49cb92a291fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Tue, 20 Apr 2021 17:13:21 +0200 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64da3c7f..99eecff2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -| **About** | [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.6%2C%203.7-blue.svg)](https://martimunicoy.github.io/peleffy) [![Release](https://img.shields.io/github/release/martimunicoy/peleffy.svg?include_prereleases)](https://github.com/martimunicoy/peleffy/releases/) | +| **About** | [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.6%2C%203.7%2C%203.8-blue.svg)](https://martimunicoy.github.io/peleffy) [![Release](https://img.shields.io/github/release/martimunicoy/peleffy.svg?include_prereleases)](https://github.com/martimunicoy/peleffy/releases/) | | :------ | :------- | | **Status** | [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/martimunicoy/peleffy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/martimunicoy/peleffy/context:python) [![Test](https://github.com/martimunicoy/peleffy/workflows/Test/badge.svg)](https://github.com/martimunicoy/peleffy/actions?query=workflow%3ATest) [![codecov](https://codecov.io/gh/martimunicoy/peleffy/branch/master/graph/badge.svg)](https://codecov.io/gh/martimunicoy/peleffy) | | **Installation** | [![Conda](https://img.shields.io/conda/v/martimunicoy/peleffy.svg)](https://anaconda.org/martimunicoy/peleffy) [![PyPI](https://img.shields.io/pypi/v/peleffy)](https://pypi.org/project/peleffy/) | From 377862a1e100547c436608e5ffd4d85a1f31cd3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Municoy?= Date: Wed, 28 Apr 2021 18:52:57 +0200 Subject: [PATCH 09/10] Remove python version constraint --- devtools/conda/meta.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/devtools/conda/meta.yaml b/devtools/conda/meta.yaml index f5e73c09..065f1fb5 100644 --- a/devtools/conda/meta.yaml +++ b/devtools/conda/meta.yaml @@ -13,13 +13,11 @@ build: requirements: build: - # Note that rdkit does not support Python 3.8 yet - - python 3.6|3.7 + - python - setuptools run: - # Note that rdkit does not support Python 3.8 yet - - python 3.6|3.7 + - python - numpy - matplotlib - pytest From 64d7aa446fb9236e7e905a8aaf3dc66dde64027c Mon Sep 17 00:00:00 2001 From: Anna Gruszka Date: Mon, 7 Jun 2021 17:40:03 +0200 Subject: [PATCH 10/10] PELE-451 Minor adjustments to ensure platform compatibility --- peleffy/topology/conformer.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/peleffy/topology/conformer.py b/peleffy/topology/conformer.py index a1bbb180..23459ff9 100644 --- a/peleffy/topology/conformer.py +++ b/peleffy/topology/conformer.py @@ -16,10 +16,9 @@ class BCEConformations(object): """ - A class to produce a library of conformations from the output - of the BCE server. + A class to produce a library of conformations from a set of ligand PDB files. """ - def __init__(self, topology_obj, bce_output_path): + def __init__(self, topology_obj, bce_output_path, from_bce=True): """ Initializes a BCEConformations object. @@ -29,11 +28,15 @@ def __init__(self, topology_obj, bce_output_path): A Topology object that contains the ligand's information bce_output_path: str Path where the output from the BCE server is stored + from_bce : bool + Whether the ligand clusters originate from the BCE server or not. Affects cluster search path in + _calculate_all_conformations method. """ self._topology = topology_obj self._molecule = topology_obj.molecule self.bce_path = bce_output_path self.conformations_library = {} + self.from_bce = from_bce def calculate(self): """ @@ -44,9 +47,11 @@ def calculate(self): self._calculate_all_conformations() def _calculate_all_conformations(self): - clusters = sorted(glob.glob(os.path.join(self.bce_path, - "CLUSTERS", "CL*", - "cluster*.min.imaged.pdb"))) + if self.from_bce: + clusters = sorted(glob.glob(os.path.join(self.bce_path, "CLUSTERS", "CL*", "cluster*.min.imaged.pdb"))) + else: + clusters = sorted(glob.glob(os.path.join(self.bce_path, "*.pdb"))) + if not clusters: raise ValueError("Path to the BCE output does not contain a " + "CLUSTERS folder, please check if the path " @@ -56,7 +61,6 @@ def _calculate_all_conformations(self): for cluster in ordered_clusters: self.calculate_cluster_offsets(cluster) - def calculate_cluster_offsets(self, cluster_pdb): """ Calculate dihedral angles from PDB. @@ -71,7 +75,8 @@ def calculate_cluster_offsets(self, cluster_pdb): # Use the input molecule as template since the cluster structures # probably will not have proper stereochemistry mol = molecule.Molecule( - cluster_pdb, connectivity_template=self._molecule.rdkit_molecule) + cluster_pdb, connectivity_template=self._molecule.rdkit_molecule, + allow_undefined_stereo=self._molecule.allow_undefined_stereo) cluster_coordinates = mol.get_conformer() topology_to_cluster = { i: x for i, x @@ -136,7 +141,8 @@ def order_clusters_min_distances(self, clusters): # probably will not have proper stereochemistry cluster_molecules.append(molecule.Molecule( cluster, - connectivity_template=self._molecule.rdkit_molecule)) + connectivity_template=self._molecule.rdkit_molecule, + allow_undefined_stereo=self._molecule.allow_undefined_stereo)) for i, cluster_mol in enumerate(cluster_molecules): for j, cluster_mol_2 in enumerate(cluster_molecules[i+1:], start=i+1): @@ -179,6 +185,7 @@ def find_optimal_path_from_matrix(distances): return min_path + def find_heuristic_path(graph, distances, start_node): """ Given a graph, the corresponding distances matrix and a starting node, @@ -222,13 +229,13 @@ def find_heuristic_path(graph, distances, start_node): def find_index_root(sorted_topology, topology): """ It finds the index of the root atom in the original topology - that matches with the one from the topology that fullfills the Impact + that matches with the one from the topology that fulfills the Impact template rules. Parameters ---------- sorted_topology : a peleffy.topology.Topology object - The topology sorted to fullfill the Impact template format + The topology sorted to fulfill the Impact template format topology : a peleffy.topology.Topology object The original topology object