def run(): filename = 'tst_multi.pdb' f = open(filename, 'w') f.write(pdb_lines) f.close() pdb_inp = pdb.input(filename) pdb_hierarchy = pdb_inp.construct_hierarchy() from mmtbx.conformation_dependent_library.tst_rdl import \ get_geometry_restraints_manager geometry_restraints_manager = get_geometry_restraints_manager(filename) pdb_hierarchy.reset_i_seq_if_necessary() refine = [ False, # -179 True, # -44 False, # 86 True, # -22 False, # -179 ] refine += [True] * 5 refine += [False] * 14 omegalyze = [ False, False, False, True, False, ] omegalyze += [True] * 3 omegalyze += [False] * 16 from mmtbx.conformation_dependent_library import generate_protein_threes for i, threes in enumerate( generate_protein_threes( pdb_hierarchy, geometry_restraints_manager, cdl_class=True, #verbose=verbose, )): print(i, threes) print(' omega %5.1f' % threes.get_omega_value()) print(" cis? %-5s %s" % (threes.cis_group(), threes.cis_group(limit=30))) print(" trans? %-5s %s" % (threes.trans_group(), threes.trans_group(limit=30))) print(" rama %s" % threes.get_ramalyze_key()) print(' conf %s' % threes.is_pure_main_conf()) assert threes.cis_group() == refine[i], '%s!=%s' % (threes.cis_group(), refine[i]) assert threes.cis_group(limit=30) == omegalyze[i] for j in range(0, 181, 10): i += 1 print(" %3d %-5s %-8s %-5s" % ( j, threes._define_omega_a_la_duke_using_limit(j) == 'cis', threes._define_omega_a_la_duke_using_limit(j, limit=30), refine[i], )) assert (threes._define_omega_a_la_duke_using_limit(j) == 'cis' ) == refine[i]
def id_str_for_phi_psi_2(self, ignore_altloc=False): return '%s ~> %s' % ( id_str_for_phi_psi_2(self[1], ignore_altloc), id_str_for_phi_psi_2(self[2], ignore_altloc)) class FiveProteinResidues(FourProteinResidues): def get_cablam_info(self): assert 0 if __name__=="__main__": import sys from iotbx import pdb from mmtbx.conformation_dependent_library.tst_rdl import get_geometry_restraints_manager filename=sys.argv[1] pdb_inp = pdb.input(filename) pdb_hierarchy = pdb_inp.construct_hierarchy() geometry_restraints_manager = get_geometry_restraints_manager(filename) pdb_hierarchy.reset_i_seq_if_necessary() from mmtbx.conformation_dependent_library import generate_protein_fragments for i in range(2,11): for threes in generate_protein_fragments(pdb_hierarchy, geometry_restraints_manager, length=i, #verbose=verbose, ): print(threes) try: print(' omega %5.1f' % threes.get_omega_value()) except: print(' omega is not valid') # intentional print(' omegas %s' % threes.get_omega_values()) try: print(" cis? %-5s %s" % (threes.cis_group(), threes.cis_group(limit=30))) except: print(' cis? is not valid') # intentional try: print(" trans? %-5s %s" % (threes.trans_group(), threes.trans_group(limit=30)))