def __init__ (self, fmodel, pdb_hierarchy, params=None, processed_pdb_file=None, geometry_restraints_manager=None, cif_objects=(), cif_files=(), # XXX bug debug=None, verbose=True, out=sys.stdout) : adopt_init_args(self, locals()) if (self.params is None) : self.params = master_phil.extract().alt_confs self.extract_selection() self.refine_cycle = 1 self.map_file = None self.r_work_start = fmodel.r_work() self.r_free_start = fmodel.r_free() t_start = time.time() for i_cycle in range(params.macro_cycles) : n_alts = self.build_residue_conformers(stop_if_none=(i_cycle==0)) if (n_alts == 0) : if (i_cycle == 0) : raise Sorry("No alternate conformations found.") else : self.refine(constrain_occupancies=False) refine_again = self.params.refinement.constrain_correlated_occupancies if (self.rejoin()) : refine_again = True self.refine(title="Refining final model") make_header("Finished", out=out) from mmtbx.validation import molprobity validation = molprobity.molprobity( pdb_hierarchy=self.pdb_hierarchy, outliers_only=False) print >> self.out, "" validation.show_summary(out=self.out, prefix=" ") make_sub_header("Analyzing final model", out=out) analyze_model.process_pdb_hierarchy( pdb_hierarchy=self.pdb_hierarchy, validation=validation, log=self.out).show(out=out, verbose=self.verbose) print >> self.out, "" print >> self.out, "Start: r_work=%6.4f r_free=%6.4f" % \ (self.r_work_start, self.r_free_start) print >> self.out, "Final: r_work=%6.4f r_free=%6.4f" % \ (self.fmodel.r_work(), self.fmodel.r_free()) t_end = time.time() print >> self.out, "" print >> self.out, "Total runtime: %d s" % int(t_end - t_start) print >> self.out, ""
def analyze_fragment(pdb_str): pdb_in = iotbx.pdb.hierarchy.input(pdb_string=pdb_str) model = mmtbx.model.manager(pdb_in.input) validation = molprobity.molprobity(model, outliers_only=False) result = analyze_model.process_pdb_hierarchy( pdb_hierarchy=model.get_hierarchy(), validation=validation, log=null_out()) return result
def analyze_fragment(pdb_str): pdb_in = iotbx.pdb.hierarchy.input(pdb_string=pdb_str) hierarchy = pdb_in.hierarchy validation = molprobity.molprobity(pdb_hierarchy=hierarchy, outliers_only=False) result = analyze_model.process_pdb_hierarchy(pdb_hierarchy=hierarchy, validation=validation, log=null_out()) return result
def analyze_fragment (pdb_str) : pdb_in = iotbx.pdb.hierarchy.input(pdb_string=pdb_str) hierarchy = pdb_in.hierarchy validation = molprobity.molprobity(pdb_hierarchy=hierarchy, outliers_only=False) result = analyze_model.process_pdb_hierarchy( pdb_hierarchy=hierarchy, validation=validation, log=null_out()) return result
def run(args, out=sys.stdout): from mmtbx.disorder import analyze_model import mmtbx.validation.molprobity import mmtbx.command_line cmdline = mmtbx.command_line.load_model_and_data( args=args, master_phil=master_phil(), require_data=False, create_fmodel=True, process_pdb_file=True, usage_string="mmtbx.analyze_static_disorder model.pdb", out=out) hierarchy = cmdline.pdb_hierarchy params = cmdline.params validation = mmtbx.validation.molprobity.molprobity( pdb_hierarchy=hierarchy, xray_structure=cmdline.xray_structure, fmodel=cmdline.fmodel, crystal_symmetry=cmdline.crystal_symmetry, geometry_restraints_manager=cmdline.geometry, header_info=None, keep_hydrogens=False, outliers_only=False, nuclear=False) segments = [] make_header("Analyzing model", out=out) if (params.ignore_inconsistent_occupancy): print("Discontinuous occupancies will be ignored.", file=out) process = analyze_model.process_pdb_hierarchy( pdb_hierarchy=hierarchy, validation=validation, ignore_inconsistent_occupancy=params.ignore_inconsistent_occupancy, log=out) make_sub_header("MolProbity validation", out=out) validation.show_summary(out=out) make_sub_header("Disorder analysis", out=out) if (process.n_disordered == 0): print("No alternate conformations found.", file=out) else: process.show(out=out, verbose=params.verbose) if (params.pickle): file_name = os.path.basename( os.path.splitext(params.input.pdb.file_name[0])[0]) + ".pkl" easy_pickle.dump(file_name, process) return process
def run (args, out=sys.stdout) : from mmtbx.disorder import analyze_model import mmtbx.validation.molprobity import mmtbx.command_line cmdline = mmtbx.command_line.load_model_and_data( args=args, master_phil=master_phil(), require_data=False, create_fmodel=True, process_pdb_file=True, usage_string="mmtbx.analyze_static_disorder model.pdb", out=out) hierarchy = cmdline.pdb_hierarchy params = cmdline.params validation = mmtbx.validation.molprobity.molprobity( pdb_hierarchy=hierarchy, xray_structure=cmdline.xray_structure, fmodel=cmdline.fmodel, crystal_symmetry=cmdline.crystal_symmetry, geometry_restraints_manager=cmdline.geometry, header_info=None, keep_hydrogens=False, outliers_only=False, nuclear=False) segments = [] make_header("Analyzing model", out=out) if (params.ignore_inconsistent_occupancy) : print >> out, "Discontinuous occupancies will be ignored." process = analyze_model.process_pdb_hierarchy( pdb_hierarchy=hierarchy, validation=validation, ignore_inconsistent_occupancy=params.ignore_inconsistent_occupancy, log=out) make_sub_header("MolProbity validation", out=out) validation.show_summary(out=out) make_sub_header("Disorder analysis", out=out) if (process.n_disordered == 0) : print >> out, "No alternate conformations found." else : process.show(out=out, verbose=params.verbose) if (params.pickle) : file_name = os.path.basename( os.path.splitext(params.input.pdb.file_name[0])[0]) + ".pkl" easy_pickle.dump(file_name, process) return process