def test_distance_alpha_c(self): """ test distance_alpha_c method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.distance_alpha_c(centers, False, unit_test_dir) self.assertEqual(ris['unit_27-48.pdb']['CA1'], 8.609722419859281)
def test_handedness(self): """ test handedness method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.handedness(centers, False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb'], 'L') self.assertEquals(ris['unit_49-72.pdb'], 'L')
def test_curvature(self): """ test curvature method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.curvature(centers, False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb_unit_49-72.pdb'], 18.9001109414561)
def test_pitch(self): """ test pitch method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.pitch(centers, False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb_unit_49-72.pdb'], 11.498455699343008)
def test_twist(self): """ test twist method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.twist(centers, False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb_unit_49-72.pdb'], 0.9309720264364901)
def test_center_of_mass(self): """ test center_of_mass method :return: """ ris = compute_geometry.center_mass_unit(False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb'], (-54.48145734501918, 30.31792712426065, 15.1713042009396)) self.assertEquals(ris['unit_49-72.pdb'], (-50.468922194033716, 34.10473405182134, 10.878357331957995))
def test_distance_center_of_mass(self): """ test distance_center_of_mass method :return: """ centers = compute_geometry.center_mass_unit(False, unit_test_dir) ris = compute_geometry.distance_center_of_mass(centers, False, unit_test_dir) self.assertEquals(ris['unit_27-48.pdb']['unit_49-72.pdb'], 6.990689369755643) self.assertEquals(ris['unit_27-48.pdb']['unit_49-72.pdb'], ris['unit_49-72.pdb']['unit_27-48.pdb'])
'message': 'Display the results with pymol?', 'default': False }, ] answers = prompt(questions, style=style) if answers['draw']: # pymol pymol.finish_launching() for unit in os.listdir(unit_dir): pymol.cmd.load(unit_dir + unit, unit) centers = compute_geometry.center_mass_unit(answers['draw'], unit_dir) if answers['center_of_mass']: if answers['json']: print(json.dumps(centers, indent=4, sort_keys=True)) else: for unit in unit_dir_list: keys = natural_keys(unit) print("Center of mass of " + unit.split('.')[0] + " is: " + str(centers[unit])) if answers['center_of_mass_distance']: ris = compute_geometry.distance_center_of_mass(centers, answers['draw'], unit_dir) if answers['json']: