Shows how to locally refine a fit of a protein inside its density using a MC/CG optimization protocol. This example does not necessarily converge to the global minimum as that may require more optimization steps. If one wishes to use this example as a template for real refinement purposes, please adjust the parameters of the function IMP.em.local_rigid_fitting accordingly.
   38 dmap = IMP.em.read_map(
 
   40 dmap.get_header_writable().set_resolution(resolution)
 
   49 sampled_input_density.set_particles(ps)
 
   50 sampled_input_density.resample()
 
   51 sampled_input_density.calcRMS()
 
   55     dmap, sampled_input_density, sampled_input_density.get_header().dmin)
 
   56 print(
"The CC score of the native transformation is:", best_score)
 
   63     IMP.algebra.get_unit_bounding_box_3d())
 
   65 rand_angle = random.uniform(-70. / 180 * math.pi, 70. / 180 * math.pi)
 
   81 sampled_input_density.resample()
 
   82 sampled_input_density.calcRMS()
 
   85     dmap, sampled_input_density, sampled_input_density.get_header().dmin)
 
   87 print(
"The start score is:", start_score, 
"with rmsd of:", start_rmsd)
 
   90 print(
"performing local refinement, may run for 3-4 minutes")
 
   98 sampled_input_density.resample()
 
   99 sampled_input_density.calcRMS()
 
  102     dmap, sampled_input_density, sampled_input_density.get_header().dmin)
 
  103 print(
"The score after centering is:", score2, 
"with rmsd of:", rmsd)
 
  107     mh.get_particle(), refiner,
 
  113 print(
"The start score is:", start_score, 
"with rmsd of:", start_rmsd)
 
  114 for i 
in range(fitting_sols.get_number_of_solutions()):
 
  121     print(
"Fit with index:", i, 
" with cc: ", 1. - fitting_sols.get_score(i),
 
  122           " and rmsd to native of:", rmsd)
 
  125         prot_rb, fitting_sols.get_transformation(i).get_inverse())