Re: [PyMOL] PyMOL-users Digest, Vol 116, Issue 15

2016-02-02 Thread Sampson, Jared M.
Hi Annemarie -

Fun problem.  It looks like cmd.transform_selection() only works with 
"molecule" type objects, not with CGOs. You could try doing something like 
what's in the 3rd example in http://www.pymolwiki.org/index.php/Axes, 
calculating the new object matrix itself by transforming the current one, then 
applying it to the object using cmd.set_object_ttt().

Alternatively, if you can reproducibly identify any vector that should be 
perpendicular to the membrane, you could use those points as the start and end 
points for your initial load_cgo command.  For example, if your receptor 
happens to have a symmetric channel, something like this might work.

```
# create pseudoatoms at the average positions of residues at the top and bottom 
of the chain
pseudoatom top,  and n. CA and chain A+B+C+D
pseudoatom bot,  and n. CA and chain A+B+C+D

# Orient to the pseudoatoms and fine tune the positions along the viewport Y 
axis.
# (Make sure you don't move the view until you're done positioning the 
pseudoatoms.)
orient (top or bot)
turn z, 90  # assuming `orient` put them along X and you want them along Y
translate [0, 2, 0], top
translate [0, -1.5, 0], bot

# Get the coordinates of the two end points
from pymol import stored
stored.start = []
stored.end = []
iterate_state 1, top, stored.start = (x,y,z)
iterate_state 1, bot, stored.end = (x,y,z)

# Create the CGO cylinder (I made it semitransparent)
from pymol.cgo import ALPHA, CYLINDER
x1,y1,z1 = stored.start
x2,y2,z2 = stored.end
r1,g1,b1 = 1, 1, 0
r2,g2,b2 = 1, 1, 0
radius = 100
cmd.load_cgo([ ALPHA, 0.5, CYLINDER, x1, y1, z1, x2, y2, z2, radius, r1, g1, 
b1, r2, g2, b2 ], "membrane")

```

Not sure if that will be applicable to your use case, but hopefully it will at 
least give you an idea of one approach that could work.

Hope that helps.

Cheers,
Jared

--
Jared Sampson
Columbia University


On Jan 29, 2016, at 4:33 PM, Honegger Annemarie 
> wrote:

I am trying to show some cell surface receptors and to indicate their position 
relative to the membrane.

I thought to indicate the plane of the membrane by a flat disk, a ago cylinder.

x1,y1,z1 = 0, -1, 0 # start point
r1,g1,b1 = 1, 1, 0 # color (yellow)
x2,y2,z2 = 0, -2, 0 # end point
r2,g2,b2 = 1, 1, 0 # color (yellow)
radius = 100
cmd.load_cgo( [ 9.0, x1, y1, z1, x2, y2, z2, radius, r1, g1, b1, r2, g2, b2 ], 
"membrane" )

When I try to move this cylinder into the correct position with 
cmd.transform_selection,
using the transformation parameters extracted from get_view (reordering them as 
needed)
I get the error message "Selector-Error: Invalid selection name “membrane” “

The same transform command works fine if I apply it to a pseudo atom originally 
generated with coordinates 0,0,0.

Any suggestion how else I could indicate the membrane, or how I could place my 
ego object parallel
to the screen yz plane? I have to be able to do this in a reproducible fashion, 
as I have to  do this
for a large number of constructs that bend my receptors relative to the 
membrane in various ways.

Thanks for your help
Annemarie
___

Dr. Annemarie Honegger PhD
Department
of Biochemistry
Zürich University
Winterthurerstrasse 190
CH-8057 Zürich
Switzerland

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
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

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
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

[PyMOL] ignore_case in next PyMOL version

2016-02-02 Thread Thomas Holder
Greetings,

I like to let you know that we plan another change for the "ignore_case" 
setting behavior. We want to restore the old default (ignore_case=on) and 
introduce a new setting "ignore_case_chain=off", which will affect the "chain" 
and "segi" identifiers.

As you may (or should) know, we changed the default of the "ignore_case" 
setting in PyMOL 1.8 from "on" to "off". The rationale was to have default 
settings which properly support PDB files which mix upper and lower case chain 
identifiers (e.g. 3a0b). Users who still prefer a case insensitive selection 
language can put a "set ignore_case" line in their pymolrc file.

However, we now realized that this is not very practical. One reason is that 
too many scripts and code samples use lower case resn and name selections, 
fixing those historic resources is often not feasible or desirable. Another 
reason is that PyMOL inconsistently stores element symbols, for example 
chlorine is "CL" when loaded from a PDB file, but "Cl" when loaded from SDF. 
The logical conclusion is that PyMOL should handle chain and segi different 
from resn, name and elem.

See also: http://pymolwiki.org/index.php/ignore_case

Any kind of feedback regarding the planned change will be appreciated.

Cheers,
  Thomas

-- 
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
___
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] Testing if a .pml script is run in command line mode

2016-02-02 Thread Folmer Fredslund
Dear list,

Seems like I was able to find it myself by searching for "scene" in the
code on github.

The magic name is  "get_scene_list", which perhaps was not such a strange
name afterall

So, now I have put together a small script, to take all scenes in a pml
script and render them by running PyMOL on the command line like this:
pymol -c script.pml -r ray_scenes.py

Thanks to Jesper Karlsen (off-list) for pushing a bit further with this and
Tsjerk for introducing me to "invocation._argv"

Best regards,
Folmer


2016-02-01 15:19 GMT+01:00 Folmer Fredslund :

> Dear list,
>
> Moving a bit further with this, I have been trying to find an easy way to
> iterate through the list of scene names. Or to get them somehow.
> I don't seem to be able to find any information about this and thought
> someone probably already knew.
>
> Thanks in advance!
>
> Folmer
>
> 2016-01-27 14:07 GMT+01:00 Folmer Fredslund :
>
>> Dear Tsjerk,
>>
>> Thanks! simply including
>> if '-c' in invocation._argv
>> in the script works fine for me,
>>
>> Best,
>> Folmer
>>
>> 2016-01-27 12:43 GMT+01:00 Tsjerk Wassenaar :
>>
>>> Hey Folmer,
>>>
>>> You can check if '-c' not in invocation._argv
>>> Of course, you'd also need to check combinations, so it would be
>>> matching -.*c.* on the elements in _argv.
>>>
>>> There probably is a way to check for the GUI directly though.
>>>
>>> Hope it helps,
>>>
>>> Tsjerk
>>>
>>> On Wed, Jan 27, 2016 at 11:49 AM, Folmer Fredslund 
>>> wrote:
>>>
 Hi there,

 I was wondering if there is a way to check if a .pml is being run in
 command line mode (pymol -c), i.e. without the GUI.

 The reason I'm asking, is because I am making some scripts for figures,
 and save the representations as scenes. It would be nice to both be able
 to view them (running the .pml normally) and also make raytraced png's
 when the .pml is being run in commandline mode.

 Best regards,
 Folmer Fredslund


 --
 Site24x7 APM Insight: Get Deep Visibility into Application Performance
 APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
 Monitor end-to-end web transactions and take corrective actions now
 Troubleshoot faster and improve end-user experience. Signup Now!
 http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
 ___
 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

>>>
>>>
>>>
>>> --
>>> Tsjerk A. Wassenaar, Ph.D.
>>>
>>>
>>
>>
>> --
>> Folmer Fredslund
>>
>
>
>
> --
> Folmer Fredslund
>



-- 
Folmer Fredslund
#!/usr/bin/python
# Run a pymol script with scenes like this:
# pymol -c your.pml -r thisscript.py
# and a png for every scene will be generated


from pymol import cmd
resolution = 500

pymol_flags = pymol.invocation._argv[1]
print "PyMOL flags: %s"%(pymol_flags)
if pymol_flags.startswith( '-' ):
if "c" in pymol_flags:  
for scene in cmd.get_scene_list():
cmd.scene(key=scene, action='recall', animate=0)
print "This is scene %s"%(scene)
cmd.png(scene+".png", resolution, ray=1, dpi=300)

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
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-users Digest, Vol 116, Issue 15

2016-02-02 Thread H. Adam Steinberg
Tsjerk,

Can you add an example of generating a “real” membrane around a protein to the 
gallery of the PyMOLwiki?

My students would love to have easy access to that!

Thanks!

Adam

> On Feb 2, 2016, at 1:39 AM, Tsjerk Wassenaar  wrote:
> 
> Hi Annemarie,
> 
> It's actually quite simple to generate a real membrane around your protein 
> and, e.g., to show the head groups. Do you have a PDB ID for the protein, or 
> are they in-house models?
> 
> Cheers,
> 
> Tsjerk
> 
> On Mon, Feb 1, 2016 at 10:57 PM, Julian Heinrich  > wrote:
> Hi Annemarie,
> 
> Have you tried the following?
> cmd.translate([x,y,z], object='membrane')
> 
> replace x,y,z with your translation vector.
> 
> Cheers,
> Julian
> 
> On Sat, Jan 30, 2016 at 8:33 AM, Honegger Annemarie  > wrote:
> I am trying to show some cell surface receptors and to indicate their 
> position relative to the membrane.
> 
> I thought to indicate the plane of the membrane by a flat disk, a ago 
> cylinder.
> 
> x1,y1,z1 = 0, -1, 0 # start point
> r1,g1,b1 = 1, 1, 0 # color (yellow)
> x2,y2,z2 = 0, -2, 0 # end point
> r2,g2,b2 = 1, 1, 0 # color (yellow)
> radius = 100
> cmd.load_cgo( [ 9.0, x1, y1, z1, x2, y2, z2, radius, r1, g1, b1, r2, g2, b2 
> ], "membrane" )
> 
> When I try to move this cylinder into the correct position with 
> cmd.transform_selection,
> using the transformation parameters extracted from get_view (reordering them 
> as needed)
> I get the error message "Selector-Error: Invalid selection name “membrane” “
> 
> The same transform command works fine if I apply it to a pseudo atom 
> originally generated with coordinates 0,0,0.
> 
> Any suggestion how else I could indicate the membrane, or how I could place 
> my ego object parallel 
> to the screen yz plane? I have to be able to do this in a reproducible 
> fashion, as I have to  do this
> for a large number of constructs that bend my receptors relative to the 
> membrane in various ways. 
> 
> Thanks for your help
>   Annemarie
>   
> ___
> 
> Dr. Annemarie Honegger PhD
> Department 
> of Biochemistry
> Zürich University
> Winterthurerstrasse 190
> CH-8057 Zürich
> Switzerland
> 
> 
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 
> 
> ___
> 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 
> 
> 
> 
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 
> 
> ___
> 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 
> 
> 
> 
> 
> -- 
> Tsjerk A. Wassenaar, Ph.D.
> 
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140___
> 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

H. Adam Steinberg
7904 Bowman Rd
Lodi, WI 53555
608/592-2366


[PyMOL] Transformation of cgo objects

2016-02-02 Thread Honegger Annemarie

> On 02 Feb 2016, at 08:39, Tsjerk Wassenaar  wrote:
> 
> Hi Annemarie,
> 
> It's actually quite simple to generate a real membrane around your protein 
> and, e.g., to show the head groups. Do you have a PDB ID for the protein, or 
> are they in-house models?
> 
> Cheers,
> 
> Tsjerk
> 
> 

Hi Tsjerk

Thanks for your suggestion,
I had of course thought about depicting a real membrane, but rejected it.  The 
problem is that I am dealing with very large and complex system:
Multimeric receptors crosslinked by rigid antibody-like molecules, therefore I 
would require a 250Å by 250Å patch of membrane. 
I would prefer a very simple representation of the membrane, not only because 
of rendering times when making a movie and highly resolved images,
but also to not distract the viewer from the essential feature of the model by 
extraneous detail - I just need to indicate the plane of the membrane
to show that some of the arrangements are not possible due to clashes with the 
plane of the membrane. 

If there is no way define my cgo object in screen coordinates or to object 
transformations to it, I will either have to export the 
transformed coordinates of my objects, then re-import them in the correct 
orientation, or else find a reproducible way to calculate the preferred
position and orientation of my cgo object relative to my molecular objects to 
generate it in the right place. 
It’s just a bit tedious to do this more or less by trial and error, since I 
have to do it reproducibly for a fairly large number of different arrangements.

> 
> On Mon, Feb 1, 2016 at 10:57 PM, Julian Heinrich  wrote:
> Hi Annemarie,
> 
> Have you tried the following?
> cmd.translate([x,y,z], object='membrane')
> 
> replace x,y,z with your translation vector.
> 
> Cheers,
> Julian

Dear Julian

Neither “translate” nor “rotate” seem to work on cgo objects. 

PyMOL>translate [-50,0,0], membrane
Selector-Error: Invalid selection name "membrane".
membrane<--

e.g if I indicate a helix axis with an arrow using the “AngleBetweenHelices” 
script, 
I have to use “turn” rather than “rotate” to get a second view rotated by 90 
degree.
I suspect that cgo objects are fixed in object space, you can only alter the 
camera position
to look at them from different angles.

best regards

Annemarie

___

Dr. Annemarie Honegger PhD
Department 
of Biochemistry
Zürich University
Winterthurerstrasse 190
CH-8057 Zürich
Switzerland

e-Mail: honeg...@bioc.uzh.ch

websites
http://www.bioc.uzh.ch/plueckthun
http://www.bioc.uzh.ch/plueckthun/antibody
http://www.bioc.uzh.ch/plueckthun/nanowelt





> 
> On Mon, Feb 1, 2016 at 10:57 PM, Julian Heinrich  wrote:
> Hi Annemarie,
> 
> Have you tried the following?
> cmd.translate([x,y,z], object='membrane')
> 
> replace x,y,z with your translation vector.
> 
> Cheers,
> Julian
> 
> On Sat, Jan 30, 2016 at 8:33 AM, Honegger Annemarie  
> wrote:
> I am trying to show some cell surface receptors and to indicate their 
> position relative to the membrane.
> 
> I thought to indicate the plane of the membrane by a flat disk, a ago 
> cylinder.
> 
> x1,y1,z1 = 0, -1, 0 # start point
> r1,g1,b1 = 1, 1, 0 # color (yellow)
> x2,y2,z2 = 0, -2, 0 # end point
> r2,g2,b2 = 1, 1, 0 # color (yellow)
> radius = 100
> cmd.load_cgo( [ 9.0, x1, y1, z1, x2, y2, z2, radius, r1, g1, b1, r2, g2, b2 
> ], "membrane" )
> 
> When I try to move this cylinder into the correct position with 
> cmd.transform_selection,
> using the transformation parameters extracted from get_view (reordering them 
> as needed)
> I get the error message "Selector-Error: Invalid selection name “membrane” “
> 
> The same transform command works fine if I apply it to a pseudo atom 
> originally generated with coordinates 0,0,0.
> 
> Any suggestion how else I could indicate the membrane, or how I could place 
> my ego object parallel 
> to the screen yz plane? I have to be able to do this in a reproducible 
> fashion, as I have to  do this
> for a large number of constructs that bend my receptors relative to the 
> membrane in various ways. 
> 
> Thanks for your help
>   Annemarie
>   
> ___
> 
> Dr. Annemarie Honegger PhD
> Department 
> of Biochemistry
> Zürich University
> Winterthurerstrasse 190
> CH-8057 Zürich
> Switzerland
> 
> 
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140
> ___
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: