def get_model_map_coeffs_normalized(pdb_inp=None, si=None, f_array=None, overall_b=None, resolution=None, n_bins=None, target_b_iso_model_scale=0, out=sys.stdout): if not pdb_inp: return None if not si: from cctbx.maptbx.segment_and_split_map import sharpening_info si=sharpening_info(resolution=resolution, target_b_iso_model_scale=0, n_bins=n_bins) # define Wilson B for the model if overall_b is None: if si.resolution: overall_b=si.get_target_b_iso()*si.target_b_iso_model_scale else: overall_b=0 print("Setting Wilson B = %5.1f A" %(overall_b), file=out) # create model map using same coeffs from cctbx.maptbx.segment_and_split_map import get_f_phases_from_model try: model_map_coeffs=get_f_phases_from_model( pdb_inp=pdb_inp, f_array=f_array, overall_b=overall_b, k_sol=si.k_sol, b_sol=si.b_sol, out=out) except Exception as e: print ("Failed to get model map coeffs...going on",file=out) return None from cctbx.maptbx.segment_and_split_map import map_coeffs_as_fp_phi,get_b_iso model_f_array,model_phases=map_coeffs_as_fp_phi(model_map_coeffs) (d_max,d_min)=f_array.d_max_min() model_f_array.setup_binner(n_bins=si.n_bins,d_max=d_max,d_min=d_min) # Set overall_b.... final_b_iso=get_b_iso(model_f_array,d_min=resolution) print("Effective b_iso of "+\ "adjusted model map: %6.1f A**2" %(final_b_iso), file=out) model_map_coeffs_normalized=model_f_array.phase_transfer( phase_source=model_phases,deg=True) return model_map_coeffs_normalized
def get_model_map_coeffs_normalized(pdb_inp=None, si=None, f_array=None, overall_b=None, resolution=None, out=sys.stdout): if not pdb_inp: return None # define Wilson B for the model if overall_b is None: overall_b = 10 * resolution print >> out, "Setting Wilson B = %5.1f A based on resolution of %5.1f A" % ( overall_b, resolution) # create model map using same coeffs from cctbx.maptbx.segment_and_split_map import get_f_phases_from_model model_map_coeffs = get_f_phases_from_model(pdb_inp=pdb_inp, f_array=f_array, overall_b=overall_b, k_sol=si.k_sol, b_sol=si.b_sol, out=out) from cctbx.maptbx.segment_and_split_map import map_coeffs_as_fp_phi, get_b_iso model_f_array, model_phases = map_coeffs_as_fp_phi(model_map_coeffs) (d_max, d_min) = f_array.d_max_min() model_f_array.setup_binner(n_bins=si.n_bins, d_max=d_max, d_min=d_min) # Set overall_b.... starting_b_iso = get_b_iso(model_f_array, d_min=resolution) model_f_array=\ model_f_array.apply_debye_waller_factors( b_iso=overall_b-starting_b_iso) final_b_iso = get_b_iso(model_f_array, d_min=resolution) print >>out,"Effective b_iso of initial and "+\ "adjusted model map: %6.1f A**2 %6.1f A**2" %(starting_b_iso,final_b_iso) model_map_coeffs_normalized = model_f_array.phase_transfer( phase_source=model_phases, deg=True) return model_map_coeffs_normalized