diff --git a/src/chilife/RotamerEnsemble.py b/src/chilife/RotamerEnsemble.py index 1c56111..a31946d 100644 --- a/src/chilife/RotamerEnsemble.py +++ b/src/chilife/RotamerEnsemble.py @@ -462,7 +462,7 @@ def protein_setup(self): raise RuntimeError('Both `minimize` and `eval_clash` options have been selected, but they are incompatible.' 'Please select only one. Also note that minimize performs its own clash evaluations so ' 'eval_clash is not necessary.') - elif self.eval_clash: + elif self.eval_clash and len(self.side_chain_idx): self.evaluate() elif self._minimize: diff --git a/src/chilife/__init__.py b/src/chilife/__init__.py index cc2ad9f..564aeaa 100644 --- a/src/chilife/__init__.py +++ b/src/chilife/__init__.py @@ -44,4 +44,4 @@ # SpinLabel = SpinLabel.SpinLabel # dSpinLabel = dSpinLabel.dSpinLabel -__version__ = "1.2.4" +__version__ = "1.2.5" diff --git a/src/chilife/io.py b/src/chilife/io.py index 7cf7bb1..6ce72e2 100644 --- a/src/chilife/io.py +++ b/src/chilife/io.py @@ -432,7 +432,9 @@ def read_bbdep(res: str, Phi: int, Psi: int) -> Dict: else: lib["weights"] = np.array([1]) - lib["dihedrals"], lib["sigmas"], dihedral_atoms = [], [], [] + lib["dihedrals"] = np.zeros((1, 0)) + lib["sigmas"] = np.zeros((1, 0)) + dihedral_atoms = [] coords = ICs.to_cartesian()[None, ...] internal_coords = ICs.copy() diff --git a/tests/test_ProteinUtils.py b/tests/test_ProteinUtils.py index 626c952..e0a86b1 100644 --- a/tests/test_ProteinUtils.py +++ b/tests/test_ProteinUtils.py @@ -179,6 +179,15 @@ def test_mutate3(): assert len(labeled_protein.atoms) != len(protein.atoms) +def test_mutate_ala_gly_eval_clash(): + protein = mda.Universe("test_data/1omp_H.pdb").select_atoms("protein") + D41G = chilife.RotamerEnsemble("GLY", 41, protein=protein) + S238A = chilife.RotamerEnsemble("ALA", 238, protein=protein) + mPro = chilife.mutate(protein, D41G, S238A, add_missing_atoms=False) + assert mPro.select_atoms("resnum 41").residues[0].resname == "GLY" + assert mPro.select_atoms("resnum 238").residues[0].resname == "ALA" + + def test_mutate4(): protein = mda.Universe("test_data/1omp_H.pdb").select_atoms("protein") D41G = chilife.RotamerEnsemble("GLY", 41, protein=protein, eval_clash=False)