def run_build(self): # callback for the "Build" button cmd.cache("clear") cmd.reset() seconds_init = time.time() self.runNumber += 1 # get form data prefixName = self.form.output_filename_prefix.text() assemblyType = self.form.input_type.currentText() print('Assembly is: {}'.format(assemblyType)) print('Building model...') # center protein if needed self.preOriProt() # delete old model cmd.delete(self.modelName) # executions depends on the assembly type if assemblyType == "detergent": # execute detergent builder self.modelName = builderDetergent(self.protName, self.membName, prefixName, self.runNumber) elif assemblyType == "salipro": # execute salipro builder rotAng = self.form.input_rotAng.value() numScaffoldCopies = self.form.input_copies.value() print('Number of scaffold copies: {}'.format(numScaffoldCopies)) if self.buildMemb: self.membName = builderMembrane(self.membName) self.form.input_filename_lip.setText(self.membName) self.modelName = builderSalipro(self.protName, self.scafName, self.membName, prefixName, self.runNumber, numScaffoldCopies, rotAng) elif assemblyType == "nanodisc": # execute nanodisc builder # build bilayer if check box is activated if self.buildMemb: self.membName = builderMembrane(self.membName) self.form.input_filename_lip.setText(self.membName) # execute builder self.modelName = builderNanodisc(self.protName, self.membName, self.scafName, prefixName, self.runNumber) elif assemblyType == "bilayer": # execute detergent builder self.membName = builderMembrane(self.membName, self.runNumber) self.form.input_filename_lip.setText(self.membName) elif assemblyType == "bicelle": # execute bicelle builder # build bilayer if check box is activated if self.buildMemb: self.membName = builderMembrane(self.membName, self.runNumber) self.form.input_filename_lip.setText(self.membName) # execute builder self.modelName = builderBicelle(self.protName, self.membName, self.scafName, prefixName, self.runNumber) refresh() print("Model name is {}".format(self.modelName)) seconds_tmp = time.time() t = int((seconds_tmp - seconds_init)) print("{:d} seconds consumed.".format(t))
cmd.deselect() #cmd.show('cartoon', 'solute') #cmd.color('white', 'solute') cmd.orient('solute') util.cbaw('solute') if solute == 'dna': cmd.show('sticks', 'solute') # DNA else: cmd.show('cartoon', 'solute') # DNA # speed up builds cmd.set('defer_builds_mode', 3) cmd.set('cache_frames', 0) cmd.cache('disable') cmd.set('async_builds', 1) cmd.set('ray_transparency_contrast', 3.0) cmd.set('ray_transparency_shadows', 0) model = cmd.get_model('system') #for atom in model.atom: # print "%8d %4s %3s %5d %8.3f %8.3f %8.3f" % (atom.index, atom.name, atom.resn, int(atom.resi), atom.coord[0], atom.coord[1], atom.coord[2]) #pymol.finish_launching() cmd.viewport(width,height) #niterations = 10 # DEBUG # Load trajectory
def testCache(self): for action in pymol.exporting.cache_action_dict: cmd.cache(action)
def run_refinement(self): """Finds the model that fits SAXS data""" if self.membName == None: print("Please provide a PDB file!") return if self.dataName is None: print("Please provide SAXS dat file!") return cmd.cache("clear") cmd.reset() self.runNumber += 1 seconds_init = time.time() assemblyType = self.form.input_type.currentText() print('Assembly is: {}'.format(assemblyType)) prefixName = self.form.output_filename_prefix.text() # center protein self.preOriProt() rot_min_ang = self.form.input_rotAng_min.value() rot_max_ang = self.form.input_rotAng_max.value() + 1 rot_step_ang = self.form.input_rotAng_step.value() cmd.delete(self.modelName) self.bestModel = "" self.fit = "" # type of protein-membrane assembly if assemblyType == "detergent": dens_min_ang = self.form.input_rotAng_min_2.value() dens_max_ang = self.form.input_rotAng_max_2.value() + 1 dens_step_ang = self.form.input_rotAng_step_2.value() bestModel, fit, run = crysolRefinementDetergent(rot_min_ang, rot_max_ang, rot_step_ang, dens_min_ang, dens_max_ang, dens_step_ang, self.protName, self.membName, self.dataName, prefixName, self.runNumber) elif assemblyType == "salipro": cmd.reset() scaffold_min = self.form.input_scaffold_number_min.value() scaffold_max = self.form.input_scaffold_number_max.value() + 1 scaffold_step = self.form.input_scaffold_number_step.value() if self.buildMemb: self.membName = builderMembrane(self.membName) self.form.input_filename_lip.setText(self.membName) refresh() bestModel, fit, run = crysolRefinementSalipro(rot_min_ang, rot_max_ang, rot_step_ang, scaffold_min, scaffold_max, scaffold_step, self.protName, self.membName, self.scafName, self.dataName, prefixName, self.runNumber) elif assemblyType == "nanodisc": cmd.reset() y_min = self.form.input_rotAng_min.value() y_max = self.form.input_rotAng_max.value() + 1 y_step = self.form.input_rotAng_step.value() if self.buildMemb: self.membName = builderMembrane(self.membName) self.form.input_filename_lip.setText(self.membName) refresh() bestModel, fit, run = crysolRefinementNanodisc(rot_min_ang, rot_max_ang, rot_step_ang, y_min, y_max, y_step, self.protName, self.membName, self.scafName, self.dataName, prefixName, self.runNumber) else: print("Refinement is not supported for assembly type {}".format(assemblyType)) return self.modelName = bestModel self.fit = fit self.runNumber += run seconds_tmp = time.time() refresh() t = int((seconds_tmp - seconds_init)) print("{:d} seconds consumed.".format(t)) systemCommand([viewer, self.fit])