Thanks, I’ll give that a shot. Let’s see how well that extends into sessions.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Monday, March 07, 2016 1:26 PM
To: Schubert, Carsten [JRDUS]
Cc: pymol-users
Subject: Re: [PyMOL] How to store matrix settings for individual scenes?

Hi Carsten -

Could you wrap the `scene` function and include storing/recalling of the 
matrices as well as the scenes?  I just whipped together the following:

```
from pymol import stored
from pymol import cmd
stored.scene_matrices = {}

def scene_store(scn):
    obj_matrices = {}
    # only store matrices for enabled objects
    for obj in cmd.get_names(enabled_only=1):
        print 'storing matrix for %s' % obj
        m = cmd.get_object_matrix(obj)
        print m
        obj_matrices[obj] = m

    stored.scene_matrices[scn] = obj_matrices
    cmd.scene(scn, 'store')

def scene_recall(scn):
    obj_matrices = stored.scene_matrices[scn]
    for obj in cmd.get_names():
        # don't try to reset objects that aren't in the recalled scene
        if obj in obj_matrices.keys():
            cmd.matrix_reset(obj)
            cmd.transform_selection(obj, obj_matrices[obj])
    cmd.scene(scn, 'recall')

cmd.extend('scene_store', scene_store)
cmd.extend('scene_recall', scene_recall)
```

This works for me with, e.g.

```
fetch 1shv, async=0
fetch 3opl, async=0
scene_store F1

super 3opl, 1shv  # changes the 3opl matrix
scene_store F2

scene_recall F1  # restores the original 3opl matrix
```

Not sure if that's closer to what you're looking for...hope it helps!

Cheers,
Jared
--
Jared Sampson
Columbia University

On Mar 7, 2016, at 12:35 PM, Schubert, Carsten [JRDUS] 
<cschu...@its.jnj.com<mailto:cschu...@its.jnj.com>> wrote:

Yeah, but not my preferred choice. Tried to do this the elegant way, but 
bumping up against Pymol’s limits unless Thomas has a workaround.

From: Sampson, Jared M. [mailto:jms2...@cumc.columbia.edu]
Sent: Monday, March 07, 2016 12:15 PM
To: Schubert, Carsten [JRDUS]
Cc: pymol-users@lists.sourceforge.net<mailto:pymol-users@lists.sourceforge.net>
Subject: Re: [PyMOL] How to store matrix settings for individual scenes?

Hi Carsten -

I'd probably create new objects and use those for superimposition, rather than 
moving the originals.  That would leave your scenes intact.

Cheers,
Jared

--
Jared Sampson
Columbia University

On Mar 7, 2016, at 12:10 PM, Schubert, Carsten [JRDUS] 
<cschu...@its.jnj.com<mailto:cschu...@its.jnj.com>> wrote:

Hi,

I am trying to create a session file of a multimeric protein, in which each 
monomer is displayed first using the original  matrix settings broken out into 
individual scenes. After that all monomers are overlayed on top of each other 
and the superposition matrices are copied and applied to the ligands, etc. So 
far so good, however once the matrices are applied this also affects the 
matrices for the scenes created previous to the overlay and matrix_copy. Any 
way I can store the matrices in each scene instead of having them applied 
globally once?

Cheers,

                Carsten
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval_______________________________________________
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto:PyMOL-users@lists.sourceforge.net>)
Info Page: 
BLOCKEDlists[.]sourceforge[.]net/lists/listinfo/pymol-usersBLOCKED<x-msg://6/BLOCKEDlists%5b.%5dsourceforge%5b.%5dnet/lists/listinfo/pymol-usersBLOCKED>
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
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

Reply via email to