Author: bugman Date: Wed Dec 3 21:14:53 2008 New Revision: 8109 URL: http://svn.gna.org/viewcvs/relax?rev=8109&view=rev Log: Bug fixes for the PyMOL cartoon() method. As with the open_pdb() method, cartoon() was not handling the structural object correctly and was not handling multiple structures. Modified: 1.3/generic_fns/pymol.py Modified: 1.3/generic_fns/pymol.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pymol.py?rev=8109&r1=8108&r2=8109&view=diff ============================================================================== --- 1.3/generic_fns/pymol.py (original) +++ 1.3/generic_fns/pymol.py Wed Dec 3 21:14:53 2008 @@ -155,18 +155,22 @@ # Get the current data pipe. cdp = pipes.get_pipe() - # Identifier. - pdb_file = cdp.structure.file_name - id = file_root(pdb_file) - - # Hide everything. - pymol.pipe_write("cmd.hide('everything'," + `id` + ")") - - # Show the cartoon style. - pymol.pipe_write("cmd.show('cartoon'," + `id` + ")") - - # Colour by secondary structure. - pymol.pipe_write("util.cbss(" + `id` + ", 'red', 'yellow', 'green')") + # Loop over the PDB files. + for i in xrange(cdp.structure.num): + # Identifier. + pdb_file = cdp.structure.file[i] + if cdp.structure.path[i]: + pdb_file = cdp.structure.path[i] + sep + pdb_file + id = file_root(pdb_file) + + # Hide everything. + pymol.pipe_write("cmd.hide('everything'," + `id` + ")") + + # Show the cartoon style. + pymol.pipe_write("cmd.show('cartoon'," + `id` + ")") + + # Colour by secondary structure. + pymol.pipe_write("util.cbss(" + `id` + ", 'red', 'yellow', 'green')") def command(command):