def METHOD_NAME():
  # Read and process PDB file
  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      = None,
    raw_records    = pdb_str,
    force_symmetry = True)
  pdb_hierarchy = processed_pdb_file.all_chain_proxies.pdb_hierarchy
  xray_structure = processed_pdb_file.xray_structure()
  #
  xrs_dc = xray_structure.deep_copy_scatterers()
  pdb_hierarchy.write_pdb_file(
    file_name        = "start.pdb",
    crystal_symmetry = xray_structure.crystal_symmetry())
  # Create grm
  geometry_restraints = processed_pdb_file.geometry_restraints_manager(
    show_energies = False)
  states = mmtbx.utils.states(
    xray_structure = xray_structure,
    pdb_hierarchy  = pdb_hierarchy)
  states.add(sites_cart = xray_structure.sites_cart())
  # shake coordinates
  xray_structure.shake_sites_in_place(rms_difference=5.0)
  pdb_hierarchy.adopt_xray_structure(xray_structure)
  pdb_hierarchy.write_pdb_file(
    file_name        = "distorted.pdb",
    crystal_symmetry = xray_structure.crystal_symmetry())
  states.add(sites_cart = xray_structure.sites_cart())
  #
  xray_structure.scatterers().flags_set_grads(state=False)
  xray_structure.scatterers().flags_set_grad_site(
    iselection = xray_structure.all_selection().iselection())
  minimized = lbfgs(
    xray_structure      = xray_structure,
    states              = states,
    geometry_restraints = geometry_restraints,
    verbose             = 0)
  minimized.states.write(
    file_name        = "minimized_all_states.pdb",
    crystal_symmetry = xray_structure.crystal_symmetry())
  pdb_hierarchy.adopt_xray_structure(minimized.xray_structure)
  pdb_hierarchy.write_pdb_file(
    file_name        = "minimized.pdb",
    crystal_symmetry = xray_structure.crystal_symmetry())