def tst_3(): ''' Test if the modification works also when cif_objects are supplied (meaning there is a ligand cif file) ''' pdb_inp = iotbx.pdb.input(lines=pdb_str2.split("\n"), source_info=None) cif_object = iotbx.cif.reader(input_string=cif_str2).model() # bla.cif does not exist, but cif_objects needs a filename in first position # of the tuple cif_objects = [('bla.cif', cif_object)] params = mmtbx.model.manager.get_default_pdb_interpretation_params() params.pdb_interpretation.use_neutron_distances = False model = mmtbx.model.manager(model_input=pdb_inp, pdb_interpretation_params=params, restraint_objects=cif_objects, log=null_out()) # request neutron bond lengths model.set_hydrogen_bond_length(use_neutron_distances=True, show=False, log=sys.stdout) compare_XH_bond_length_to_ideal(model=model) # request X-ray bond lengths model.set_hydrogen_bond_length(use_neutron_distances=False, show=False, log=sys.stdout) compare_XH_bond_length_to_ideal(model=model)
def tst_1(): ''' input model: bond lengths close to neutron but not quite input grm: neutron bond lengths ''' pdb_inp = iotbx.pdb.input(lines=pdb_str1.split("\n"), source_info=None) params = mmtbx.model.manager.get_default_pdb_interpretation_params() params.pdb_interpretation.use_neutron_distances = True model = mmtbx.model.manager(model_input=pdb_inp, pdb_interpretation_params=params, log=null_out(), build_grm=True) # request neutron bond lengths model.set_hydrogen_bond_length(use_neutron_distances=True, show=False, log=sys.stdout) model.process_input_model(make_restraints=True) compare_XH_bond_length_to_ideal(model=model) #STOP() # request X-ray bond lengths pdb_inp = iotbx.pdb.input(lines=pdb_str1.split("\n"), source_info=None) model = mmtbx.model.manager(model_input=pdb_inp, pdb_interpretation_params=params, log=null_out(), build_grm=False) model.set_hydrogen_bond_length(use_neutron_distances=False, show=False, log=sys.stdout) compare_XH_bond_length_to_ideal(model=model)
def tst_2(): ''' input model: bond lengths close to neutron but not quite input grm: X-ray bond lengths ''' pdb_inp = iotbx.pdb.input(lines=pdb_str1.split("\n"), source_info=None) params = mmtbx.model.manager.get_default_pdb_interpretation_params() params.pdb_interpretation.use_neutron_distances = False model = mmtbx.model.manager( model_input = pdb_inp, log = null_out()) model.process(pdb_interpretation_params = params) # # Check if selected individual bond lengths are correct atoms = model.get_hierarchy().atoms() assert (atoms[4].id_str() == 'pdb=" CB ARG A 74 "') assert (atoms[18].id_str() == 'pdb=" HB2 ARG A 74 "') assert approx_equal(atoms[4].distance(atoms[18]), 1.08, eps = 0.005) assert (atoms[10].id_str() == 'pdb=" NH2 ARG A 74 "') assert (atoms[15].id_str() == 'pdb="DH21 ARG A 74 "') assert approx_equal(atoms[10].distance(atoms[15]), 0.99, eps = 0.005) # request neutron bond lengths model.set_hydrogen_bond_length(use_neutron_distances=True, show=False, log=sys.stdout) # Check if bond lengths are equal to ideal compare_XH_bond_length_to_ideal(model = model) # Check if selected individual bond lengths are correct atoms = model.get_hierarchy().atoms() assert approx_equal(atoms[4].distance(atoms[18]), 1.09, eps = 0.005) assert approx_equal(atoms[10].distance(atoms[15]), 1.02, eps = 0.005) # request X-ray bond lengths model.set_hydrogen_bond_length(use_neutron_distances=False, show=False, log=sys.stdout) compare_XH_bond_length_to_ideal(model = model) # Check if selected individual bond lengths are correct atoms = model.get_hierarchy().atoms() assert approx_equal(atoms[4].distance(atoms[18]), 0.97, eps = 0.005) assert approx_equal(atoms[10].distance(atoms[15]), 0.86, eps = 0.005)