Re: [PyMOL] drawing arows, CONE cgo doesn't work. -- SOLVED

2014-08-26 Thread vincent Chaptal

Hi all,

I managed to solve the problem by looking at the cgo_arrow.py of Thomas 
Holder in the wiki: http://www.pymolwiki.org/index.php/Cgo_arrow



my line was incorrect:
cmd.load_cgo( [ CONE, x0, y0, z0, x1, y1, z1, radius, r1, g1, b1, r1, 
g1, b1 ], "cone_a" )


correct line:
cmd.load_cgo( [ CONE, x0, y0, z0, x1, y1, z1, radius, 0.0, r1, g1, b1, 
r1, g1, b1, 1.0, 0.0 ], "cone_a" )


of course, with the definition of x0, y0, etc... and the from pymol.cgo 
import 


Have a good day.
Vincent


Le 8/26/14 12:19 AM, Andreas Warnecke a écrit :

Hej,

if you simply copy-paste the wiki entry into PyMOL you will get the 
error. This code is intended to be run as a block (e.g. from script) 
and creates e.g. problems with indentation, or other errors.
A simple solution would be to wrap the commands to a block using 
"python" and "python end".


Either you include them in what copy paste (the whole shabang):

python
# axes.py
from  pymol.cgo  import  *
from  pymolimport  cmd
from  pymol.vfont  import  plain
  
# create the axes object, draw axes with cylinders coloured red, green,

#blue for X, Y and Z
  
obj=  [

CYLINDER,  0.,  0.,  0.,  10.,  0.,  0.,  0.2,  1.0,  1.0,  1.0,  1.0,  
0.0,  0.,
CYLINDER,  0.,  0.,  0.,  0.,  10.,  0.,  0.2,  1.0,  1.0,  1.0,  0.,  1.0, 
 0.,
CYLINDER,  0.,  0.,  0.,  0.,  0.,  10.,  0.2,  1.0,  1.0,  1.0,  0.,  0.0, 
 1.0,
]
  
# add labels to axes object (requires pymol version 0.8 or greater, I

# believe
  
cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])

cyl_text(obj,plain,[10.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[0.,10.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[0.,0.,10.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
  
# then we load it into PyMOL

cmd.load_cgo(obj,'axes')
python end

OR you can enter the lines/ copy paste sequentially.

If you are interested in arrows/ cones, have a look at the cgo_arrow 
script:

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

Hope this helps.

Cheers,

Andreas


On Mon, Aug 25, 2014 at 5:48 PM, vincent Chaptal 
mailto:vincent.chap...@ibcp.fr>> wrote:


Hi,

I'm trying to draw arrows in Pymol 1.7.2 for mac, "à la
http://www.pymolwiki.org/index.php/Axes "

When I run the script for the Axes_with_nice_cones, I have the
error message:
File "/Applications/MacPyMOL.app/pymol/modules/pymol/parser.py",
line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
  File "", line 1
CONE, 0.0, 0.0,   l, 0.0, 0.0, h+l, d, 0.0, 0.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0, 1.0]
^
SyntaxError: invalid syntax


As a workaround, I tried to use the cylinder syntax (bellow, by
replacing CYLINDER by CONE), pymol loads the object but doesn't
draw anything.
cmd.load_cgo( [ CONE, x0, y0, z0, x1, y1, z1, radius, r1, g1, b1,
r1, g1, b1 ], "cone_a" )


Can someone tell me what is going on and how I can draw a cgo CONE
in pymol? It looks very nice.

Thank you
Vincent




-- 


Vincent Chaptal, PhD

Institut de Biologie et Chimie des Protéines

Drug-resistance modulation and mechanism Laboratory

7 passage du Vercors

69007 LYON

FRANCE

+33 4 37 65 29 01 

http://www.ibcp.fr




--
Slashdot TV.
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net
)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives:
http://www.mail-archive.com/pymol-users@lists.sourceforge.net




--

Vincent Chaptal, PhD

Institut de Biologie et Chimie des Protéines

Drug-resistance modulation and mechanism Laboratory

7 passage du Vercors

69007 LYON

FRANCE

+33 4 37 65 29 01

http://www.ibcp.fr


--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] cartoon_transparency issue

2014-08-26 Thread Justin Lecher
On 25/08/14 18:42, Markus Heller wrote:
> Hello,
> 
> Attached is a crop of a figure create with the latest PyMOL under Windoze 7 
> 64 bit.  When setting cartoon_transparency, I get a gray band on the 
> cartoons.  Where does this come from, and how do I get rid of it?
> 
> Thanks and Cheers
> Markus
> 
> Here's my code:
> 
> # reset everything
> delete all
> 
> # white background
> bg_color white
> 
> # show valences
> set valence, 1
> 
> # show valences inside rings, 0 = centered, 1 = inside set valence_mode, 1
> 
> # antialias
> set antialias = 1
> 
> # load the PDB files
> 
> load ... example PDB
> 
> # turn on grid mode and set it up
> set grid_mode, 1
> 
> # hide everything
> hide everything
> 
> # select protein
> select prot, polymer
> 
> # color everything
> color white
> 
> # show cartoon ribbon for protein
> show cartoon
> 
> # don't show backbone for cartoons
> set cartoon_side_chain_helper, on
> 
> # keep standard helix, strand, loop representations # other options: cartoon 
> loop, cartoon rect, # cartoon oval , cartoon tube cartoon automatic
> 
> # color cartoon white and set transparency set cartoon_color, white set 
> cartoon_transparency, 0.7
> 
> # select residue of interest
> select roi, resi 27+31+34+37+41
> 
> # show sticks for ROIs
> show sticks, roi
> 
> # hide non-polar H
> hide (h. and (e. c extend 1))
> 
> # color ROIs
> color atomic
> color yellow, (name C* and roi)
> 
> # show H-bonds between sidechains and assign to slots dist Hbo-sc, resi 37, 
> resi 41, mode = 2
> 
> # hide alls labels
> hide labels
> 
> # color all dashes green
> set dash_color, green
> 
> # deselect all to avoid little pink squares deselect
> 
> 
> 
> 
> --
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> 
> 
> 
> ___
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> 

Hi markus,

just raytrace you figure using the "ray" command.

Justin

-- 
Justin Lecher
Institute of Complex Systems
ICS-6 Structural Biochemistry
Research Centre Juelich
52425 Juelich, Germany
phone: +49 2461 61 2117




smime.p7s
Description: S/MIME Cryptographic Signature
--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] pymol 3D movies

2014-08-26 Thread Marcelo Marcet
Hi Christian,

Thanks so much for your email. I am looking forward to testing your approach 
and scripts soon. Again, thanks for the detailed explanations and the scripts. 

Best regards,
Marcelo

On Aug 25, 2014, at 6:02 PM, Christian Becke  
wrote:

> Hi,
> 
> Am 25.08.2014 21:44, schrieb Marcelo Marcet:
>> Thank you for taking the time to reply to this question and for
>> offering your help. I am also interested in quad-buffered stereo play
>> back.
> 
> Sorry, maybe I wasn't clear in my first mail: I don't have experience
> with quad-buffered stereo playback. All I have done is preparing 3D
> stereo movie files using PyMOL and ffmpeg[1] which I can play on a 3D TV 
> (using a side-by-side stereo movie file and polarization glasses) or on a 
> regular beamer (anaglyph red/cyan movie with red/cyan glasses).
> I expect that one could play these (or similarly prepared) movie files with a 
> movie player that makes use of OpenGL quad-buffered 3D capabilities of a 
> graphics card - but I never tried this myself.
> AFAIU, there is no such thing as a quad-buffered movie file - it's just the 
> movie player that plays back a 3D stereo movie file using OpenGL 
> quad-buffered stereo on hardware that supports it. A player that might work 
> is bino[2], but, as I said, I never got around to try it out.
> 
>> Would you be able to provide us with a bit more methodology information?
>> It sounds like you have a script that helps you save the side-by-side
>> images and later you use a software called ffmpeg to render the movie.
>> Is this correct?
> 
> Yes, this is correct. Here is how I did it:
> 1) Prepare a movie in PyMOL
> 2) run the attached python script ("run /path/to/mpng_3d.sh"). This will add 
> a new command to pymol: mpng_3d
> It works similar to the mpng command, but saves 2 images for each movie 
> frame, one for the left and one for the right eye. If ray traced frames are 
> desired, do "set ray_trace_frames, 1". You can also play around with the 
> stereo_angle setting (e.g. "set stereo_angle, 3"). This defines the 
> difference in viewing angle of the images for the left and right eye.
> The mpng_3d command takes the following options:
> mpng_3d , , , [start=1], [end=-1]
> render stereoscopic frames sized  x  pixels.
> Files will be named _%04d.png.
> Render frames  to  (default: all frames)
> 
> Example: "mpng_3d my_movie, 1920, 1080" will write png files called 
> my_movie_0001.png, my_movie_0002.png, ...
> If ray_trace_frames is set (recommended), the images will be ray traced and 
> have a size of 1920x1080 pixels (i.e. full HD).
> 3) Use ffmpeg to encode a movie from the individual frames saved with mpng_3d:
> For h.264 encoding:
> ffmpeg -i "my_movie_%04d.png" \
>   -an \
>   -r 30 -aspect 1.78 -pix_fmt yuv420p \
>   -c:v libx264 -tune animation \
>   -vf stereo3d=al:sbsl \
>   -profile:v baseline -level 3.0 -refs 4 -qmin 4 \
>   "my_movie.mp4"
> 
> For WMV encoding:
> ffmpeg -i "my_movie_%04d.png" \
>   -an \
>   -r 30 -aspect ${aspect} \
>-vf stereo3d=al:sbsl \
>   -q:v 2 -c:v msmpeg4v3 \
>   "my_movie.wmv"
> 
> These are the commands I used on linux. Similar ffmpeg commands should also 
> work on Windows or OS X. Video quality and file size were reasonable with the 
> above settings, and the files played all right on almost all video players I 
> tested (the wmv files work with all versions of PowerPoint I tested, the 
> h.264 movies do not work with WinXP).
> If you change the size of the images, also change the -aspect parameter in 
> the ffmpeg commands accordingly (for 1920x1080 pixel images: 
> aspect=1920/1080=1.78).
> The above commands produce side-by-side stereo movies, i.e. the images for 
> the left and right eye are shown next to each other in each frame
> of the movie. Check the ffmpeg docs[3] for other output options.
> For some movie players (e.g. the one on my LG 3D TV) it might be necessary to 
> scale the pymol-rendered frames to half-width before encoding them to a 
> side-by-side stereo movie with ffmpeg. This can be done e.g. with the 
> "convert" command from the imagmagick[4] suite.
> 
> I hope this helps!
> 
> Christian
> 
> [1] http://ffmpeg.org
> [2] http://bino3d.org
> [3] http://ffmpeg.org/ffmpeg-filters.html#stereo3d
> [4] http://www.imagemagick.org
> 
> -- 
> Christian Becke
> 
> Freie Universität Berlin
> Fachbereich Biologie, Chemie, Pharmazie
> Institut für Chemie und Biochemie
> AG Strukturbiochemie
> 
> Takustr. 6
> 14195 Berlin
> Germany
> 
> Phone: +49 (0)30 838-57344
> Fax: +49 (0)30 838-56981
> E-mail: christian.be...@fu-berlin.de
> --
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/___
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.co

[PyMOL] how to get the surface representation look better?

2014-08-26 Thread sunyeping
Dear all,Please see the figure (surface1.tif) I deposited in dropbox 
(https://www.dropbox.com/home, Account sunyep...@aliyun.com, Password: 
pymolusers). A is taken from a literature, and B is prepared by myself. In A, 
the stick representation of the side chains of residues P3, D156, R97, etc., is 
wraped around in a representation that looks like having a transparent 
stereoscopic volume. I guess this represnetation is some kind of surface. 
However, in B, although I show the surface represnetation for residue E63, it 
looks like a curved surface locate aside E63 and doesn't wrap around the side 
chain of E63 as in A. Could anyone tell me how the effect of the surface 
representation (if I am correct) was prepared? Best regards. 
Yeping Sun
Institute of Microbiology, Chinese Academy of Sciences
--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net