def test_dihedral_5mat(self): from moleculekit.molecule import Molecule from moleculekit.home import home from moleculekit.tools.autosegment import autoSegment from os import path mol = Molecule('5MAT') mol.filter('not insertion A and not altloc A B', _logger=False) mol = autoSegment(mol, _logger=False) data = MetricDihedral().project(mol) dataref = np.load( path.join(home(dataDir='test-projections'), 'metricdihedral', '5mat.npy')) assert np.allclose( data, dataref, atol=1e-03 ), 'Diherdals calculation gave different results from reference' ref_idx = np.load( path.join(home(dataDir='test-projections'), 'metricdihedral', '5mat_mapping_indexes.npy')) mapping = MetricDihedral().getMapping(mol) mapping_idx = np.vstack(mapping.atomIndexes.to_numpy()) assert np.array_equal(mapping_idx, ref_idx), 'Mapping of atom indexes has changed'
def test_dihedral_5mat(self): from moleculekit.molecule import Molecule from moleculekit.home import home from moleculekit.tools.autosegment import autoSegment from os import path mol = Molecule('5MAT') mol.filter('not insertion A and not altloc A B', _logger=False) mol = autoSegment(mol, _logger=False) data = MetricDihedral().project(mol) dataref = np.load(path.join(home(dataDir='test-projections'), 'metricdihedral', '5mat.npy')) assert np.allclose(data, dataref, atol=1e-03), 'Diherdals calculation gave different results from reference'
def setUpClass(self): from moleculekit.home import home from moleculekit.molecule import Molecule from moleculekit.tools.preparation import proteinPrepare from moleculekit.tools.autosegment import autoSegment self.testf = os.path.join(home(), 'test-data', 'test-voxeldescriptors') mol = Molecule(os.path.join(self.testf, '3PTB.pdb')) mol.filter('protein') mol = autoSegment(mol, field='both') mol = proteinPrepare(mol) mol.bonds = mol._guessBonds() self.mol = mol
def setUpClass(self): from moleculekit.home import home from moleculekit.molecule import Molecule from moleculekit.tools.preparation import systemPrepare from moleculekit.tools.autosegment import autoSegment self.testf = os.path.join(home(), "test-data", "test-voxeldescriptors") mol = Molecule(os.path.join(self.testf, "3PTB.pdb")) mol.filter("protein") mol = autoSegment(mol, field="both") mol = systemPrepare(mol, pH=7.0) mol.bonds = mol._guessBonds() self.mol = mol
def prepare_protein(chimera: Chimera) -> Molecule: """ Builds a water box around the chimera :param chimera: :return: """ non_standards = Builder.find_nonstandards(chimera) if non_standards: raise NotCorrectPDBError(f"PDB presents the non_standards residues {non_standards}." f" Call remove_residue() or Builder.mutate_nonstandards()" f" if you wish to minimize.") mol = proteinPrepare(chimera) if 'AR0' in mol.resname: mol.set("resname", "ARG", "resname AR0") mol = autoSegment(mol) mol.center() # D = maxDistance(mol,'all') + 6.0 # smol=solvate(mol,minmax=[[-D, -D, -D], [D, D, D]]) return mol
return rho, phi angle, _ = cart2pol(xa, ya) return angle + np.radians(45) if __name__ == "__main__": from moleculekit.molecule import Molecule from moleculekit.tools.autosegment import autoSegment from htmd.home import home from os import path p = Molecule( path.join(home(), 'data', 'building-protein-membrane', '4dkl.pdb')) p.filter('(chain B and protein) or water') p = autoSegment(p, 'protein', 'P') m = Molecule( path.join(home(), 'data', 'building-protein-membrane', 'membrane.pdb')) a = embed(p, m) print(np.unique(m.get('segid'))) mol = Molecule( path.join(home(), 'data', 'building-protein-membrane', '1ITG_clean.pdb')) ref = Molecule( path.join(home(), 'data', 'building-protein-membrane', '1ITG.pdb')) mol = autoSegment(mol, sel='protein') assert np.all(mol.segid == ref.segid) mol = Molecule( path.join(home(), 'data', 'building-protein-membrane',
phi = np.arctan2(y, x) return rho, phi angle, _ = cart2pol(xa, ya) return angle + np.radians(45) if __name__ == "__main__": from moleculekit.molecule import Molecule from moleculekit.tools.autosegment import autoSegment from htmd.home import home from os import path p = Molecule(path.join(home(), "data", "building-protein-membrane", "4dkl.pdb")) p.filter("(chain B and protein) or water") p = autoSegment(p, "protein", "P") m = Molecule(path.join(home(), "data", "building-protein-membrane", "membrane.pdb")) a = embed(p, m) print(np.unique(m.get("segid"))) mol = Molecule( path.join(home(), "data", "building-protein-membrane", "1ITG_clean.pdb") ) ref = Molecule(path.join(home(), "data", "building-protein-membrane", "1ITG.pdb")) mol = autoSegment(mol, sel="protein") assert np.all(mol.segid == ref.segid) mol = Molecule( path.join(home(), "data", "building-protein-membrane", "3PTB_clean.pdb") ) ref = Molecule(path.join(home(), "data", "building-protein-membrane", "3PTB.pdb"))