refinement {
  crystal_symmetry {
    unit_cell = None
    space_group = None
  }
  input {
    pdb {
      file_name = hikdo07_molrep1.pdb
    }
    neutron_data {
      ignore_xn_free_r_mismatch = False
      file_name = None
      labels = None
      high_resolution = None
      low_resolution = None
      outliers_rejection = True
      sigma_fobs_rejection_criterion = 0.0
      sigma_iobs_rejection_criterion = 0.0
      ignore_all_zeros = True
      force_anomalous_flag_to_be_equal_to = None
      r_free_flags {
        file_name = None
        label = None
        test_flag_value = None
        disable_suitability_test = False
        ignore_pdb_hexdigest = False
        ignore_r_free_flags = False
        generate = False
        fraction = 0.1
        max_free = 2000
        lattice_symmetry_max_delta = 5
        use_lattice_symmetry = True
      }
    }
    xray_data {
      file_name = hikdo8pp07_0m_mer.mtz
      labels = IMEAN_kdo,SIGIMEAN_kdo
      high_resolution = None
      low_resolution = None
      outliers_rejection = True
      sigma_fobs_rejection_criterion = 0.0
      sigma_iobs_rejection_criterion = 0.0
      ignore_all_zeros = True
      force_anomalous_flag_to_be_equal_to = None
      r_free_flags {
        file_name = None
        label = None
        test_flag_value = None
        disable_suitability_test = False
        ignore_pdb_hexdigest = False
        ignore_r_free_flags = False
        generate = True
        fraction = 0.1
        max_free = 2000
        lattice_symmetry_max_delta = 5
        use_lattice_symmetry = True
      }
    }
    experimental_phases {
      file_name = None
      labels = None
    }
    monomers {
      file_name = None
    }
    symmetry_safety_check = *error warning
  }
  output {
    prefix = detwin
    serial = None
    serial_format = "%02d"
    write_eff_file = True
    write_geo_file = True
    write_def_file = True
    export_final_f_model = mtz cns
    write_maps = False
    write_map_coefficients = True
  }
  electron_density_maps {
    map_format = *xplor
    map_coefficients_format = *mtz phs
    suppress = None
    map {
      mtz_label_amplitudes = None
      mtz_label_phases = None
      likelihood_weighted = None
      obs_factor = None
      calc_factor = None
      kicked = False
      fill_missing_f_obs_with_weighted_f_model = True
    }
    map {
      mtz_label_amplitudes = 2FOFCWT
      mtz_label_phases = PH2FOFCWT
      likelihood_weighted = True
      obs_factor = 2
      calc_factor = 1
      kicked = False
      fill_missing_f_obs_with_weighted_f_model = True
    }
    map {
      mtz_label_amplitudes = FOFCWT
      mtz_label_phases = PHFOFCWT
      likelihood_weighted = True
      obs_factor = 1
      calc_factor = 1
      kicked = False
      fill_missing_f_obs_with_weighted_f_model = False
    }
    map {
      mtz_label_amplitudes = 2FOFCWT_no_fill
      mtz_label_phases = PH2FOFCWT_no_fill
      likelihood_weighted = True
      obs_factor = 2
      calc_factor = 1
      kicked = False
      fill_missing_f_obs_with_weighted_f_model = False
    }
    anomalous_difference_map {
      mtz_label_amplitudes = ANOM
      mtz_label_phases = PHANOM
    }
    reverse_scale = True
    grid_resolution_factor = 1/4
    region = *selection cell
    atom_selection = None
    atom_selection_buffer = 3
    apply_sigma_scaling = True
    apply_volume_scaling = False
  }
  refine {
    strategy = *individual_sites individual_sites_real_space *rigid_body \
               *individual_adp group_adp tls occupancies group_anomalous
    sites {
      individual = None
      torsion_angles = None
      rigid_body = None
    }
    adp {
      individual {
        isotropic = None
        anisotropic = None
      }
      group_adp_refinement_mode = *one_adp_group_per_residue \
                                  two_adp_groups_per_residue group_selection
      group = None
      tls = None
    }
    occupancies {
      individual = None
      remove_selection = None
      constrained_group {
        selection = None
      }
    }
    anomalous_scatterers {
      group {
        selection = None
        f_prime = 0
        f_double_prime = 0
        refine = *f_prime *f_double_prime
      }
    }
  }
  main {
    bulk_solvent_and_scale = True
    fix_rotamers = True
    simulated_annealing = False
    simulated_annealing_torsion = False
    ordered_solvent = False
    ncs = False
    ias = False
    number_of_macro_cycles = 3
    max_number_of_iterations = 25
    use_form_factor_weights = False
    tan_u_iso = False
    use_geometry_restratints = True
    use_convergence_test = False
    target = *ml mlhl ml_sad ls
    min_number_of_test_set_reflections_for_max_likelihood_target = 50
    max_number_of_resolution_bins = 30
    reference_xray_structure = None
    use_experimental_phases = None
    compute_optimal_errors = False
    random_seed = 2679941
    scattering_table = wk1995 it1992 *n_gaussian neutron
    use_normalized_geometry_target = True
    target_weights_only = False
    use_f_model_scaled = False
    max_d_min = 0.25
    fake_f_obs = False
    optimize_mask = False
    occupancy_max = 1.0
    occupancy_min = 0.0
    stir = None
    rigid_bond_test = False
    show_residual_map_peaks_and_holes = False
    fft_vs_direct = False
    outliers_rejection = True
    switch_to_isotropic_high_res_limit = 1.7
    find_and_add_hydrogens = False
  }
  modify_start_model {
    selection = None
    adp {
      atom_selection = None
      randomize = None
      set_b_iso = 20.00
      convert_to_isotropic = None
      convert_to_anisotropic = None
      shift_b_iso = None
      scale_adp = None
    }
    sites {
      atom_selection = None
      shake = None
      max_rotomer_distortion = None
      translate = 0 0 0
      rotate = 0 0 0
      euler_angle_convention = *xyz zyz
    }
    occupancies {
      randomize = None
      set = None
    }
    truncate_to_polyala = None
    output {
      file_name = None
    }
    random_seed = None
  }
  fake_f_obs {
    k_sol = 0.0
    b_sol = 0.0
    b_cart = 0 0 0 0 0 0
    scale = 1.0
    structure_factors_accuracy {
      algorithm = *fft direct
      cos_sin_table = False
      grid_resolution_factor = 1/3.
      quality_factor = None
      u_base = None
      b_base = None
      wing_cutoff = None
      exp_table_one_over_step_size = None
    }
    mask {
      use_asu_masks = True
      solvent_radius = 1.11
      shrink_truncation_radius = 0.9
      grid_step_factor = 4.0
      verbose = 1
      mean_shift_for_mask_update = 0.1
      ignore_zero_occupancy_atoms = True
      ignore_hydrogens = True
    }
    scattering_table = wk1995 it1992 *n_gaussian neutron
    r_free_flags_fraction = None
  }
  hydrogens {
    refine = individual *riding
    contribute_to_f_calc = True
    high_resolution_limit_to_include_scattering_from_h = 1.6
    xh_bond_distance_deviation_limit = 0.0
    build {
      map_type = mFobs-DFmodel
      map_cutoff = 2.0
      angular_step = 3.0
      use_sigma_scaled_maps = True
      resolution_factor = 1./4.
      map_next_to_model {
        min_model_peak_dist = 0.7
        max_model_peak_dist = 1.05
        min_peak_peak_dist = 1.0
        use_hydrogens = False
      }
      max_number_of_peaks = None
      peak_search {
        peak_search_level = 1
        max_peaks = 0
        interpolate = True
        min_distance_sym_equiv = None
        general_positions_only = False
        min_cross_distance = 1.0
        min_cubicle_edge = 5
      }
    }
    local_real_space_fit_angular_step = 0.5
  }
  group_b_iso {
    number_of_macro_cycles = 3
    max_number_of_iterations = 25
    convergence_test = False
    run_finite_differences_test = False
  }
  adp {
    iso {
      max_number_of_iterations = 25
      automatic_randomization_if_all_equal = True
      scaling {
        scale_max = 3.0
        scale_min = 10.0
      }
    }
  }
  tls {
    one_residue_one_group = None
    refine_T = True
    refine_L = True
    refine_S = True
    number_of_macro_cycles = 2
    max_number_of_iterations = 25
    start_tls_value = None
    run_finite_differences_test = False
    eps = 1.e-6
  }
  adp_restraints {
    iso {
      use_u_local_only = False
      sphere_radius = 5.0
      distance_power = 1.69
      average_power = 1.03
      wilson_b_weight_auto = False
      wilson_b_weight = None
      plain_pairs_radius = 5.0
      refine_ap_and_dp = False
    }
  }
  group_occupancy {
    number_of_macro_cycles = 3
    max_number_of_iterations = 25
    convergence_test = False
    run_finite_differences_test = False
  }
  group_anomalous {
    number_of_minimizer_cycles = 3
    lbfgs_max_iterations = 20
    number_of_finite_difference_tests = 0
  }
  rigid_body {
    mode = *first_macro_cycle_only every_macro_cycle
    target = ls_wunit_k1 ml *auto
    target_auto_switch_resolution = 6.0
    refine_rotation = True
    refine_translation = True
    max_iterations = 25
    bulk_solvent_and_scale = True
    euler_angle_convention = *xyz zyz
    lbfgs_line_search_max_function_evaluations = 10
    min_number_of_reflections = 200
    multi_body_factor = 1
    zone_exponent = 3.0
    high_resolution = 3.0
    max_low_high_res_limit = None
    number_of_zones = 5
  }
  ncs {
    find_automatically = True
    coordinate_sigma = None
    b_factor_weight = None
    excessive_distance_limit = 1.5
    special_position_warnings_only = False
    simple_ncs_from_pdb {
      pdb_in = None
      temp_dir = ""
      min_length = 10
      njump = 1
      njump_recursion = 10
      min_length_recursion = 50
      min_percent = 95.
      max_rmsd = 2.
      quick = True
      max_rmsd_user = 3.
      maximize_size_of_groups = False
      ncs_domain_pdb_stem = None
      write_ncs_domain_pdb = False
      domain_finding_parameters {
        find_invariant_domains = True
        initial_rms = 0.5
        match_radius = 2.0
        similarity_threshold = 0.75
        smooth_length = 0
        min_contig_length = 3
        min_fraction_domain = 0.2
        max_rmsd_domain = 2.
      }
      verbose = False
      debug = False
      dry_run = False
    }
    restraint_group {
      reference = None
      selection = None
      coordinate_sigma = 0.05
      b_factor_weight = 10
    }
  }
  modify_f_obs {
    remove = random strong weak strong_and_weak low other
    remove_fraction = 0.1
    fill_mode = fobs_mean_mixed_with_dfmodel random fobs_mean *dfmodel
  }
  pdb_interpretation {
    apply_cif_modification {
      data_mod = None
      residue_selection = None
    }
    apply_cif_link {
      data_link = None
      residue_selection_1 = None
      residue_selection_2 = None
    }
    link_distance_cutoff = 3
    disulfide_distance_cutoff = 3
    dihedral_function_type = *determined_by_sign_of_periodicity \
                             all_sinusoidal all_harmonic
    chir_volume_esd = 0.2
    peptide_link {
      cis_threshold = 45
      discard_psi_phi = True
      omega_esd_override_value = None
    }
    nonbonded_distance_cutoff = None
    default_vdw_distance = 1
    min_vdw_distance = 1
    nonbonded_buffer = 1
    vdw_1_4_factor = 0.8
    translate_cns_dna_rna_residue_names = None
    proceed_with_excessive_length_bonds = False
    rna_sugar_pucker_analysis {
      use = False
      bond_min_distance = 1.2
      bond_max_distance = 1.8
      epsilon_range_not_2p_min = 155
      epsilon_range_not_2p_max = 310
      delta_range_2p_min = 115
      delta_range_2p_max = 180
      p_distance_c1_n_line_2p_max = 2.9
    }
    show_histogram_slots {
      bond_lengths = 5
      nonbonded_interaction_distances = 5
      bond_angle_deviations_from_ideal = 5
      dihedral_angle_deviations_from_ideal = 5
      chiral_volume_deviations_from_ideal = 5
    }
    show_max_items {
      bond_restraints_sorted_by_residual = 5
      nonbonded_interactions_sorted_by_model_distance = 5
      bond_angle_restraints_sorted_by_residual = 5
      dihedral_angle_restraints_sorted_by_residual = 3
      chirality_restraints_sorted_by_residual = 3
      planarity_restraints_sorted_by_residual = 3
    }
    clash_guard {
      nonbonded_distance_threshold = 0.5
      max_number_of_distances_below_threshold = 100
      max_fraction_of_distances_below_threshold = 0.1
    }
  }
  geometry_restraints.edits {
    excessive_bond_distance_limit = 10
    bond {
      action = *add delete change
      atom_selection_1 = None
      atom_selection_2 = None
      symmetry_operation = None
      distance_ideal = None
      sigma = None
      slack = None
    }
    angle {
      action = *add delete change
      atom_selection_1 = None
      atom_selection_2 = None
      atom_selection_3 = None
      angle_ideal = None
      sigma = None
    }
  }
  geometry_restraints.remove {
    angles = None
    dihedrals = None
    chiralities = None
    planarities = None
  }
  ordered_solvent {
    low_resolution = 2.8
    mode = *auto filter_only every_macro_cycle
    n_cycles = 1
    output_residue_name = HOH
    output_chain_id = S
    output_atom_name = O
    scattering_type = O
    primary_map_type = mFobs-DFmodel
    primary_map_cutoff = 3.0
    secondary_map_and_map_cc_filter {
      cc_map_1_type = "Fc"
      cc_map_2_type = 2mFo-DFmodel
      atom_radius = 1.5
      number_of_grid_points = 50
      ignore_points_with_map_values_less_than = 0.3
      set_cc_to_zero_if_n_grid_points_less_than = 10
      poor_cc_threshold = 0.7
      poor_map_value_threshold = 1.0
      crystal_symmetry {
        unit_cell = None
        space_group = None
      }
    }
    h_bond_min_mac = 1.8
    h_bond_min_sol = 1.8
    h_bond_max = 3.2
    new_solvent = *isotropic anisotropic
    refine_adp = True
    b_iso_min = 1.0
    b_iso_max = 80.0
    anisotropy_min = 0.1
    b_iso = None
    refine_occupancies = False
    occupancy_min = 0.1
    occupancy_max = 1.0
    occupancy = 1.0
    filter_at_start = True
    ignore_final_filtering_step = False
    correct_drifted_waters = True
    use_kick_maps = False
    kick_map {
      kick_size = 0.5
      number_of_kicks = 100
    }
  }
  peak_search {
    use_sigma_scaled_maps = True
    resolution_factor = 1./4.
    map_next_to_model {
      min_model_peak_dist = 1.8
      max_model_peak_dist = 6.0
      min_peak_peak_dist = 1.8
      use_hydrogens = False
    }
    max_number_of_peaks = None
    peak_search {
      peak_search_level = 1
      max_peaks = 0
      interpolate = True
      min_distance_sym_equiv = None
      general_positions_only = False
      min_cross_distance = 1.8
      min_cubicle_edge = 5
    }
  }
  bulk_solvent_and_scale {
    bulk_solvent = True
    anisotropic_scaling = True
    k_sol_b_sol_grid_search = True
    minimization_k_sol_b_sol = True
    minimization_b_cart = True
    target = ls_wunit_k1 *ml
    symmetry_constraints_on_b_cart = True
    k_sol_max = 0.6
    k_sol_min = 0.0
    b_sol_max = 150.0
    b_sol_min = 0.0
    k_sol_grid_search_max = 0.6
    k_sol_grid_search_min = 0.0
    b_sol_grid_search_max = 80.0
    b_sol_grid_search_min = 20.0
    k_sol_step = 0.2
    b_sol_step = 20.0
    number_of_macro_cycles = 2
    max_iterations = 25
    min_iterations = 25
    fix_k_sol = None
    fix_b_sol = None
    fix_b_cart {
      b11 = None
      b22 = None
      b33 = None
      b12 = None
      b13 = None
      b23 = None
    }
    apply_back_trace_of_b_cart = False
    verbose = -1
    ignore_bulk_solvent_and_scale_failure = False
  }
  alpha_beta {
    free_reflections_per_bin = 140
    number_of_macromolecule_atoms_absent = 225
    n_atoms_included = 0
    bf_atoms_absent = 15.0
    final_error = 0.0
    absent_atom_type = "O"
    method = *est calc
    estimation_algorithm = *analytical iterative
    verbose = -1
    interpolation = True
    fix_scale_for_calc_option = None
    number_of_waters_absent = 613
    sigmaa_estimator {
      kernel_width_free_reflections = 100
      kernel_on_chebyshev_nodes = True
      number_of_sampling_points = 20
      number_of_chebyshev_terms = 10
      use_sampling_sum_weights = True
    }
  }
  mask {
    use_asu_masks = True
    solvent_radius = 1.11
    shrink_truncation_radius = 0.9
    grid_step_factor = 4.0
    verbose = 1
    mean_shift_for_mask_update = 0.1
    ignore_zero_occupancy_atoms = True
    ignore_hydrogens = True
  }
  tardy {
    mode = every_macro_cycle *second_and_before_last once first first_half
    xray_weight_factor = 10
    start_temperature_kelvin = 2500
    final_temperature_kelvin = 300
    velocity_scaling = True
    temperature_cap_factor = 1.5
    excessive_temperature_factor = 5
    number_of_cooling_steps = 500
    number_of_time_steps = 1
    time_step_pico_seconds = 0.001
    temperature_degrees_of_freedom = *cartesian constrained
    minimization_max_iterations = 0
    nonbonded_attenuation_factor = 0.75
    omit_bonds_with_slack_greater_than = 0
    constrain_dihedrals_with_sigma_less_than = 10
    near_singular_hinges_angular_tolerance_deg = 5
  }
  cartesian_dynamics {
    temperature = 300
    number_of_steps = 200
    time_step = 0.0005
    initial_velocities_zero_fraction = 0
    n_print = 100
    verbose = -1
  }
  simulated_annealing {
    start_temperature = 5000
    final_temperature = 300
    cool_rate = 100
    number_of_steps = 50
    time_step = 0.0005
    initial_velocities_zero_fraction = 0
    interleaved_minimization {
      number_of_iterations = 0
      time_step_factor = 10
      restraints = *bonds *angles
    }
    n_print = 100
    update_grads_shift = 0.3
    refine_sites = True
    refine_adp = False
    max_number_of_iterations = 25
    mode = every_macro_cycle *second_and_before_last once first first_half
    verbose = -1
  }
  target_weights {
    mode = *automatic every_macro_cycle
    wxc_scale = 0.5
    wxu_scale = 1.0
    wc = 1.0
    wu = 1.0
    fix_wxc = None
    fix_wxu = None
    optimize_wxc = False
    bonds_rmsd_max = 0.05
    angles_rmsd_max = 3.5
    optimize_wxu = False
    shake_sites = True
    shake_adp = 10.0
    regularize_ncycles = 50
    verbose = 1
    wnc_scale = 0.5
    wnu_scale = 1.0
    rmsd_cutoff_for_gradient_filtering = 3.0
  }
  ias {
    b_iso_max = 100.0
    occupancy_min = -1.0
    occupancy_max = 1.5
    ias_b_iso_max = 100.0
    ias_b_iso_min = 0.0
    ias_occupancy_min = 0.01
    ias_occupancy_max = 3.0
    initial_ias_occupancy = 1.0
    build_ias_types = L R B BH
    use_map = True
    build_only = False
    file_prefix = None
    peak_search_map {
      map_type = *Fobs-Fmodel mFobs-DFmodel
      grid_step = 0.25
      scaling = *volume sigma
    }
  }
  ls_target_names {
    target_name = *ls_wunit_k1 ls_wunit_k2 ls_wunit_kunit ls_wunit_k1_fixed \
                  ls_wunit_k1ask3_fixed ls_wexp_k1 ls_wexp_k2 ls_wexp_kunit \
                  ls_wff_k1 ls_wff_k2 ls_wff_kunit ls_wff_k1_fixed \
                  ls_wff_k1ask3_fixed lsm_kunit lsm_k1 lsm_k2 lsm_k1_fixed \
                  lsm_k1ask3_fixed
  }
  twinning {
    twin_law = -k,-h,-l
    twin_target = *twin_lsq_f
    detwin {
      mode = algebraic proportional *auto
      map_types {
        twofofc = *two_m_dtfo_d_fc two_dtfo_fc
        fofc = *m_dtfo_d_fc gradient m_gradient
        aniso_correct = False
      }
    }
  }
  structure_factors_and_gradients_accuracy {
    algorithm = *fft direct
    cos_sin_table = False
    grid_resolution_factor = 1/3.
    quality_factor = None
    u_base = None
    b_base = None
    wing_cutoff = None
    exp_table_one_over_step_size = None
  }
  r_free_flags {
    fraction = 0.1
    max_free = 2000
    lattice_symmetry_max_delta = 5.0
    use_lattice_symmetry = True
  }
  real_space_refinement {
    mode = simple *diff_map
    target_map_name = 2mFo-DFc
    model_map_name = Fc
    grid_resolution_factor = 1./4
    target_weights = value grid_search *gradients_ratio
    real_space_target_weight = None
    restraints_target_weight = None
    number_of_cycles = 1
    rmsd_max_bonds = 0.07
    rmsd_max_angles = 5.0
    grid_search_scales = 0.25 0.5 0.75 1.0 1.25 1.5 1.75
    verbose = 1
  }
  gui {
    add_hydrogens = False
  }
}

