From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Feb 23 2005 - 16:19:17 CST

Here,
  You should be able to hack this small Tcl script to force VMD
to temporarily override the behavior of the "draw trinorm" and
"draw color" commands, allowing you to export the HOLE geometry
to any file format you like. I've just written a very very simple
example, you'll have to find something that Pymol likes to work with.
The script works by defining two new procs that affect how VMD processes
'draw' commands, processes the triangle file you've got, then deletes
the two specail draw commands and closes the output file when it's all done.

Enjoy,
  John Stone
  vmd_at_ks.uiuc.edu

# Convert a VMD surface to a triangle list one could use in other
# programs like Pymol, by intercepting VMD 'draw' commands with a
# hacked version of the 'draw' procs for color and trinorm

set fd {}

proc vmd_draw_color {mol args} {
  global fd;
  puts $fd "color: $args"
}

proc vmd_draw_trinorm {mol args} {
  global fd;
  set v0 [lindex $args 0]
  set v1 [lindex $args 1]
  set v2 [lindex $args 2]
  set n0 [lindex $args 3]
  set n1 [lindex $args 4]
  set n2 [lindex $args 5]
  puts $fd "trinorm: $v0 $v1 $v2 $n0 $n1 $n2"
}

set exportfile "/tmp/vmdgeom.txt"
set fd [open $exportfile "w"]
source hole_p6.vmd_tri

rename vmd_draw_trinorm ""
rename vmd_draw_color ""
close $fd

On Wed, Feb 23, 2005 at 10:20:00PM +0100, Peter Holm wrote:
> Hi John,
> Thanks for your suggestions. It certainly looks like its a long text file
> with triangle descriptions. See attached!
> Perhaps it's better spent time learning how to visualise what I wish to
> visualise in VMD instead even though greater compatibility between
> macromolecular visualisation programs is desired.
> Thanks again for your kind help!
> Sincerely
> Peter
>
> ----- Original Message -----
> From: "John Stone" <johns_at_ks.uiuc.edu>
> To: "Peter Holm" <Peter.Holm_at_mbfys.lu.se>
> Cc: <vmd-l_at_ks.uiuc.edu>
> Sent: Wednesday, February 23, 2005 8:44 PM
> Subject: Re: vmd-l: VMD object exported to Pymol
>
>
> >Peter,
> > Sounds like the .vmd_tri file just contains a huge number of VMD
> >"draw triangle ..." commands. If so, then you may need to figure out
> >what sort of surface files Pymol will read. You might be able to get
> >Pymol
> >to read the .vmd_tri file directly with a bit of Python scripting, but
> >that's not presently an area of expertise for me. Maybe you can ask
> >Warren about that, he or one of the other Pymol users may already
> >have something that works with HOLE. If not, then you could probably
> >hack your VMD by redefining the "draw" Tcl proc and cause it to convert
> >the HOLE triangle set into a file that Pymol can read. Either way you're
> >going to have to find a particular surface file format that Pymol can read
> >and write some script code to emit that format from VMD, or to read into
> >it
> >from within Pymol, whichever you're more comfortable with. Assuming that
> >the .vmd_tri file does in fact contain a huge sequence of "draw" commands,
> >I think that hacking the VMD 'draw' proc for your purpose would be the
> >easiest solution.
> >
> > John
> >
> >
> >On Mon, Feb 21, 2005 at 10:38:58PM +0100, Peter Holm wrote:
> >>Hi John and thanks a lot for your suggestions!
> >>Exporting to Pymol would be my number one choice. The surface is simply
> >>read in by "source holeobject.vmd_tri" hence I guess its some kind of
> >>triangulated object? Any ideas? If not I can send you the file tomorrow
> >>when I'm back at my lab computer.
> >>Cheers
> >>Peter
> >>
> >>****************************************************
> >>Peter Holm, Ph.D. Student
> >>Molecular Biophysics
> >>Center for Chemistry and Chemical Engineering
> >>Lund University
> >>P.O.B. 124
> >>SE-22100 Lund
> >>SWEDEN
> >>
> >>Telephone numbers
> >>Office: +46-(0)46-2221448
> >>Mobile: +46-(0)709-625451
> >>Fax: +46-(0)46-2224692
> >>E-mail: peter.holm_at_mbfys.lu.se
> >>http://www.mbfys.lu.se
> >>****************************************************
> >>
> >>
> >>----- Original Message -----
> >>From: John Stone <johns_at_ks.uiuc.edu>
> >>Date: Monday, February 21, 2005 6:58 pm
> >>Subject: Re: vmd-l: VMD object exported to Pymol
> >>
> >>>
> >>> Peter,
> >>> VMD has distanced-based atom selections which would be the easiest
> >>> method to select the appropriate atoms for drawing. If you don't have
> >>> any easily selectable reference atoms to use for the "within" atom
> >>> selection,you might find it easier to use "exwithin" on to
> >>> deselect parts you know
> >>> you only want to see in ribbon representations. Lastly, if
> >>> neither of those
> >>> commands are convenient, you can write a simple tcl script to
> >>> generate a
> >>> list of atom indices within a given distance of the HOLE sphere
> >>> set, then
> >>> use a macro or a tcl script to make a new representation for the
> >>> residuesof interest.
> >>>
> >>> There might be a way to export the HOLE surface to Pymol depending
> >>> on what
> >>> method you're using to get it into VMD in the first place. If you
> >>> tell me
> >>> how you're loading the HOLE surface I could give you further
> >>> suggestionsin this direction.
> >>>
> >>> John Stone
> >>> vmd_at_ks.uiuc.edu
> >>>
> >>> On Mon, Feb 21, 2005 at 02:47:52PM +0100, Peter Holm wrote:
> >>> > Dear list readers,
> >>> >
> >>> > I have an object created a VMD surface object by the HOLE
> >>> program suite (http://d2o.biop.ox.ac.uk:38080/).
> >>> > I would like to visualise certain amino acid residues in a
> >>> corresponding pdb file in close proximity to the surface produced
> >>> while keeping residues further away than say 10Å as ribbons or
> >>> similar clean visualisation. I know how to do the latter in Pymol
> >>> but I is it possible to convert a HOLE/VMD surface to be read by
> >>> Pymol or is the problem possible to solve in VMD alone?
> >>> >
> >>> > Many thanks in advance
> >>> >
> >>> > Sincerely
> >>> >
> >>> > Peter
> >>> >
> >>> > ******************************************************
> >>> > Peter Holm, Ph.D. Student
> >>> > Molecular Biophysics
> >>> > Center for Chemistry and Chemical Engineering
> >>> > Lund University
> >>> > P.O.B. 124
> >>> > SE-22100 Lund
> >>> > SWEDEN
> >>> > Lab: +46-(0)46-2221448 Cell: +46-(0)709-625451
> >>> > Fax: +46-(0)46-2224692 http://www.mbfys.lu.se
> >>> > E-mail: peter.holm_at_mbfys.lu.se
> >>> > ******************************************************
> >>> >
> >>>
> >>> --
> >>> NIH Resource for Macromolecular Modeling and Bioinformatics
> >>> Beckman Institute for Advanced Science and Technology
> >>> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> >>> Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> >>>
> >>> WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
> >>>
> >>
> >
> >--
> >NIH Resource for Macromolecular Modeling and Bioinformatics
> >Beckman Institute for Advanced Science and Technology
> >University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> >Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> > WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078