Skip to content

Commit

Permalink
Merge pull request #164 from martimunicoy/devel
Browse files Browse the repository at this point in the history
peleffy 1.4.1 release
  • Loading branch information
martimunicoy authored Dec 16, 2021
2 parents d296dbe + 41dd236 commit 134e3aa
Show file tree
Hide file tree
Showing 7 changed files with 7,078 additions and 12 deletions.
1 change: 1 addition & 0 deletions devtools/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ requirements:
run:
- python
- numpy
- ipython
- matplotlib
- pytest
- networkx
Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def add_source_parser(_old_add_source_parser, self, *args, **kwargs):
source_suffix = ['.rst', '.md']
master_doc = 'index'

import peleffy
version = peleffy.__version__
#import peleffy
#version = peleffy.__version__
version = '1.4.1'

pygments_style = 'sphinx'

Expand Down
14 changes: 14 additions & 0 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ Releases follow the ``major.minor.micro`` scheme recommended by `PEP440 <https:/
* ``micro`` increments represent bugfix releases or improvements in documentation


1.4.1 - Bug fixes for heteromolecules extraction
---------------------------------------------------------

This is a micro release of peleffy that fixes a bug that affected heteromolecules extraction.

Bugfixes
""""""""
- `PR #163 <https://github.com/martimunicoy/peleffy/pull/163>`_: Fix problem when extracting heteromolecules from a specific chain

Tests added
"""""""""""
- `PR #163 <https://github.com/martimunicoy/peleffy/pull/163>`_: Adds a test to validate heteromolecule extraction


1.4.0 - Alchemistry and AMBER support
---------------------------------------------------------

Expand Down
6,963 changes: 6,963 additions & 0 deletions peleffy/data/complexes/5XXD_SAM.pdb

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions peleffy/data/ligands/SAM.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
HETATM 1 N1 SAM A 501 11.254 14.727 130.068 1.00 11.67 N1+
HETATM 2 C1 SAM A 501 11.140 14.583 128.621 1.00 14.71 C
HETATM 3 C2 SAM A 501 10.111 15.549 128.042 1.00 12.67 C
HETATM 4 O1 SAM A 501 9.527 16.358 128.763 1.00 10.25 O
HETATM 5 O2 SAM A 501 9.844 15.549 126.839 1.00 11.76 O1-
HETATM 6 C3 SAM A 501 10.780 13.147 128.258 1.00 8.86 C
HETATM 7 C4 SAM A 501 11.984 12.236 128.043 1.00 11.62 C
HETATM 8 S1 SAM A 501 12.990 12.763 126.632 1.00 10.50 S1+
HETATM 9 C5 SAM A 501 13.157 11.213 125.715 1.00 9.40 C
HETATM 10 C6 SAM A 501 14.636 12.851 127.376 1.00 11.94 C
HETATM 11 C7 SAM A 501 14.886 14.142 128.140 1.00 10.41 C
HETATM 12 O3 SAM A 501 14.211 14.108 129.386 1.00 16.21 O
HETATM 13 C8 SAM A 501 16.366 14.330 128.436 1.00 13.82 C
HETATM 14 O4 SAM A 501 16.962 15.199 127.502 1.00 15.56 O
HETATM 15 C9 SAM A 501 16.388 14.932 129.820 1.00 12.80 C
HETATM 16 O5 SAM A 501 16.376 16.334 129.709 1.00 14.87 O
HETATM 17 C10 SAM A 501 15.076 14.497 130.436 1.00 14.63 C
HETATM 18 N2 SAM A 501 15.296 13.330 131.307 1.00 14.59 N
HETATM 19 C11 SAM A 501 15.062 12.026 130.956 1.00 10.75 C
HETATM 20 N3 SAM A 501 15.381 11.236 132.003 1.00 12.26 N
HETATM 21 C12 SAM A 501 15.825 12.012 133.015 1.00 14.55 C
HETATM 22 C13 SAM A 501 16.275 11.708 134.293 1.00 13.87 C
HETATM 23 N4 SAM A 501 16.322 10.444 134.704 1.00 10.42 N
HETATM 24 N5 SAM A 501 16.675 12.728 135.130 1.00 16.71 N
HETATM 25 C14 SAM A 501 16.628 14.038 134.693 1.00 13.41 C
HETATM 26 N6 SAM A 501 16.174 14.329 133.422 1.00 15.71 N
HETATM 27 C15 SAM A 501 15.776 13.334 132.593 1.00 15.16 C
HETATM 28 H1 SAM A 501 11.941 14.075 130.419 1.00 0.00 H
HETATM 29 H2 SAM A 501 11.540 15.670 130.292 1.00 0.00 H
HETATM 30 H3 SAM A 501 10.360 14.536 130.497 1.00 0.00 H
HETATM 31 H4 SAM A 501 12.109 14.813 128.179 1.00 0.00 H
HETATM 32 H5 SAM A 501 10.161 13.146 127.361 1.00 0.00 H
HETATM 33 H6 SAM A 501 10.143 12.726 129.036 1.00 0.00 H
HETATM 34 H7 SAM A 501 11.641 11.214 127.882 1.00 0.00 H
HETATM 35 H8 SAM A 501 12.598 12.228 128.943 1.00 0.00 H
HETATM 36 H9 SAM A 501 13.754 11.383 124.819 1.00 0.00 H
HETATM 37 H10 SAM A 501 13.649 10.470 126.343 1.00 0.00 H
HETATM 38 H11 SAM A 501 12.169 10.851 125.430 1.00 0.00 H
HETATM 39 H12 SAM A 501 15.391 12.739 126.598 1.00 0.00 H
HETATM 40 H13 SAM A 501 14.777 12.002 128.045 1.00 0.00 H
HETATM 41 H14 SAM A 501 14.523 14.986 127.554 1.00 0.00 H
HETATM 42 H15 SAM A 501 16.877 13.367 128.435 1.00 0.00 H
HETATM 43 H16 SAM A 501 17.894 15.302 127.709 1.00 0.00 H
HETATM 44 H17 SAM A 501 17.242 14.580 130.399 1.00 0.00 H
HETATM 45 H18 SAM A 501 16.390 16.725 130.586 1.00 0.00 H
HETATM 46 H19 SAM A 501 14.636 15.316 131.005 1.00 0.00 H
HETATM 47 H20 SAM A 501 14.683 11.791 129.972 1.00 0.00 H
HETATM 48 H21 SAM A 501 16.650 10.227 135.634 1.00 0.00 H
HETATM 49 H22 SAM A 501 16.030 9.701 134.086 1.00 0.00 H
CONECT 1 2 28 29 30
CONECT 2 3 6 31
CONECT 3 4 4 5
CONECT 6 7 32 33
CONECT 7 8 34 35
CONECT 8 9 10
CONECT 9 36 37 38
CONECT 10 11 39 40
CONECT 11 12 13 41
CONECT 12 17
CONECT 13 14 15 42
CONECT 14 43
CONECT 15 16 17 44
CONECT 16 45
CONECT 17 18 46
CONECT 18 19 27
CONECT 19 20 20 47
CONECT 20 21
CONECT 21 22 27 27
CONECT 22 23 24 24
CONECT 23 48 49
CONECT 24 25
CONECT 25 26 26 50
CONECT 26 27
END
23 changes: 15 additions & 8 deletions peleffy/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,14 @@ class TestPDBFile(object):
"""
It contains all the tests to validate the PDBFile class.
"""
def test_get_molecule_from_chain(self):

@pytest.mark.parametrize(("complex_path", "ligand_path", "chain"),
[
('complexes/LYS_BNZ.pdb', 'ligands/BNZ.pdb', "L"),
('complexes/5XXD_SAM.pdb', 'ligands/SAM.pdb', "A")
]
)
def test_get_molecule_from_chain(self, complex_path, ligand_path, chain):
"""
It tests the method that returns a molecule from a selected chain from
an input PDB file.
Expand Down Expand Up @@ -757,19 +764,19 @@ def compare_molecules(mol1, mol2):
from peleffy.utils import get_data_file_path
from peleffy.topology import Molecule

PATH_COMPLEX_PDB = get_data_file_path('complexes/LYS_BNZ.pdb')
PATH_LIGAND_PDB = get_data_file_path('ligands/BNZ.pdb')
PATH_COMPLEX_PDB = get_data_file_path(complex_path)
PATH_LIGAND_PDB = get_data_file_path(ligand_path)

# Test method get_molecule_from_chain
PDBreader = PDBFile(PATH_COMPLEX_PDB)
molecules = PDBreader.get_molecules_from_chain(selected_chain='L')
molecules = PDBreader.get_molecules_from_chain(selected_chain=chain)
assert len(molecules) == 1, 'Unexpected number of molecules'
assert compare_molecules(molecules[0], Molecule(PATH_LIGAND_PDB)) is True

# Test allow_undefined_stereo flag
PDBreader = PDBFile(PATH_COMPLEX_PDB)
molecules = \
PDBreader.get_molecules_from_chain(selected_chain='L',
PDBreader.get_molecules_from_chain(selected_chain=chain,
allow_undefined_stereo=True)
assert len(molecules) == 1, 'Unexpected number of molecules'
assert compare_molecules(molecules[0],
Expand All @@ -779,23 +786,23 @@ def compare_molecules(mol1, mol2):
# Test exclude_terminal_rotamers flag
PDBreader = PDBFile(PATH_COMPLEX_PDB)
molecules = \
PDBreader.get_molecules_from_chain(selected_chain='L',
PDBreader.get_molecules_from_chain(selected_chain=chain,
exclude_terminal_rotamers=False)
assert len(molecules) == 1, 'Unexpected number of molecules'
assert compare_molecules(molecules[0], Molecule(
PATH_LIGAND_PDB, exclude_terminal_rotamers=False)) is True

# Test rotamer_resolution flag
PDBreader = PDBFile(PATH_COMPLEX_PDB)
molecules = PDBreader.get_molecules_from_chain(selected_chain='L',
molecules = PDBreader.get_molecules_from_chain(selected_chain=chain,
rotamer_resolution=10)
assert compare_molecules(molecules[0],
Molecule(PATH_LIGAND_PDB,
rotamer_resolution=10)) is True

# Test core_constraints flag
PDBreader = PDBFile(PATH_COMPLEX_PDB)
molecules = PDBreader.get_molecules_from_chain(selected_chain='L',
molecules = PDBreader.get_molecules_from_chain(selected_chain=chain,
core_constraints=[1,2])
assert len(molecules) == 1, 'Unexpected number of molecules'
assert molecules[0].core_constraints == [1,2]
Expand Down
10 changes: 8 additions & 2 deletions peleffy/utils/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,15 @@ def _extract_molecules_from_chain(self, chain, rotamer_resolution,

if line.startswith('CONECT'):
stripped_line = line.replace("CONECT", "")
ids_in_line = [stripped_line[i:i + 5] for i in range(0, len(stripped_line), 5)]
ids_in_line = [stripped_line[i:i + 5] for i in
range(0, len(stripped_line), 5)]

if any([atom_id in ids_in_line for atom_id in atom_ids]):
# Strip out whitespaces from ids
stripped_ids_in_line = [element.strip() for
element in ids_in_line]

if any([atom_id in stripped_ids_in_line for
atom_id in atom_ids]):
pdb_block.append(line)

try:
Expand Down

0 comments on commit 134e3aa

Please sign in to comment.