Ejemplo n.º 1
0
def exercise_02():
    for file_name, input_model in [("m_good.pdb", model_good),
                                   ("m_bad.pdb", model_bad)]:
        tmp_f = open(file_name, "w")
        tmp_f.write(input_model)
        tmp_f.close()
    xrs_exact = iotbx.pdb.pdb_input(
        file_name="m_good.pdb").xray_structure_simple()
    model = mmtbx.model.manager(model_input=iotbx.pdb.input(
        file_name="m_bad.pdb"))
    xrs_part = model.get_xray_structure()
    miller_set = miller.build_set(
        crystal_symmetry=xrs_exact.crystal_symmetry(),
        anomalous_flag=False,
        d_min=0.6)
    f_obs = abs(
        miller_set.structure_factors_from_scatterers(
            xray_structure=xrs_exact, algorithm="direct",
            cos_sin_table=False).f_calc())
    sf_par = mmtbx.f_model.sf_and_grads_accuracy_master_params.extract()
    sf_par.algorithm = "direct"
    sf_par.cos_sin_table = False
    fmodel = mmtbx.f_model.manager(xray_structure=xrs_part,
                                   sf_and_grads_accuracy_params=sf_par,
                                   target_name="ls_wunit_k1",
                                   f_obs=f_obs)
    #
    out = StringIO()
    params = find_hydrogens.all_master_params().extract()
    params.map_cutoff = 6.5
    find_hydrogens.run(fmodel=fmodel, model=model, log=out, params=params)
Ejemplo n.º 2
0
def exercise_02():
    for file_name, input_model in [("m_good.pdb", model_good), ("m_bad.pdb", model_bad)]:
        tmp_f = open(file_name, "w")
        tmp_f.write(input_model)
        tmp_f.close()
    xrs_exact = iotbx.pdb.pdb_input(file_name="m_good.pdb").xray_structure_simple()
    xrs_part = iotbx.pdb.pdb_input(file_name="m_bad.pdb").xray_structure_simple()
    miller_set = miller.build_set(crystal_symmetry=xrs_exact.crystal_symmetry(), anomalous_flag=False, d_min=0.6)
    f_obs = abs(
        miller_set.structure_factors_from_scatterers(
            xray_structure=xrs_exact, algorithm="direct", cos_sin_table=False
        ).f_calc()
    )
    sf_par = mmtbx.f_model.sf_and_grads_accuracy_master_params.extract()
    sf_par.algorithm = "direct"
    sf_par.cos_sin_table = False
    fmodel = mmtbx.f_model.manager(
        xray_structure=xrs_part, sf_and_grads_accuracy_params=sf_par, target_name="ls_wunit_k1", f_obs=f_obs
    )
    #
    mon_lib_srv = monomer_library.server.server()
    ener_lib = monomer_library.server.ener_lib()
    processed_pdb_file = monomer_library.pdb_interpretation.process(
        mon_lib_srv=mon_lib_srv, ener_lib=ener_lib, file_name="m_bad.pdb"
    )
    model = mmtbx.model.manager(
        xray_structure=xrs_part, pdb_hierarchy=processed_pdb_file.all_chain_proxies.pdb_hierarchy, log=None
    )
    #
    out = StringIO()
    params = find_hydrogens.all_master_params().extract()
    params.map_cutoff = 6.5
    find_hydrogens.run(fmodel=fmodel, model=model, log=out, params=params)