Author: bugman Date: Thu Dec 7 06:43:09 2006 New Revision: 2923 URL: http://svn.gna.org/viewcvs/relax?rev=2923&view=rev Log: Addition of the user function 'structure.vector_dist()'. This function will display the PDB representation of the XH vector distribution overlain over the macromolecular structure within PyMOL. Modified: 1.3/generic_fns/pymol.py 1.3/prompt/pymol.py Modified: 1.3/generic_fns/pymol.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pymol.py?rev=2923&r1=2922&r2=2923&view=diff ============================================================================== --- 1.3/generic_fns/pymol.py (original) +++ 1.3/generic_fns/pymol.py Thu Dec 7 06:43:09 2006 @@ -260,6 +260,36 @@ self.pipe_write("cmd.delete('sele')") + def vector_dist(self, run=None, file=None): + """Display the XH bond vector distribution. + + @param run: The run + @type run: str + @param file: The vector distribution PDB file. + @type file: str + """ + + # Arguments. + self.run = run + + # Test if the run exists. + if not self.run in self.relax.data.run_names: + raise RelaxNoRunError, self.run + + # The file root. + file_root = self.relax.IO.file_root(file) + + # Read in the vector distribution PDB file. + self.pipe_write("load " + file) + + + # Create a surface. + ################### + + # Select the vector distribution. + self.pipe_write("cmd.show('surface', " + `file_root` + ")") + + def view(self, run=None): """Function for running PyMOL.""" Modified: 1.3/prompt/pymol.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/pymol.py?rev=2923&r1=2922&r2=2923&view=diff ============================================================================== --- 1.3/prompt/pymol.py (original) +++ 1.3/prompt/pymol.py Thu Dec 7 06:43:09 2006 @@ -303,6 +303,50 @@ self.__relax__.generic.pymol.tensor_pdb(run=run, file=file) + def vector_dist(self, run=None, file='XH_dist.pdb'): + """Function displaying the PDB file representation of the XH vector distribution. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + run: The name of the run. + + file: The name of the PDB file containing the vector distribution. + + + Description + ~~~~~~~~~~~ + + A PDB file of the macromolecule must have previously been loaded as the vector distribution + will be overlain with the macromolecule within PyMOL. The PDB file containing the vector + distribution must be created using the complementary 'pdb.create_vector_dist()' user + function. + + The vector distribution PDB file is read in using the command: + + load file + + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "pymol.vector_dist(" + text = text + "run=" + `run` + text = text + ", file=" + `file` + ")" + print text + + # The run name. + if type(run) != str: + raise RelaxStrError, ('run', run) + + # The file name. + if type(file) != str: + raise RelaxStrError, ('file name', file) + + # Execute the functional code. + self.__relax__.generic.pymol.vector_dist(run=run, file=file) + + def view(self, run=None): """Function for viewing the collection of molecules extracted from the PDB file.