Here is the an example of how to do this in Tcl:

set PYMOL [open "|pymol -pq " w]
puts $PYMOL "viewport 400,400"
puts $PYMOL "load file.pdf"
puts $PYMOL "hide all"
puts $PYMOL "show ribbon"
puts $PYMOL "color blue"
puts $PYMOL "zoom"
flush $PYMOL

puts $PYMOL "color red"
flush $PYMOL

puts $PYMOL "hide all"
puts $PYMOL "show spheres"
puts $PYMOL "color lime"
flush $PYMOL


Here is a page describing the command line options:

http://www.pymolwiki.org/index.php/Command_Line_Options

I used -p and -q above.  From the above link:

  -q   Quiet launch. Suppress splash screen & other chatter.
  -p   Listen for commands on standard input.

One can use the normal PyMOL commands/settings as well. See the PyMOLWiki for more info, such as this list of settings:

http://www.pymolwiki.org/index.php/Settings

I'm sure there at Python equivalents for Tcl's open, puts and flush. I could try to figure these out if you would like.

Doug



On Oct 27, 2006, at 11:29 AM, Edward d'Auvergne wrote:

On 10/28/06, Douglas Kojetin <[EMAIL PROTECTED]> wrote:
Hi Edward-

I am able to feed commands into PyMOL from Tcl/Tk scripts through the
use of UNIX pipes.  From within the Tcl/Tk script, a pipe is opened
to PyMOL, and the script sends commands to PyMOL.  I can tell PyMOL
to open a PDB file, display it in a certain way (cartoon, ribbon),
highlight certain atoms or residues (by sticks, spheres, etc.), color
them, etc.  I've never tried writing images, but I don't think it
would be too difficult.  Is this the type of functionality you are
looking to incorporate into relax?

This is exactly what is needed.  I didn't realise it accepted commands
from STDIN, I told you I didn't look very hard!  That makes things
very easy to implement.  Is there documentation for this interface?
Are they python commands you send?

Edward


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

Reply via email to