mmtbx.twinning package

Submodules

mmtbx.twinning.probabalistic_detwinning module

class mmtbx.twinning.probabalistic_detwinning.detwin(i1, s1, i2, s2, alpha, eps=1e-13)

Bases: object

compute_functional_and_gradients(h=1e-08)
d_log_p(xm, ym)
log_p(xm, ym)
snd(xm, ym)
mmtbx.twinning.probabalistic_detwinning.detwin_miller_array(miller_obs, twin_law, twin_fraction)
mmtbx.twinning.probabalistic_detwinning.run()
mmtbx.twinning.probabalistic_detwinning.test_detwin()

mmtbx.twinning.twin_f_model module

mmtbx.twinning.twin_f_model.get_initial_scale(miller_obs, f_atoms)
mmtbx.twinning.twin_f_model.kb_range(x_max, x_min, step)
mmtbx.twinning.twin_f_model.ls_ff_weights(f_obs, atom, B)
mmtbx.twinning.twin_f_model.ls_sigma_weights(f_obs)
mmtbx.twinning.twin_f_model.n_as_s(format, value)
class mmtbx.twinning.twin_f_model.resolution_bin(i_bin=None, d_range=None, completeness=None, alpha_work=None, beta_work=None, r_work=None, r_free=None, target_work=None, target_free=None, n_work=None, n_free=None, mean_f_obs=None, fom_work=None, scale_k1_work=None, pher_work=None, pher_free=None, cc_work=None, cc_free=None)

Bases: object

class mmtbx.twinning.twin_f_model.scaling_parameter_mask(twin_fraction=True, k_overall=True, u_star=True, k_sol=True, u_sol=True)

Bases: object

class mmtbx.twinning.twin_f_model.scaling_parameters_object(xs=None, k_overall=1.0, u_star=(0, 0, 0, 0, 0, 0), k_sol=0, u_sol=0, k_part=0, u_part=0, object=None, max_u_sol=5.0, max_u_part=5.0)

Bases: object

Object holds a set of parameters needed for f model. provides tranformations for parameter optimisation

d_t_d_k_overall_ref(dtdp)
d_t_d_k_part_ref(dtdp)
d_t_d_k_sol_ref(dtdp)
d_t_d_u_part_ref(dtdp)
d_t_d_u_sol_ref(dtdp)
d_t_d_u_star_ref(dtdp)
deep_copy()
k_overall_to_ref()
k_part_to_ref()
k_sol_to_ref()
ref_to_k_overall(x)
ref_to_k_part(x)
ref_to_k_sol(x)
ref_to_u_part(x)
ref_to_u_sol(x)
ref_to_u_star(x)
show(out=None)
u_part_to_ref()
u_sol_to_ref()
u_star_to_ref()
class mmtbx.twinning.twin_f_model.target_attributes

Bases: target_attributes

class mmtbx.twinning.twin_f_model.target_functor(manager)

Bases: object

prepare_for_minimization()
target_function_is_invariant_under_allowed_origin_shifts()
class mmtbx.twinning.twin_f_model.target_result(manager)

Bases: target_result_mixin

d_target_d_f_calc_work()
d_target_d_f_model_work()
target_test()
target_work()
class mmtbx.twinning.twin_f_model.twin_fraction_object(twin_fraction=0)

Bases: object

provides methods for derivatives and transformastion of twin fraction

d_t_d_twin_fraction_ref(dtdp)
ref_to_twin_fraction(x)
show(out=None)
twin_fraction_to_ref()
class mmtbx.twinning.twin_f_model.twin_model_manager(f_obs=None, f_mask=None, f_calc=None, r_free_flags=None, xray_structure=None, scaling_parameters=None, sf_and_grads_accuracy_params=<libtbx.phil.scope_extract object>, mask_params=None, out=None, twin_law=None, twin_law_str=None, start_fraction=0.1, n_refl_bin=2000, max_bins=20, detwin_mode=None, map_types=None, twin_target='twin_lsq_f', data_type=None, origin=None)

Bases: manager_mixin

alpha_beta(external_sigmaa_object=None)
alpha_beta_f(external_sigmaa_object=None, only_if_required_by_target=False)
alpha_beta_w(external_sigmaa_object=None, only_if_required_by_target=False)
anomalous_map(**kwds)
apply_back_b_iso()
b_cart()
b_iso()
b_part()
b_sol()
bulk_solvent_mask()
compute_f_atoms()

Get f calc from the xray structure

compute_map_coefficients(map_type=None, k=None, n=None, w1=None, w2=None, isotropize=None, ncs_average=None)
construct_miller_set(return_free_f_atoms_array=False, external_miller_array=None)
data_type()
deep_copy()
determine_n_bins(free_reflections_per_bin, max_n_bins=None, min_n_bins=1, min_refl_per_bin=100)
detwin_data(mode=None)
electron_density_map(k=1, n=1, w1=None, w2=None, resolution_factor=0.3333333333333333, fill_missing_f_obs=True, symmetry_flags=None, fill_mode=None, reverse_scale=True)
explain_members(out=None, prefix='', suffix='')
export(out=None, format='mtz')
export_f_obs_flags_as_mtz(file_name, merge_anomalous=False, include_hendrickson_lattman=True)

Dump all input data to an MTZ file using standard column labels. This may be useful when running modules or programs that require an MTZ file as input (rather than taking f_model.manager or the Miller arrays directly).

f_bulk()
f_bulk_t()
f_bulk_w()
f_calc()
f_calc_t()
f_calc_w()
f_mask()
f_mask_t()
f_mask_w()
f_model()
f_model_scaled_with_k1_composite_work_free()
f_model_t()
f_model_w()
f_obs()
f_obs_work()
f_part1()
fb_bulk()
fb_bulk_t()
fb_bulk_w()
fft_vs_direct(reflections_per_bin=250, n_bins=0, out=None)
figures_of_merit()
figures_of_merit_t()
figures_of_merit_work()
fofc_map(**kwds)
hl_coeffs()
info(free_reflections_per_bin=140, max_number_of_bins=20, n_bins=None)
is_twin_fmodel_manager()
k_part()
k_sol()
k_sol_b_sol()
k_sol_u_sol()
k_sols()
map_coefficients(**kwds)
model_error_ml()
origin()
outlier_selection(show=False, log=None)
phase_errors()
phase_errors_test()
phase_errors_work()
print_diffs()
r_all()
r_factors_in_resolution_bins(free_reflections_per_bin=140, max_number_of_bins=20, out=None)
r_free(d_min=None, d_max=None)
r_free_flags()
r_overall_low_high(d=6.0, show=False)
r_values(table=True, rows=False, d_min=None, d_max=None, again=False, free_reflections_per_bin=140, max_number_of_bins=20)
r_work(d_min=None, d_max=None)
r_work_in_lowest_resolution_bin(reflections_per_bin=200, show=False)
r_work_scale_k1_completeness_in_bins(reflections_per_bin=500, n_bins=0, prefix='', out=None)
remove_outliers(show=False, log=None)
resolution_filter(d_max=None, d_min=None)
scale_k1()
scale_k1_t()
scale_k1_w()
scale_k3_t()
scale_k3_w()
select(selection)
set_pseudo_ml_weights()
show(log=None, suffix=None, show_header=False)
show_comprehensive(header='', free_reflections_per_bin=140, max_number_of_bins=20, out=None)
show_essential(header=None, out=None)
show_fom_phase_error_alpha_beta_in_bins(free_reflections_per_bin=140, max_number_of_bins=20, out=None)
show_k_sol_b_sol_b_cart_target(header=None, target=None, out=None)
show_parameter_summary(manager=None)
show_targets(out=None, text='')
sigmaa_object(detwinned_data=None, f_model_data=None, tmp_free=None, forced_update=False)
statistics_in_resolution_bins(free_reflections_per_bin=140, max_number_of_bins=20, out=None)
target(print_it=True)
target_attributes()
target_f()
target_functor(alpha_beta=None)
twin_fraction_scan(n=10)

for each twin fraction, compute the target value and r value

twin_test()
two_fofc_map(**kwds)
u_cart()
u_iso()
u_iso_as_u_cart()
u_sol()
u_star()
update(f_calc=None, f_obs=None, f_mask=None, f_ordered_solvent=None, r_free_flags=None, b_cart=None, k_sol=None, b_sol=None, sf_and_grads_accuracy_params=None, target_name=None, abcd=None, alpha_beta_params=None, xray_structure=None, mask_params=None, overall_scale=None, twin_fraction=None)
update_all_scales(params=None, log=None, show=False, optimize_mask=False, nproc=None, fast=False, remove_outliers=False, refine_hd_scattering=False, apply_back_trace=False, update_f_part1=False)
update_core(f_calc=None, f_mask=None, f_part=None, b_cart=None, k_sol=None, b_sol=None, k_part=None, b_part=None, u_sol=None, k_overall=None, twin_fraction=None, r_free_flags=None)
update_f_hydrogens(log)
update_f_mask()
update_solvent_and_scale(update_f_part1=False, apply_back_trace=False, optimize_mask=True, optimize_mask_thorough=False, params=None, log=None, verbose=-1, initialise=False, nproc=None, fast=None)
update_xray_structure(xray_structure=None, update_f_calc=False, update_f_mask=False, update_f_ordered_solvent=False, force_update_f_mask=True, out=None, k_sol=None, b_sol=None, b_cart=None)
w_star()
wilson_b(force_update=False)

mmtbx.twinning.twin_map_utils module

Module contents