Author: bugman Date: Fri Aug 29 10:11:58 2014 New Revision: 25416 URL: http://svn.gna.org/viewcvs/relax?rev=25416&view=rev Log: Created the model_directory() method for the frame order auto-analysis. This is used to create the full path for saving model specific files. It replaces spaces with underscores in the path and removes all commas. The commas in the path appear to be fatal for certain PyMOL versions when viewing the frame order representation. Modified: branches/frame_order_cleanup/auto_analyses/frame_order.py Modified: branches/frame_order_cleanup/auto_analyses/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/auto_analyses/frame_order.py?rev=25416&r1=25415&r2=25416&view=diff ============================================================================== --- branches/frame_order_cleanup/auto_analyses/frame_order.py (original) +++ branches/frame_order_cleanup/auto_analyses/frame_order.py Fri Aug 29 10:11:58 2014 @@ -249,6 +249,21 @@ return incs + def model_directory(self, model): + """Return the directory to be used for the model. + + @param model: The frame order model. + @type model: str + """ + + # Convert the model name. + dir = model.replace(' ', '_') + dir = dir.replace(',', '') + + # Return the full path. + return self.results_dir + dir + + def nested_params_ave_dom_pos(self, model): """Copy the average domain parameters from simpler nested models for faster optimisation. @@ -563,7 +578,7 @@ self.interpreter.eliminate() # Save the results. - self.interpreter.results.write(dir=self.results_dir+model, force=True) + self.interpreter.results.write(dir=self.model_directory(model), force=True) # The PDB representation of the model and visualisation script. self.visualisation(model=model) @@ -592,7 +607,7 @@ # The results file already exists, so read its contents instead. if self.read_results(model=model, pipe_name=self.pipe_name_dict[model]): # The PDB representation of the model (in case this was not completed correctly). - self.interpreter.frame_order.pdb_model(dir=self.results_dir+model, force=True) + self.interpreter.frame_order.pdb_model(dir=self.model_directory(model), force=True) # Nothing more to do. return @@ -644,10 +659,10 @@ self.print_results() # Save the results. - self.interpreter.results.write(dir=self.results_dir+model, force=True) + self.interpreter.results.write(dir=self.model_directory(model), force=True) # The PDB representation of the model. - self.interpreter.frame_order.pdb_model(dir=self.results_dir+model, force=True) + self.interpreter.frame_order.pdb_model(dir=self.model_directory(model), force=True) def print_results(self): @@ -804,11 +819,11 @@ raise RelaxError("The model '%s' does not match the model '%s' of the current data pipe." % (model, cdp.model)) # The PDB representation of the model. - self.interpreter.frame_order.pdb_model(dir=self.results_dir+model, force=True) + self.interpreter.frame_order.pdb_model(dir=self.model_directory(model), force=True) # Create the visualisation script. subsection(file=sys.stdout, text="Creating a PyMOL visualisation script.") - script = open_write_file(file_name='pymol_display.py', dir=self.results_dir+model, force=True) + script = open_write_file(file_name='pymol_display.py', dir=self.model_directory(model), force=True) # Add a comment for the user. script.write("# relax script for displaying the frame order results of this '%s' model in PyMOL.\n\n" % model)