The pseudoatom business looks very cool.  I'll have to try it out.

In the meantime, I wanted to mention that you certainly can make
transparent CGOs.  Here's some code that I wrote to visualize dock
output in our lab.  The files it reads in have lines that look like

<junk> x y z r <junk> temp <junk>

Where x,y,z are the coordinates, r is the radius and temp is some
index that we use to look up colors.  If you save this in a file,
you'll have a new command, sds, that will read in such a file and show
the output as spheres.  Transparency defaults to 0.4, but you can
change it.

-michael

#!/usr/bin/env python

"""
Use PyMOL to show DOCK spheres
"""
from pymol import cmd,cgo

colors = {'1':[.66,.66,.66],#'grey'
         '2':[1,0,0],#'red',
         '3':[.55,0,0],#'dark red',
         '4':[0.65,1,1],#'blue2',
         '5':[.25,.88,.82],#'blue7',
         '6':[0.004,.55,.55],#'blue8',
         '7':[0.004,.55,.55],#'blue8',
         '8':[0,1,1],#'blue13',
         '9':[0,1,1],#'blue13',
         '11':[0.60,.98,.60],#'pale green',
         '12':[0.56,.93,.56],#'light green',
         '13':[.20,.80,.20],#'lime green',
         '14':[.23,.70,.44],#'green8',
         '15':[.23,.70,.44],#'sea green',
         '16':[.18,.55,.34],#'sea green',
         '17':[.18,.55,.34],#'green',
         '18':[0,.5,0],#'forest green',
         '19':[0,.5,0],#'forest green',
         '20':[.13,.55,.13],#'dark green',
         '21':[.13,.55,.13],#'dark green',
         }

def graph_temp_via_cgo(name,data,transparency=0):
   """
   Data should be [x,y,z,r,temp] where
   x,y,z are the coordinates,
   r is the radius
   temp is something like temperature that we
   use to look up colors.
   """
   obj = []
   for x,y,z,r,temp in data:
       #transparency = (y/200.0)
       obj.extend( [ cgo.ALPHA,1-transparency])
       obj.extend( [ cgo.COLOR] + colors[temp])
       obj.extend( [ cgo.SPHERE,x,y,z,r] )
   cmd.load_cgo(obj,name,1)
   return name

def dock_file_to_data(filename):
   data = []
   f = file(filename)
   for line in f:
       if not line.strip():
           continue
       if line.startswith('#'):
           continue
       junk1,x,y,z,r,junk2,temp,junk3 = line.split()
       x,y,z,r = map(float,(x,y,z,r))
       data.append([x,y,z,r,temp])
   f.close()
   return data
def show_dock_spheres(filename,transparency=0.40):
   """
   Reads in a DOCK sphere file and graphs the
   results as dock spheres.  You can pass the
   transparency as an additional argument.
   """
   transparency = float(transparency)
   data = dock_file_to_data(filename)
   graph_temp_via_cgo('dock_spheres',data,transparency)

cmd.extend('sds',show_dock_spheres)


On 4/6/07, DeLano Scientific <del...@delsci.info> wrote:


Pre 1.0:

fragment methane, mysph
remove hydro and mysph
alter mysph, vdw=2.0
as spheres, mysph
set sphere_transparency, 0.5, mysph

Post 1.0:

pseudoatom mysph, vdw=2.0

as spheres, mysph

set sphere_transparency, 0.5, mysph

Cheers,
Warren



 ________________________________
 From: pymol-users-boun...@lists.sourceforge.net
[mailto:pymol-users-boun...@lists.sourceforge.net] On
Behalf Of jjv5
Sent: Friday, April 06, 2007 4:55 AM
To: PyMOL-users@lists.sourceforge.net
Subject: [PyMOL] Single transparent sphere



Hi,

Does anyone know of a good way to create a single transparent sphere of
varying size? We've tried using a single atom and changing the vdw, but we
are unable to produce a surface of a single atom. CGO objects work but
cannot be made transparent. What we'd really like is a transparent CGO
sphere. Any ideas?

Thanks,
Jim

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users




--
Biophysics Graduate Student
Carlson Lab, University of Michigan
http://www.umich.edu/~mlerner http://lernerclan.net

Reply via email to