rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
elif params.high_resolution is None : raise Sorry("Please specify a high-resolution cutoff.") elif (params.reference_file is not None and params.data_column_label is None) : raise Sorry("Please select a column label to use in the reference "+ "data file.")
elif (params.high_resolution is None) : if (params.reference_file is None) : raise Sorry("Please specify a high-resolution cutoff.") elif (params.reference_file is not None) : if (params.data_column_label is None) : raise Sorry("Please select a column label to use in the reference "+ "data file.") elif ([params.high_re...
def validate_params (params, callback=None) : if len(params.pdb_file) == 0 : raise Sorry("You must provide at least one PDB file to use for "+ "F(model) calculations.") elif params.high_resolution is None : raise Sorry("Please specify a high-resolution cutoff.") elif (params.reference_file is not None and params.data_c...
atom_radii = cctbx.masks.vdw_radii_from_xray_structure(
def compute(self, solvent_radius, shrink_truncation_radius, ignore_hydrogen_atoms=False, crystal_gridding=None, resolution_factor=1/4, atom_radii_table=None, use_space_group_symmetry=False): if crystal_gridding is None: self.crystal_gridding = maptbx.crystal_gridding( unit_cell=self.xray_structure.unit_cell(), space_gr...
self.masked_diff_map = None
def __init__(self, xray_structure, observations): self.xray_structure = xray_structure self.observations = observations self.mask = None self._f_mask = None self.masked_diff_map = None self.f_000 = None self.f_000_s = None self.f_000_cell = None
def structure_factors(self, max_cycles=10, scale_factor=None):
def structure_factors(self, max_cycles=10):
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
if scale_factor is None: self.scale_factor = f_obs.scale_factor(self.f_calc)
self.scale_factor = f_obs.scale_factor(self.f_calc)
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
diff_map = miller.fft_map(self.crystal_gridding, f_obs_minus_f_calc) diff_map.apply_volume_scaling() stats = diff_map.statistics() masked_diff_map = diff_map.real_map_unpadded().set_selected(
self.diff_map = miller.fft_map(self.crystal_gridding, f_obs_minus_f_calc) self.diff_map.apply_volume_scaling() stats = self.diff_map.statistics() masked_diff_map = self.diff_map.real_map_unpadded().set_selected(
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
for i in range(self.n_voids()):
for j in range(self.n_voids()):
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
selection = self.mask.data == i+2 if self.exclude_void_flags[i]:
selection = self.mask.data == j+2 if self.exclude_void_flags[j]:
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
self.exclude_void_flags[i] = True
self.exclude_void_flags[j] = True
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
self.masked_diff_map = masked_diff_map
def structure_factors(self, max_cycles=10, scale_factor=None): """P. van der Sluis and A. L. Spek, Acta Cryst. (1990). A46, 194-201.""" assert self.mask is not None if self.n_voids() == 0: return f_obs = self.observations.as_amplitude_array() self.f_calc = f_obs.structure_factors_from_scatterers( self.xray_structure, a...
diff_map = self.masked_diff_map.deep_copy().set_selected(
diff_map = masked_diff_map.deep_copy().set_selected(
def as_cif_block(self): from iotbx import cif cif_block = cif.model.block() mask_loop = cif.model.loop(header=( "_smtbx_masks_void_nr", "_smtbx_masks_void_average_x", "_smtbx_masks_void_average_y", "_smtbx_masks_void_average_z", "_smtbx_masks_void_volume", "_smtbx_masks_void_count_electrons", "_smtbx_masks_void_content...
if(h in hhh_like_h.keys() and residue_name in hhh_residues):
if(h in hhh_like_h.keys() and residue_name in hhh_residues and h in missing_h):
def run(file_name): print "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" mon_lib_srv = monomer_library.server.server() ener_lib = monomer_library.server.ener_lib() processed = monomer_library.pdb_interpretation.process( mon_lib_srv = mon_lib_srv, ener_lib = ener_lib, file...
"$D/secondary_structure.py",
"$D/secondary_structure/tst.py",
def run(): tst_list = ( "$D/tst_map_type_parser.py", "$D/rsr/tst.py", "$D/polygon/tst.py", "$D/polygon/tst_gui.py", "$D/chemical_components/tst.py", "$D/regression/tst_add_h_to_water.py", "$D/rotamer/rotamer_eval.py", "$D/wwpdb/tst_standard_geometry_cif.py", "$D/tst_pdbtools.py", "$D/real_space/tst.py", "$D/ias/tst_ias...
if ((not only_scope.startswith(full_path)) and (not full_path.startswith(only_scope))) :
if not ((only_scope == full_path) or (only_scope.startswith(full_path + ".")) or (full_path.startswith(only_scope + "."))) :
def delete_phil_objects (current_phil, phil_path_list, only_scope=None) : i = 0 while i < len(current_phil.objects) : full_path = current_phil.objects[i].full_path() if (only_scope is not None) : if ((not only_scope.startswith(full_path)) and (not full_path.startswith(only_scope))) : i += 1 continue if current_phil.obj...
j += 1
else : j += 1
def find_and_replace_scope (current_phil, new_scope, scope_name) : i = 0 while (i < len(current_phil.objects)) : full_path = current_phil.objects[i].full_path() if (full_path == scope_name) : #assert (not current_phil.objects[i].multiple) new_scope.change_primary_parent_scope(current_phil) j = i while (j < len(current_...
elif (scope_name.startswith(full_path)) :
elif (scope_name.startswith(full_path + ".")) :
def find_and_replace_scope (current_phil, new_scope, scope_name) : i = 0 while (i < len(current_phil.objects)) : full_path = current_phil.objects[i].full_path() if (full_path == scope_name) : #assert (not current_phil.objects[i].multiple) new_scope.change_primary_parent_scope(current_phil) j = i while (j < len(current_...
self.patterson_p_value = twin_summary.patterson_p_value
def __init__ (self, params, xtriage_results, data_summary) : self.file_name = params.scaling.input.xray_data.file_name self.log_file = params.scaling.input.parameters.reporting.log self.file_labels = params.scaling.input.xray_data.obs_labels self.nresidues = params.scaling.input.asu_contents.n_residues self.nbases = pa...
self.Bind(wx.EVT_PAINT, lambda evt: self.__DrawButton())
self.Bind(wx.EVT_PAINT, self.OnPaint)
def __init__ (self, parent, id_=wx.ID_ANY, label='', label2='', bmp=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=MB_STYLE_DEFAULT, name=wx.ButtonNameStr, start_color=(218,218,218), gradient_percent=15.0, highlight_color=(230,230,230), label_size=13, caption_size=11, button_margin=2, disable_after_click=0): ...
self._states.append(self.working_phil)
self._states.append(self.working_phil.fetch()) return len(self._states) - 1
def push_state (self) : self._states.append(self.working_phil)
if show_hydrogens:
if show_hydrogen:
def get_kin_lots(chain, bond_hash, i_seq_name_hash, pdbID=None, index=0, show_hydrogen=True): mc_atoms = ["N", "CA", "C", "O", "OXT", "P", "OP1", "OP2", "OP3", "O5'", "C5'", "C4'", "O4'", "C1'", "C3'", "O3'", "C2'", "O2'"] mc_veclist = "" sc_veclist = "" mc_h_veclist = "" sc_h_veclist = "" ca_trace = "" virtual_bb = ""...
params.crystal_symmetry.space_group = symm.space_group()
params.crystal_symmetry.space_group = symm.space_group_info()
def run2 (args, log=sys.stdout, check_params=True) : import iotbx.pdb.fetch parameter_interpreter = libtbx.phil.command_line.argument_interpreter( master_phil=master_phil, home_scope="") pdb_file = None cif_file = None sources = [] for arg in args : if os.path.isfile(arg) : if iotbx.pdb.is_pdb_file(arg) : pdb_files = o...
space_group=params.crystal_symmetry.space_group,
space_group_info=params.crystal_symmetry.space_group,
def run2 (args, log=sys.stdout, check_params=True) : import iotbx.pdb.fetch parameter_interpreter = libtbx.phil.command_line.argument_interpreter( master_phil=master_phil, home_scope="") pdb_file = None cif_file = None sources = [] for arg in args : if os.path.isfile(arg) : if iotbx.pdb.is_pdb_file(arg) : pdb_files = o...
wx.PyControl.__init__(self, parent, id, pos, size, wx.NO_BORDER,
wx.PyControl.__init__(self, parent, id, pos=pos, size=size, style=wx.NO_BORDER,
def __init__ (self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=SEGBTN_DEFAULT_STYLE, name=wx.ButtonNameStr, border=0, pad=_DEFAULT_PADDING) : wx.PyControl.__init__(self, parent, id, pos, size, wx.NO_BORDER, name=name) self.InheritAttributes() self.segments = [] self.values = [] # for radio...
sigma = ((1/restraint.weight)**(.5))*2
sigma = ((1/restraint.weight)**(.5))
def get_angle_outliers(angle_proxies, sites_cart, hierarchy): i_seq_name_hash = build_name_hash(pdb_hierarchy=hierarchy) kin_text = "@subgroup {geom devs} dominant\n" for ap in angle_proxies: restraint = geometry_restraints.angle(sites_cart=sites_cart, proxy=ap) res = i_seq_name_hash[ap.i_seqs[0]][5:] atom1 = i_seq_nam...
sigma = ((1/restraint.weight)**(.5))*2
sigma = ((1/restraint.weight)**(.5))
def get_bond_outliers(bond_proxies, sites_cart, hierarchy): i_seq_name_hash = build_name_hash(pdb_hierarchy=hierarchy) kin_text = "@subgroup {length devs} dominant\n" for bp in bond_proxies.simple: restraint = geometry_restraints.bond(sites_cart=sites_cart, proxy=bp) res = i_seq_name_hash[bp.i_seqs[0]][5:] atom1 = i_se...
{ 2:1 } ])
{ 2:1, } ])
def exercise_a_tr_a(): a = sparse.matrix(6, 3, elements_by_columns = [ { 0: 1, 3:2, 5:3 }, { 1:-1, 3:3, 4:-2 }, { 2:1 } ]) aa = a.as_dense_matrix() b = a.self_transpose_times_self() bb = b.as_dense_matrix() assert bb == aa.matrix_transpose().matrix_multiply(aa)
assert bb == aa.matrix_transpose().matrix_multiply(aa)
assert bb.all_eq(aa.matrix_transpose().matrix_multiply(aa))
def exercise_a_tr_a(): a = sparse.matrix(6, 3, elements_by_columns = [ { 0: 1, 3:2, 5:3 }, { 1:-1, 3:3, 4:-2 }, { 2:1 } ]) aa = a.as_dense_matrix() b = a.self_transpose_times_self() bb = b.as_dense_matrix() assert bb == aa.matrix_transpose().matrix_multiply(aa)
the base pair detction using PROBE even if no nucleic acids are found. \
the base pair detection using PROBE even if no nucleic acids are found. \
def get_helix_class (helix_class) : class_id = int(helix_class) - 1 return helix_classes[class_id]
if labels_base in special_labels and not len(output_labels) == 2 : raise Sorry(("There are too many output labels for the array "+ "%s, which is being converted to non-anomalous data. "+ "Labels such as I,SIGI are appropriate (or F,SIGF if you are "+ "converting the array to amplitudes.") % array_name) elif len(output_...
if (labels_base in special_labels) : if (len(output_labels) != 2) : raise Sorry(("There are too many output labels for the array "+ "%s, which is being converted to non-anomalous data. "+ "Labels such as I,SIGI are appropriate, or F,SIGF if you are "+ "converting the array to amplitudes. (Current output labels: "+ "%s...
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
elif labels_base in special_labels and not len(output_labels) == 4 :
elif (labels_base in special_labels) and (len(output_labels) != 4) :
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
raise Sorry(("The data in %s cannot be merged because it is in "+
raise Sorry(("The data in %s cannot be merged because they are in "+
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
mt = flex.mersenne_twister(seed=0)
def tst_nsd(): mt = flex.mersenne_twister(seed=0) moving1 = flex.vec3_double() moving2 = flex.vec3_double() fixed = flex.vec3_double() max_noise = 0 for ii in range(10): noise = mt.random_double(3)*2-1.0 if noise.norm() > max_noise: max_noise = noise.norm() xyz = mt.random_double(3)*5 fixed.append( list(xyz) ) moving1...
noise = mt.random_double(3)*2-1.0
noise = flex.random_double(3)*2-1.0
def tst_nsd(): mt = flex.mersenne_twister(seed=0) moving1 = flex.vec3_double() moving2 = flex.vec3_double() fixed = flex.vec3_double() max_noise = 0 for ii in range(10): noise = mt.random_double(3)*2-1.0 if noise.norm() > max_noise: max_noise = noise.norm() xyz = mt.random_double(3)*5 fixed.append( list(xyz) ) moving1...
xyz = mt.random_double(3)*5
xyz = flex.random_double(3)*5
def tst_nsd(): mt = flex.mersenne_twister(seed=0) moving1 = flex.vec3_double() moving2 = flex.vec3_double() fixed = flex.vec3_double() max_noise = 0 for ii in range(10): noise = mt.random_double(3)*2-1.0 if noise.norm() > max_noise: max_noise = noise.norm() xyz = mt.random_double(3)*5 fixed.append( list(xyz) ) moving1...
sele_str = ("(%s) and name N and (altloc 'A' or altloc ' ')" %
sele_str = ("(%s) and (name N) and (altloc 'A' or altloc ' ')" %
def restraint_groups_as_pdb_helices (pdb_hierarchy, helices, log=sys.stderr) : isel = pdb_hierarchy.atom_selection_cache().iselection atoms = [ a for a in pdb_hierarchy.atoms_with_labels() ] pdb_helices = [] for i, helix_params in enumerate(helices) : if helix_params.selection is None : print >> log, "Empty helix at se...
alpha_sele = self.alpha_selection(limit="and name N", main_conf_only=True)
alpha_sele = self.alpha_selection(limit="name N", main_conf_only=True)
def calculate_structure_content (self) : isel = self.selection_cache.iselection calpha = isel("name N and (altloc ' ' or altloc 'A')") alpha_sele = self.alpha_selection(limit="and name N", main_conf_only=True) n_alpha = alpha_sele.count(True) beta_sele = self.beta_selection(limit="and name N", main_conf_only=True) n_be...
beta_sele = self.beta_selection(limit="and name N", main_conf_only=True)
beta_sele = self.beta_selection(limit="name N", main_conf_only=True)
def calculate_structure_content (self) : isel = self.selection_cache.iselection calpha = isel("name N and (altloc ' ' or altloc 'A')") alpha_sele = self.alpha_selection(limit="and name N", main_conf_only=True) n_alpha = alpha_sele.count(True) beta_sele = self.beta_selection(limit="and name N", main_conf_only=True) n_be...
match_key = atom+residue_match_map[res_key]
def process_reference_groups(pdb_hierarchy, pdb_hierarchy_ref, params): model_iseq_hash = build_iseq_hash(pdb_hierarchy=pdb_hierarchy) model_name_hash = build_name_hash(pdb_hierarchy=pdb_hierarchy) ref_iseq_hash = build_iseq_hash(pdb_hierarchy=pdb_hierarchy_ref) sel_cache = pdb_hierarchy.atom_selection_cache() sel_cach...
low_density_elimination = low_density_elimination_iterator( f_obs=self.flipping_iterator.f_obs, f_calc=self.flipping_iterator.f_calc, f_000=0, constant_rho_c=self.flipping_iterator.delta)
def _polishing(self): low_density_elimination = low_density_elimination_iterator( f_obs=self.flipping_iterator.f_obs, f_calc=self.flipping_iterator.f_calc, f_000=0, constant_rho_c=self.flipping_iterator.delta) while 1: for i in xrange(self.polishing_iterations): low_density_elimination.next() yield self.evaluating low_...
low_density_elimination.restart(f_calc=self.flipping_iterator.f_calc, f_000=0)
def _polishing(self): low_density_elimination = low_density_elimination_iterator( f_obs=self.flipping_iterator.f_obs, f_calc=self.flipping_iterator.f_calc, f_000=0, constant_rho_c=self.flipping_iterator.delta) while 1: for i in xrange(self.polishing_iterations): low_density_elimination.next() yield self.evaluating low_...
from iotbx import file_reader input_file = file_reader.any_file(file_name)
input_file = self.open_file(file_name)
def save_file (self, input_file=None, file_name=None) : if (input_file is None) : from iotbx import file_reader input_file = file_reader.any_file(file_name) input_file.assert_file_type(self.file_type) file_name = input_file.file_name self._cached_input_files[file_name] = input_file self.add_file_callback(file_name) ret...
if param_file.contains(file_name) : parma_file.remove(file_name)
if (file_name in param_file) : param_file.remove(file_name)
def remove_file (self, file_name) : if (file_name in self._cached_input_files) : self._cached_input_files.pop(file_name) if self.use_md5_sum : self._file_md5sums.pop(file_name) else : self._file_mtimes.pop(file_name) if (self.allowed_param_names is not None) : for param_name, param_file in self._param_files.iteritems()...
from iotbx import file_reader
def get_file (self, file_name=None, file_param_name=None) : from iotbx import file_reader if (file_name is None) and (file_param_name is not None) : file_name = self._param_files.get(file_param_name) if (isinstance(file_name, list)) : return file_name if (file_name is None) : return None assert os.path.isfile(file_name...
input_file = file_reader.any_file(file_name)
input_file = self.open_file(file_name)
def get_file (self, file_name=None, file_param_name=None) : from iotbx import file_reader if (file_name is None) and (file_param_name is not None) : file_name = self._param_files.get(file_param_name) if (isinstance(file_name, list)) : return file_name if (file_name is None) : return None assert os.path.isfile(file_name...
from iotbx import file_reader input_file = file_reader.any_file(file_name)
input_file = self.open_file(file_name)
def set_param_file (self, file_name, file_param_name, input_file=None, run_callback=True) : if self.allowed_param_names is not None : if not file_param_name in self.allowed_param_names : raise KeyError("Unrecognized input file parameter %s."%file_param_name) if (file_name is None) or (file_name == "") or (file_name == ...
def __init__ (self, command, program_id, log=None) :
def __init__ (self, command, program_id, log=None, intercept_output=True) :
def __init__ (self, command, program_id, log=None) : adopt_init_args(self, locals()) if self.log is None : self.log = sys.stdout threading.Thread.__init__(self) self._alive = True
p = subprocess.Popen(args=[self.command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
if self.intercept_output : p = subprocess.Popen(args=[self.command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) else : p = subprocess.Popen(args=[self.command], shell=True)
def run (self) : p = subprocess.Popen(args=[self.command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) while True : if p.poll() is not None : break output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush() self._alive = False
output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush()
if self.intercept_output : output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush()
def run (self) : p = subprocess.Popen(args=[self.command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) while True : if p.poll() is not None : break output = p.stdout.readline() if output is not None and output != "" : self.log.write(output) self.log.flush() self._alive = False
local_port=None, log=None) :
local_port=None, log=None, intercept_output=True) :
def __init__ (self, command, program_id, timeout, cache_requests=False, local_port=None, log=None) : adopt_init_args(self, locals()) self._process = None self._server = None self.initialize_server()
self._process = external_program_thread(command=self.command, program_id=self.program_id, log=self.log)
self._process = external_program_thread( command=self.command, program_id=self.program_id, log=self.log, intercept_output=self.intercept_output)
def initialize_server (self) : if self._process is None and self._server is None : valid_ports = [] for (start, end) in self.port_ranges : valid_ports.extend([ n for n in range(start, end) ]) i = int(random.random() * (len(valid_ports) - 1)) self._port = valid_ports[i] prog_port_env = "CCTBX_%s_PORT" % string.upper(sel...
if 0:
try: from _subprocess import * class STARTUPINFO(object): dwFlags = 0 hStdInput = None hStdOutput = None hStdError = None wShowWindow = 0 class pywintypes(object): error = IOError except ImportError:
def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
else: from _subprocess import * class STARTUPINFO: dwFlags = 0 hStdInput = None hStdOutput = None hStdError = None wShowWindow = 0 class pywintypes: error = IOError
def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
record.extend(run_ksdssp(file_name, log=log))
records.extend(run_ksdssp(file_name, log=log))
def run (args, out=sys.stdout, log=sys.stderr) : pdb_files = [] sources = [] force_new_annotation = False master_phil = libtbx.phil.parse(""" show_histograms = False .type = bool show_pymol_dashes = False .type = bool
verbose=False, **kwds):
verbose=False, fixed_random_seed=True, **kwds):
def exercise(self, xray_structure=None, space_group_info=None, verbose=False, **kwds): assert [xray_structure, space_group_info].count(None) == 1 if xray_structure is None: self.xs = self.random_structure(space_group_info, set_grads=True) else: self.xs = xray_structure self.do_exercise(verbose)
if re.search("[^A-Za-z0-9_\-]", label) :
if invalid_chars.search(label) is not None :
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
"alphanumeric characters (including underscore) or hyphens.")
"alphanumeric characters, underscore, plus and minus signs, or "+ "parentheses.")
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
self._param_files.pop(file_param_name)
self._param_files.pop(file_param_name, None)
def set_param_file (self, file_name, file_param_name, input_file=None, run_callback=True) : if self.allowed_param_names is not None : if not file_param_name in self.allowed_param_names : raise KeyError("Unrecognized input file parameter %s."%file_param_name) if (file_name is None) or (file_name == "") or (file_name == ...
R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor))
R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor()))
def r1_factor(self, cutoff_factor=None): f_obs = self.fo_sq.f_sq_as_f() if cutoff_factor is not None: strong = f_obs.data() > cutoff_factor*f_obs.sigmas() f_obs = f_obs.select(strong) f_calc = self.f_calc.select(strong) else: f_calc = self.f_calc R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor)) r...
["$D/ab_initio/tests/tst_charge_flipping.py", '--fix_seed', '--on=E'],
def run(): tst_list = ( "$D/ab_initio/tests/tst_ab_initio_ext.py", "$D/masks/tests/tst_masks.py", ["$D/ab_initio/tests/tst_charge_flipping.py", '--fix_seed', '--on=E'], "$D/structure_factors/direct/tests/tst_standard_xray.py", "$D/refinement/tests/tst_minimization.py", #"$D/refinement/tests/tst_least_squares.py", "$D/r...
print "Finishing refinement with target weight zero:" print " Number of function evaluations cycle RMSD"
print "Finishing refinement to idealize geometry:" print " number of function" print " weight evaluations cycle RMSD"
def show_completeness(annotation): print "Completeness of %s map coefficients:" % annotation map_coeffs.setup_binner(auto_binning=True) if (map_coeffs.binner().n_bins_used() > 12): map_coeffs.setup_binner(n_bins=12) map_coeffs.completeness(use_binning=True).show(prefix=" ") print sys.stdout.flush()
print " %10d %6.3f" % ( fgm_refined.number_of_function_evaluations, cycle_rmsd)
print " %6.1f %10d %6.3f" % ( rstw, fgm_refined.number_of_function_evaluations, cycle_rmsd)
def show_completeness(annotation): print "Completeness of %s map coefficients:" % annotation map_coeffs.setup_binner(auto_binning=True) if (map_coeffs.binner().n_bins_used() > 12): map_coeffs.setup_binner(n_bins=12) map_coeffs.completeness(use_binning=True).show(prefix=" ") print sys.stdout.flush()
print "After %d refinements with real-space target weight zero:" % (
print "After %d refinements to idealize geometry:" % (
def show_completeness(annotation): print "Completeness of %s map coefficients:" % annotation map_coeffs.setup_binner(auto_binning=True) if (map_coeffs.binner().n_bins_used() > 12): map_coeffs.setup_binner(n_bins=12) map_coeffs.completeness(use_binning=True).show(prefix=" ") print sys.stdout.flush()
self.sigmaa = fmodel.sigmaa().sigmaa()
if hasattr(fmodel, "sigmaa") : try : self.sigmaa = fmodel.sigmaa().sigmaa() except RuntimeError, e : self.sigmaa = None else : self.sigmaa = None
def __init__(self, fmodel, free_reflections_per_bin = 140, max_number_of_bins = 30): mp = fmodel.mask_params self.target_name = fmodel.target_name if(self.target_name == "twin_lsq_f"): self.twin_fraction = fmodel.twin_fraction self.twin_law = fmodel.twin_law else: self.twin_fraction = None self.twin_law = None self.r_w...
sigmaa = fmodel.sigmaa().sigmaa()
def statistics_in_resolution_bins(self, fmodel, free_reflections_per_bin, max_number_of_bins): if(self.target_name == "twin_lsq_f"): return fmodel.statistics_in_resolution_bins() result = [] target_functor = fmodel.target_functor() target_result = target_functor(compute_gradients=False) tpr = target_result.target_per_r...
sigmaa.use_binning_of(fo_t)
if hasattr(fmodel, "sigmaa") : try : sigmaa = fmodel.sigmaa().sigmaa() except RuntimeError, e : sigmaa = None else : sigmaa.use_binning_of(fo_t) else : sigmaa = None
def statistics_in_resolution_bins(self, fmodel, free_reflections_per_bin, max_number_of_bins): if(self.target_name == "twin_lsq_f"): return fmodel.statistics_in_resolution_bins() result = [] target_functor = fmodel.target_functor() target_result = target_functor(compute_gradients=False) tpr = target_result.target_per_r...
sigmaa = flex.mean_default(sigmaa.select(sel_all).data(), None))
sigmaa = sigmaa_bin)
def statistics_in_resolution_bins(self, fmodel, free_reflections_per_bin, max_number_of_bins): if(self.target_name == "twin_lsq_f"): return fmodel.statistics_in_resolution_bins() result = [] target_functor = fmodel.target_functor() target_result = target_functor(compute_gradients=False) tpr = target_result.target_per_r...
for i in iselection: if (i.size() == 0): raise Sorry("No atom selected: %s" % show_string(atom_sel)) for atom in i:
for i, i_sel in enumerate(iselection): if (i_sel.size() == 0): raise Sorry("No atom selected: %s" % show_string(atom_sel[i])) for atom in i_sel:
def phil_atom_selections_as_i_seqs_multiple(self, cache, scope_extract, sel_attrs): result = [] for attr in sel_attrs: iselection = self.phil_atom_selection_multiple( cache=cache, scope_extract=scope_extract, attr=attr, raise_if_empty_selection=False) atom_sel = getattr(scope_extract, attr) for i in iselection: if (i.s...
clean = easy_run.fully_buffered(trim,
clean_out = easy_run.fully_buffered(trim,
def analyze_clashes(self, pdb_io=None, hierarchy=None, keep_hydrogens=False) : if (not libtbx.env.has_module(name="probe")): print "Probe could not be detected on your system. Please make sure Probe is in your path." print "Probe is available at http://kinemage.biochem.duke.edu/" sys.exit() assert [pdb_io, hierarchy]....
build = easy_run.fully_buffered(build, stdin_lines=clean.stdout_lines) input_str = string.join(build.stdout_lines, '\n')
build_out = easy_run.fully_buffered(build, stdin_lines=clean_out.stdout_lines) input_str = string.join(build_out.stdout_lines, '\n')
def analyze_clashes(self, pdb_io=None, hierarchy=None, keep_hydrogens=False) : if (not libtbx.env.has_module(name="probe")): print "Probe could not be detected on your system. Please make sure Probe is in your path." print "Probe is available at http://kinemage.biochem.duke.edu/" sys.exit() assert [pdb_io, hierarchy]....
result = iterable[:]
result = list(iterable)
def sorted(iterable, cmp=None, key=None, reverse=False): """\
selections.extend(sheet.as_atom_selections(params))
try: selections.extend(sheet.as_atom_selections(params)) except RuntimeError, e : pass
def overall_sheet_selection (self, params=ss_input_params) : for sheet in self.sheets : selections.extend(sheet.as_atom_selections(params)) return "(" + ") or (".join(selections) + ")"
os.remove(tmp_file)
def find_sec_str (self, log=sys.stderr) : #tmp_file = ".dssp.%d.pdb" % os.getpid() #open(tmp_file, "w").write(self.pdb_hierarchy.as_pdb_string()) pdb_str = self.pdb_hierarchy.as_pdb_string() (records, stderr) = run_ksdssp_direct(pdb_str) sec_str_from_pdb_file = iotbx.pdb.secondary_structure.process_records( records=rec...
conformer_indices = flex.sites_t(sites_cart.size(), 0)
conformer_indices = flex.size_t(sites_cart.size(), 0)
def build_bond_list ( sites_cart, elements, conformer_indices=None, search_max_distance=None, tolerance_factor_expected_bond_length=1.3, fallback_expected_bond_length=2.0, fallback_search_max_distance=3.0) : assert sites_cart.size() == elements.size() assert (isinstance(tolerance_factor_expected_bond_length, float) or ...
def select_indices(self, indices=None, map_indices_to_asu=False, negate=False):
def select_indices(self, indices, map_indices_to_asu=False, negate=False):
def select_indices(self, indices=None, map_indices_to_asu=False, negate=False): if map_indices_to_asu: indices = indices.deep_copy() # map_to_asu changes indices in place map_to_asu(self.space_group().type(), True, indices) matched_indices = match_indices(self.map_to_asu().indices(), indices) else: matched_indices = ma...
key = ' '+temp[5][0:4]+temp[2]+temp[3]+temp[4]
key = ' '+temp[5][0:3]+temp[2]+temp[3]+temp[4] print key
def run_suitename(self): suite_outliers = [] suitename = "phenix.suitename -report -" backbone_dihedrals = self.get_rna_backbone_dihedrals() suitename_out = easy_run.fully_buffered(suitename, stdin_lines=backbone_dihedrals).stdout_lines for line in suitename_out: if '!!' in line: temp = line.split(":") key = ' '+temp[5...
max_vdw))
max_vdw_dist))
def flags_are_different(): if (flags is None): if (not self._flags_bond_used_for_pair_proxies): return True if (not self._flags_nonbonded_used_for_pair_proxies): return True else: if (self._flags_bond_used_for_pair_proxies != flags.bond): return True if (self._flags_nonbonded_used_for_pair_proxies != flags.nonbonded): ...
master_phil = libtbx.phil.parse("""
master_phil_str = """
def run (args, out=sys.stdout, log=sys.stderr) : pdb_files = [] sources = [] force_new_annotation = False master_phil = libtbx.phil.parse(""" show_all_params = False .type = bool show_histograms = False .type = bool format = *phenix phenix_bonds pymol refmac .type = choice quiet = False .type = bool
%s""" % sec_str_master_phil_str)
%s""" % sec_str_master_phil_str master_phil = libtbx.phil.parse(master_phil_str)
def run (args, out=sys.stdout, log=sys.stderr) : pdb_files = [] sources = [] force_new_annotation = False master_phil = libtbx.phil.parse(""" show_all_params = False .type = bool show_histograms = False .type = bool format = *phenix phenix_bonds pymol refmac .type = choice quiet = False .type = bool
print >> out, "refinement.secondary_structure {"
if (prefix_scope != "") : print >> out, "%s {" % prefix_scope
def run (args, out=sys.stdout, log=sys.stderr) : pdb_files = [] sources = [] force_new_annotation = False master_phil = libtbx.phil.parse(""" show_all_params = False .type = bool show_histograms = False .type = bool format = *phenix phenix_bonds pymol refmac .type = choice quiet = False .type = bool
print >> out, "}"
if (prefix_scope != "") : print >> out, "}"
def run (args, out=sys.stdout, log=sys.stderr) : pdb_files = [] sources = [] force_new_annotation = False master_phil = libtbx.phil.parse(""" show_all_params = False .type = bool show_histograms = False .type = bool format = *phenix phenix_bonds pymol refmac .type = choice quiet = False .type = bool
result = self._pool.map(f, iterable, chunksize)
results = self._pool.map(f, iterable, chunksize)
def map_with_async_callback (self, func, iterable, callback_async, chunksize=None, callback=None) : if self.enable_multiprocessing : if (self.smp_method == "mp") : import multiprocessing manager = multiprocessing.Manager() q = manager.Queue() f = _wrapper_with_queue(func, q) t = thread_utils.queue_monitor_thread(q, cal...
result = self._pool.map(f, new_iterable, chunksize)
results = self._pool.map(f, new_iterable, chunksize)
def map_with_async_callback (self, func, iterable, callback_async, chunksize=None, callback=None) : if self.enable_multiprocessing : if (self.smp_method == "mp") : import multiprocessing manager = multiprocessing.Manager() q = manager.Queue() f = _wrapper_with_queue(func, q) t = thread_utils.queue_monitor_thread(q, cal...
return result
return results
def map_with_async_callback (self, func, iterable, callback_async, chunksize=None, callback=None) : if self.enable_multiprocessing : if (self.smp_method == "mp") : import multiprocessing manager = multiprocessing.Manager() q = manager.Queue() f = _wrapper_with_queue(func, q) t = thread_utils.queue_monitor_thread(q, cal...
q = tardy_model.pack_q()
q_size_each_joint = tardy_model.q_size_each_joint() q_fixed = tardy_model.pack_q()[:q_size_each_joint[0]] assert q_size_each_joint[1:].all_eq(1) q_size_moving = q_size_each_joint.size() - 1
def process(file_name): time_start = time.time() pdb_inp = iotbx.pdb.input(file_name=file_name) pdb_atoms = pdb_inp.atoms() print "Time reading pdb file: %.2f" % (time.time() - time_start) print "Number of atoms:", pdb_atoms.size() pdb_atoms.set_chemical_element_simple_if_necessary() sites_cart = pdb_atoms.extract_xyz(...
print "Number of degrees of freedom:", q.size()
print "Degrees of freedom:", q_size_moving
def process(file_name): time_start = time.time() pdb_inp = iotbx.pdb.input(file_name=file_name) pdb_atoms = pdb_inp.atoms() print "Time reading pdb file: %.2f" % (time.time() - time_start) print "Number of atoms:", pdb_atoms.size() pdb_atoms.set_chemical_element_simple_if_necessary() sites_cart = pdb_atoms.extract_xyz(...
q = mt.random_double(size=q.size())
q = q_fixed.deep_copy() q.extend(mt.random_double(size=q_size_moving)*two_pi)
def process(file_name): time_start = time.time() pdb_inp = iotbx.pdb.input(file_name=file_name) pdb_atoms = pdb_inp.atoms() print "Time reading pdb file: %.2f" % (time.time() - time_start) print "Number of atoms:", pdb_atoms.size() pdb_atoms.set_chemical_element_simple_if_necessary() sites_cart = pdb_atoms.extract_xyz(...
ogsmd.SendMessage(to[0].replace('tel:','') ,msg, props, reply_handler=partial(dbus_sms_ok, x, bus, func_status), error_handler=partial(dbus_gsm_err, to, msg, props, x, bus, win, func_ok, func_err, func_status) )
ogsmd.SendMessage(to[0] ,msg, props, reply_handler=partial(dbus_sms_ok, x, bus, func_status), error_handler=partial(dbus_gsm_err, to, msg, props, x, bus, win, func_ok, func_err, func_status) )
def dbus_opimd_ok(to, msg, props, bus, win, func_ok, func_err, func_status, x): if callable(func_ok): func_ok(x) if callable(func_status): func_status('stored') func_status('sending') try: ogsmd = getDbusObject (bus, "org.freesmartphone.ogsmd", "/org/freesmartphone/GSM/Device", "org.freesmartphone.GSM.SMS") ogsmd.SendM...
print (' g_assert_cmpstr (%s, ==, TP_ERROR_PREFIX "%s");'
print (' g_assert_cmpstr (%s, ==, TP_ERROR_PREFIX ".%s");'
def __call__(self):
return SVNURLSAME;
return (SVNURLSAME);
def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.Clie...
return SVNURLDIFF, locationurl;
return (SVNURLDIFF, locationurl);
def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.Clie...
return SVNWORKINGFOLDERISFILE;
return (SVNWORKINGFOLDERISFILE);
def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.Clie...
return SVNNOWORKINGFOLDER;
return (SVNNOWORKINGFOLDER);
def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.Clie...
return SVNNOBINDING
return (SVNNOBINDING);
def testWorkingFolder(location, url): client = pysvn.Client() try: if path.isdir(location): locationUrl = client.info(location).url; if url==locationUrl: return SVNURLSAME; else: return SVNURLDIFF, locationurl; elif path.exists(location): return SVNWORKINGFOLDERISFILE; else: return SVNNOWORKINGFOLDER; except pysvn.Clie...
if stat.entry is None:
if stat.entry is None and path.isfile(stat.path):
def handleGetProductionView(wfile, request, session): """Service to retrieve all production level information being: production files of the production scenes of the production missing links of the production """ production = indexer.getActiveProduction() result = [] if production is not None: productionId=production[0...
while dirname!=null :
while dirname!=None :
def svnAdd(location, all=False): client = pysvn.Client() dirname, fname = path.split(location) svnAdds = [location] while dirname!=null : if isKnownSVNFile(dirname): if all: client.add(svnAdds.pop()) else: svnAdds.reverse() client.add(svnAdds, recurse=false); return svnAdds.append(dirname) dirname, fname = path.split(d...
client.add(svnAdds, recurse=false);
client.add(svnAdds, recurse=False);
def svnAdd(location, all=False): client = pysvn.Client() dirname, fname = path.split(location) svnAdds = [location] while dirname!=None : if isKnownSVNFile(dirname): if all: client.add(svnAdds.pop()) else: svnAdds.reverse() client.add(svnAdds, recurse=false); return svnAdds.append(dirname) dirname, fname = path.split(d...
if not referenceFile[indexer.INDEX_FILE_LOCATION].startswith(sourceDirectory):
if referenceFile != None and not referenceFile[indexer.INDEX_FILE_LOCATION].startswith(sourceDirectory):
def handleStartMoveDirectory(wfile, request, session): productionId=int(request["production_id"]) production=indexer.getProduction(productionId) sourceDirectory= str(request["source_directory"]) targetDirectory= str(request["target_directory"]) targetAbsoluteDirectory = os.path.join(production[indexer.INDEX_PRODUCTION_...
ac.fileId = referenceFile[indexer.INDEX_FILE_ID]
ac.fileId = file[indexer.INDEX_FILE_ID]
def handleStartMoveDirectory(wfile, request, session): productionId=int(request["production_id"]) production=indexer.getProduction(productionId) sourceDirectory= str(request["source_directory"]) targetDirectory= str(request["target_directory"]) targetAbsoluteDirectory = os.path.join(production[indexer.INDEX_PRODUCTION_...
ac.referenceFileId = file[indexer.INDEX_FILE_ID]
ac.referenceFileId = referenceFile[indexer.INDEX_FILE_ID]
def handleStartMoveDirectory(wfile, request, session): productionId=int(request["production_id"]) production=indexer.getProduction(productionId) sourceDirectory= str(request["source_directory"]) targetDirectory= str(request["target_directory"]) targetAbsoluteDirectory = os.path.join(production[indexer.INDEX_PRODUCTION_...
ac.currentFilename = file[indexer.INDEX_FILE_NAME] ac.currentFileLocation = file[indexer.INDEX_FILE_LOCATION]
ac.currentFilename = referenceFile[indexer.INDEX_FILE_NAME] ac.currentFileLocation = referenceFile[indexer.INDEX_FILE_LOCATION]
def handleStartMoveDirectory(wfile, request, session): productionId=int(request["production_id"]) production=indexer.getProduction(productionId) sourceDirectory= str(request["source_directory"]) targetDirectory= str(request["target_directory"]) targetAbsoluteDirectory = os.path.join(production[indexer.INDEX_PRODUCTION_...