sort a list of residues based on the id.position values

Hi guys, how could I sort a list of residues based on their id.position value? thanks a lot jd Dr. Jean-Didier Maréchal Lecturer The Computational Biotechnological Chemistry Team Unitat de Química Física Departament de Química Universitat Autònoma de Barcelona Edifici C.n. 08193 Cerdanyola (Barcelona) Tel: +34.935814936 e-mail: JeanDidier.Marechal@uab.es www: http://asklipio.qf.uab.es ----- Missatge original ----- De: chimera-dev-request@cgl.ucsf.edu Data: Dijous, Octubre 18, 2012 9:00 pm Assumpte: Chimera-dev Digest, Vol 102, Issue 5
Send Chimera-dev mailing list submissions to chimera-dev@cgl.ucsf.edu
To subscribe or unsubscribe via the World Wide Web, visit http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev or, via email, send a message with subject or body 'help' to chimera-dev-request@cgl.ucsf.edu
You can reach the person managing the list at chimera-dev-owner@cgl.ucsf.edu
When replying, please edit your Subject line so it is more specific than "Re: Contents of Chimera-dev digest..."
Today's Topics:
1. Re: Moving a residue and an VRML object (Tom Goddard) 2. Re: Moving a residue and an VRML object (Greg Couch) 3. Re: Moving a residue and an VRML object (Eric Pettersen)
-------------------------------------------------------------------- --
Message: 1 Date: Wed, 17 Oct 2012 13:25:18 -0700 From: Tom Goddard <goddard@sonic.net> To: ladam <ladam@smbh.univ-paris13.fr> Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] Moving a residue and an VRML object Message-ID: <507F142E.4080906@sonic.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
The arrow you drew has no idea that the atoms have moved, so of course it doesn't move with them. If you just want to rigidly rotate the whole molecule in Python you can change the matrix that places it in space
mol.openState.xform = xf
instead of changing the coordinates of atoms. Then you could rigidly move the VRML model in the same way so that the arrow stays in the same position relative to the molecule.
vrml.openState.xform = xf
If you are not moving the molecule rigidly then you really do need to move individual atoms and then you will have to delete the old arrow and make a new arrow if it is intended to have its ends follow certain atoms. Tom
-------- Original Message -------- Subject: [chimera-dev] Moving a residue and an VRML object From: ladam To: chimera-dev@cgl.ucsf.edu Date: 10/17/12 4:45 AM
Hi all, I have a problem associating a vrml object an a molecule : Let's say I have an arrow created using the bild format to which I gave 0.0 0.0 0.0 coordinates. This arrow and the molecule translate/rotate together using the mouse.> Now if I translate / rotate my molecule using the setcoord command on the atoms in a python script, the arrow won't follow up the molecule.> I tried the addAssociatedModel command to link the arrow and the molecule but still the same result. How can I handle this? Thanks for your attention
------------------------------
Message: 2 Date: Wed, 17 Oct 2012 15:21:35 -0700 From: Greg Couch <gregc@cgl.ucsf.edu> To: Tom Goddard <goddard@sonic.net> Cc: chimera-dev@cgl.ucsf.edu, ladam <ladam@smbh.univ-paris13.fr> Subject: Re: [chimera-dev] Moving a residue and an VRML object Message-ID: <507F2F6F.30800@cgl.ucsf.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Salut,
The other trick is to give the VRML model the same model id and submodel id as its associated model. Then the openState is identical, so there would be no need to copy the transformation matrix. Again, this only works for rigid rotations.
-- Greg
On 10/17/2012 01:25 PM, Tom Goddard wrote:
The arrow you drew has no idea that the atoms have moved, so of course it doesn't move with them. If you just want to rigidly rotate the whole molecule in Python you can change the matrix that places it in space
mol.openState.xform = xf
instead of changing the coordinates of atoms. Then you could rigidly move the VRML model in the same way so that the arrow stays in the same position relative to the molecule.
vrml.openState.xform = xf
If you are not moving the molecule rigidly then you really do need to move individual atoms and then you will have to delete the old arrow and make a new arrow if it is intended to have its ends follow certain atoms.
Tom
-------- Original Message -------- Subject: [chimera-dev] Moving a residue and an VRML object From: ladam To: chimera-dev@cgl.ucsf.edu Date: 10/17/12 4:45 AM
Hi all, I have a problem associating a vrml object an a molecule : Let's say I have an arrow created using the bild format to which I gave 0.0 0.0 0.0 coordinates. This arrow and the molecule translate/rotate together using the mouse.>> Now if I translate / rotate my molecule using the setcoord command on the atoms in a python script, the arrow won't follow up the molecule.>> I tried the addAssociatedModel command to link the arrow and the molecule but still the same result. How can I handle this? Thanks for your attention
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
------------------------------
Message: 3 Date: Wed, 17 Oct 2012 15:26:03 -0700 From: Eric Pettersen <pett@cgl.ucsf.edu> To: ladam <ladam@smbh.univ-paris13.fr> Cc: chimera-dev BB <chimera-dev@cgl.ucsf.edu> Subject: Re: [chimera-dev] Moving a residue and an VRML object Message-ID: <C66C5891-76C8-4D20-B82E-572E6F919DF2@cgl.ucsf.edu> Content-Type: text/plain; charset="us-ascii"
On Oct 17, 2012, at 3:21 PM, Greg Couch wrote:
Salut,
The other trick is to give the VRML model the same model id and submodel id as its associated model. Then the openState is identical, so there would be no need to copy the transformation matrix. Again, this only works for rigid rotations.
...and the simplest way to do this is to supply the "sameAs" keyword, with the associated model as the argument, to the openModels.add() or openModels.open() call that you use.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

Sort a list of residues by residue number: rlist = mol.residues rlist.sort(key = lambda r: r.id.position) -------- Original Message -------- Subject: [chimera-dev] sort a list of residues based on the id.position values From: Jean Didier Pie Marechal To: chimera-dev@cgl.ucsf.edu Date: 10/26/12 6:49 AM
Hi guys,
how could I sort a list of residues based on their id.position value?
thanks a lot jd
Dr. Jean-Didier Maréchal Lecturer The Computational Biotechnological Chemistry Team Unitat de Química Física Departament de Química Universitat Autònoma de Barcelona Edifici C.n. 08193 Cerdanyola (Barcelona) Tel: +34.935814936 www: http://asklipio.qf.uab.es
participants (2)
-
Jean Didier Pie Marechal
-
Tom Goddard