本文整理匯總了Python中xia2.Handlers.Flags.Flags.get_rmerge_target方法的典型用法代碼示例。如果您正苦於以下問題:Python Flags.get_rmerge_target方法的具體用法?Python Flags.get_rmerge_target怎麽用?Python Flags.get_rmerge_target使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xia2.Handlers.Flags.Flags
的用法示例。
在下文中一共展示了Flags.get_rmerge_target方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _determine_best_scale_model_8way
# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_rmerge_target [as 別名]
def _determine_best_scale_model_8way(self):
'''Determine the best set of corrections to apply to the data,
testing all eight permutations.'''
# if we have already defined the best scaling model just return
if self._scalr_corrections:
return
# or see if we set one on the command line...
if Flags.get_scale_model():
self._scalr_correct_absorption = Flags.get_scale_model_absorption()
self._scalr_correct_partiality = Flags.get_scale_model_partiality()
self._scalr_correct_decay = Flags.get_scale_model_decay()
self._scalr_corrections = True
return
Debug.write('Optimising scaling corrections...')
rmerge_def = self._assess_scaling_model(
tails = False, bfactor = False, secondary = False)
results = { }
consider = []
log_results = []
for partiality in True, False:
for decay in True, False:
for absorption in True, False:
if partiality or decay or absorption:
r = self._assess_scaling_model(
tails = partiality, bfactor = decay,
secondary = absorption)
else:
r = rmerge_def
results[(partiality, decay, absorption)] = r
log_results.append((partiality, decay, absorption, r))
consider.append(
(r, partiality, decay, absorption))
Debug.write('. Tails Decay Abs R(%s)' % \
Flags.get_rmerge_target())
for result in log_results:
Debug.write('. %5s %5s %5s %.3f' % result)
consider.sort()
rmerge, partiality, decay, absorption = consider[0]
if absorption:
Debug.write('Absorption correction: on')
else:
Debug.write('Absorption correction: off')
if partiality:
Debug.write('Partiality correction: on')
else:
Debug.write('Partiality correction: off')
if decay:
Debug.write('Decay correction: on')
else:
Debug.write('Decay correction: off')
self._scalr_correct_absorption = absorption
self._scalr_correct_partiality = partiality
self._scalr_correct_decay = decay
self._scalr_corrections = True
return
示例2: _assess_scaling_model
# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_rmerge_target [as 別名]
def _assess_scaling_model(self, tails, bfactor, secondary):
epochs = self._sweep_handler.get_epochs()
sc_tst = self._updated_aimless()
sc_tst.set_cycles(5)
sc_tst.set_hklin(self._prepared_reflections)
sc.set_intensities(PhilIndex.params.ccp4.aimless.intensities)
sc_tst.set_hklout('temp.mtz')
sc_tst.set_tails(tails = tails)
sc_tst.set_bfactor(bfactor = bfactor)
resolutions = self._resolution_limit_estimates
if secondary:
sc_tst.set_scaling_parameters(
'rotation', secondary = Flags.get_aimless_secondary())
else:
sc_tst.set_scaling_parameters('rotation', secondary = 0)
for epoch in epochs:
si = self._sweep_handler.get_sweep_information(epoch)
start, end = si.get_batch_range()
resolution = resolutions[(start, end)]
pname, xname, dname = si.get_project_info()
sname = si.get_sweep_name()
sc_tst.add_run(start, end, exclude = False,
resolution = resolution, name = sname)
if self.get_scaler_anomalous():
sc_tst.set_anomalous()
if True:
# try:
sc_tst.scale()
else:
# except RuntimeError, e:
if 'scaling not converged' in str(e):
return -1, -1
if 'negative scales' in str(e):
return -1, -1
raise e
data_tst = sc_tst.get_summary()
# compute average Rmerge, number of cycles to converge - these are
# what will form the basis of the comparison
target = {'overall':0, 'low':1, 'high':2}
rmerges_tst = [data_tst[k]['Rmerge'][target[
Flags.get_rmerge_target()]] for k in data_tst]
rmerge_tst = sum(rmerges_tst) / len(rmerges_tst)
return rmerge_tst