From menetret at bu.edu Sun Apr 2 15:33:59 2006 From: menetret at bu.edu (jean-francois menetret) Date: Sun, 2 Apr 2006 18:33:59 -0400 (EDT) Subject: [Chimera-users] trigonometry Message-ID: What is Chimera's trigonometry convention ? How can get angles out of the rotation matrix (saved with "matrixget") ? Jean-Fran?ois M?n?tret, PhD Boston University School of Medicine Physiology and Biophysics Department 700 Albany Street W315 Boston, MA 02118 Email: menetret at bu.edu Mailing address: 715 Albany Street From goddard at cgl.ucsf.edu Mon Apr 3 11:05:48 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Mon, 3 Apr 2006 11:05:48 -0700 (PDT) Subject: [Chimera-users] trigonometry In-Reply-To: (message from jean-francois menetret on Sun, 2 Apr 2006 18:33:59 -0400 (EDT)) References: Message-ID: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> Hi Jean-Francois, The Chimera matrixget command writes out a 3 by 4 matrix to a file like: Model 0.0 0.440056 0.454627 0.774381 -31.4343 0.0100309 0.859825 -0.51049 20.8174 -0.897914 0.232412 0.373811 25.777 The first 3 columns are a 3 by 3 rotation matrix and the 4th column is an amount to translate. This matrix tells how to rotate and translate the original data set to its current position in the Chimera coordinate system. Another way to look at it is that the data set x-axis is pointed in the direction of the first column of this matrix in the Chimera coordinate system. In the above case the data set x-axis is oriented in direction (0.440056, 0.0100309, -0.897914) in Chimera coordinates, so pointed roughly in the -z direction which is into the screen. I'm not sure what angles you want. We don't have a routine to produce Euler angles from the rotation matrix although the formulas could be found in a textbook. If you want Euler angles, I can probably look it up and give you some Python code that will report those directly from Chimera. Another possibility is to get the axis and amount of rotation for the above rotation matrix. That is can also easily be done using Python in Chimera. Let me know if you are interested in those details. Tom From menetret at bu.edu Mon Apr 3 11:47:27 2006 From: menetret at bu.edu (jean-francois menetret) Date: Mon, 3 Apr 2006 14:47:27 -0400 (EDT) Subject: [Chimera-users] trigonometry In-Reply-To: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> References: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> Message-ID: Hi Tom, thank you for your answer, I found these formulas to get the angles out of the rotation matrix [xx, yx, zx, px; xy, yy, zy, py; xz, yz, zz, pz;] roll (rotation around z) : atan2(xy, xx) pitch (rotation around y) : -arcsin(xz) yaw (rotation around x) : atan2(yz,zz) (from http://www.codeguru.com/forum/archive/index.php/t-329530.html) Now I am trying to go from these angles (yaw,pitch,roll) to euler angles. ... and IT IS NOT easy ... :^) I would appreciate any help Jean-Francois On Mon, 3 Apr 2006, Thomas Goddard wrote: > Hi Jean-Francois, > The Chimera matrixget command writes out a 3 by 4 matrix to a file like: > Model 0.0 > 0.440056 0.454627 0.774381 -31.4343 > 0.0100309 0.859825 -0.51049 20.8174 > -0.897914 0.232412 0.373811 25.777 > > The first 3 columns are a 3 by 3 rotation matrix and the 4th column is > an amount to translate. This matrix tells how to rotate and translate > the original data set to its current position in the Chimera coordinate > system. Another way to look at it is that the data set x-axis is pointed > in the direction of the first column of this matrix in the Chimera > coordinate system. In the above case the data set x-axis is oriented > in direction (0.440056, 0.0100309, -0.897914) in Chimera coordinates, > so pointed roughly in the -z direction which is into the screen. > > I'm not sure what angles you want. We don't have a routine to produce > Euler angles from the rotation matrix although the formulas could be > found in a textbook. If you want Euler angles, I can probably look it > up and give you some Python code that will report those directly from > Chimera. Another possibility is to get the axis and amount of rotation > for the above rotation matrix. That is can also easily be done using > Python in Chimera. Let me know if you are interested in those details. > > Tom > From gregc at cgl.ucsf.edu Mon Apr 3 11:52:11 2006 From: gregc at cgl.ucsf.edu (Greg Couch) Date: Mon, 3 Apr 2006 11:52:11 -0700 (PDT) Subject: [Chimera-users] trigonometry In-Reply-To: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> References: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> Message-ID: On Mon, 3 Apr 2006, Thomas Goddard wrote: > Hi Jean-Francois, > > The Chimera matrixget command writes out a 3 by 4 matrix to a file like: > > Model 0.0 > 0.440056 0.454627 0.774381 -31.4343 > 0.0100309 0.859825 -0.51049 20.8174 > -0.897914 0.232412 0.373811 25.777 > > The first 3 columns are a 3 by 3 rotation matrix and the 4th column is > an amount to translate. This matrix tells how to rotate and translate > the original data set to its current position in the Chimera coordinate > system. Another way to look at it is that the data set x-axis is pointed > in the direction of the first column of this matrix in the Chimera > coordinate system. In the above case the data set x-axis is oriented > in direction (0.440056, 0.0100309, -0.897914) in Chimera coordinates, > so pointed roughly in the -z direction which is into the screen. > > I'm not sure what angles you want. We don't have a routine to produce > Euler angles from the rotation matrix although the formulas could be > found in a textbook. If you want Euler angles, I can probably look it > up and give you some Python code that will report those directly from > Chimera. Another possibility is to get the axis and amount of rotation > for the above rotation matrix. That is can also easily be done using > Python in Chimera. Let me know if you are interested in those details. > > Tom In other words, chimera uses a right-handed coordinate system, and there is an implicit forth row containing (0 0 0 1). If you were to transform a point using the matrix, you would write it as a column vector (x y z 1)T to the right of the matrix. The 4x4 matrix is a homogeneous transformation matrix that combines both rotation and translation. The chimera form matches math and physics uses of rotation matrices, and the transpose matches the form in many computer graphics texts. - Greg From goddard at cgl.ucsf.edu Mon Apr 3 14:00:04 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Mon, 3 Apr 2006 14:00:04 -0700 (PDT) Subject: [Chimera-users] trigonometry In-Reply-To: (message from jean-francois menetret on Mon, 3 Apr 2006 14:47:27 -0400 (EDT)) References: <200604031805.k33I5mKA1696231@guanine.cgl.ucsf.edu> Message-ID: <200604032100.k33L048R1809497@guanine.cgl.ucsf.edu> Hi Jean-Francois, The following web page gives a short block of code that determines Euler angles (called heading, attitude, and bank on that page) http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm That page also wisely suggests that you shouldn't convert to Euler angles unless you have to -- for example if you are using a program that will only accept Euler angles. They have bad characteristics -- different sets of Euler angles can be used to represent the same rotation. Tom From dekonerding at lbl.gov Mon Apr 3 15:06:21 2006 From: dekonerding at lbl.gov (David E. Konerding) Date: Mon, 03 Apr 2006 15:06:21 -0700 Subject: [Chimera-users] Please consider adding PyTables to Chimera Message-ID: <44319C5D.2020106@lbl.gov> Hello, Recently I have been converting most of my scientific data to the HDF5 format. HDF5 is a powerful, high performance data format library. I found an absolutely wonderful open source code, PyTables, which provides an HDF5 interface. It adds enormous value to HDF5 by making it much easier to use, and exposing a lot of the complex functionality that HDF5 supports (such as variable-length records). http://www.pytables.org/moin I would really appreciate it if you guys would consider adding PyTables. I would definitely convert a lot of my existing extensions and processing tools to use PyTables- for example, when I analyze trajectories to find hydrogen bond data and use that to render long movies, PyTables makes it a lot easier (I already used the Chimera headers to build my own copy of PyTables on Linux, but it would be a lot more painful to do on Windows). PyTables depends on numarray (although it also provides Numeric Python support). I'd like to see numarray in Chimera as well (although I could live with just Numeric support) Dave From cwmoad at gmail.com Mon Apr 3 15:24:43 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 3 Apr 2006 18:24:43 -0400 Subject: [Chimera-users] Please consider adding PyTables to Chimera In-Reply-To: <44319C5D.2020106@lbl.gov> References: <44319C5D.2020106@lbl.gov> Message-ID: <6382066a0604031524t7daecae5pda109546064ef15b@mail.gmail.com> On 4/3/06, David E. Konerding wrote: > Hello, > > Recently I have been converting most of my scientific data to the HDF5 > format. HDF5 is a powerful, high performance data format library. > I found an absolutely wonderful open source code, PyTables, which > provides an HDF5 interface. It adds enormous value to HDF5 > by making it much easier to use, and exposing a lot of the complex > functionality that HDF5 supports (such as variable-length records). > > http://www.pytables.org/moin > > I would really appreciate it if you guys would consider adding > PyTables. I would definitely convert a lot of my existing extensions > and processing tools > to use PyTables- for example, when I analyze trajectories to find > hydrogen bond data and use that to render long movies, PyTables > makes it a lot easier (I already used the Chimera headers to build my > own copy of PyTables on Linux, but it would be a lot more painful to do > on Windows). Actually windows is pretty much binary compatible, so just download the tables-1.3.win32-py2.4.exe and copy the module into chimera's site-packages folder. I have done this with numpy and matplotlib. You'll have to also get the hdf5 just as if you were normally installing on windows. Info found here, http://www.pytables.org/docs/manual/x457.html . > PyTables depends on numarray (although it also provides Numeric Python > support). I'd like to see numarray in Chimera as well > (although I could live with just Numeric support) PyTables also supports numpy now, which is the new agreed pyarray package. I have been using numpy in chimera with no problems. The one hitch on OSX is that numpy and Numeric can't be imported in the same script (complaints about multiarray.so). It's not a problem on other platforms. I believe I made an informal request on the dev list to migrate completely from Numeric to numpy, but this probably doesn't make sense until the numpy 1.0 release. Actually the OSX issue brings up another feature request. I have a plugin that creates a surface as seen in, http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Reference/surface.html . Could this approach please support float32 numpy arrays as well? I have to do a numpy->Numeric hack in windows/linux, but I can't do this in OSX due to the import issue. Thanks, Charlie From goddard at cgl.ucsf.edu Mon Apr 3 17:07:24 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Mon, 3 Apr 2006 17:07:24 -0700 (PDT) Subject: [Chimera-users] Please consider adding PyTables to Chimera In-Reply-To: <44319C5D.2020106@lbl.gov> (dekonerding@lbl.gov) References: <44319C5D.2020106@lbl.gov> Message-ID: <200604040007.k3407OAx1742017@guanine.cgl.ucsf.edu> Hi Dave, I've been asked about HDF5 support in Chimera from Matt Dougherty who handles large volume data sets. He was investigating using it and I'm not sure if he adopted it for his data analysis. But that may be another use of HDF5 in Chimera. Tom From goddard at cgl.ucsf.edu Mon Apr 3 17:15:38 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Mon, 3 Apr 2006 17:15:38 -0700 (PDT) Subject: [Chimera-users] Please consider adding PyTables to Chimera In-Reply-To: <6382066a0604031524t7daecae5pda109546064ef15b@mail.gmail.com> (cwmoad@gmail.com) References: <44319C5D.2020106@lbl.gov> <6382066a0604031524t7daecae5pda109546064ef15b@mail.gmail.com> Message-ID: <200604040015.k340Fcm31815622@guanine.cgl.ucsf.edu> Hi Charlie, Currently Chimera uses Numeric and not numarray or Numpy. I write my own Python wrappers for our Chimera C++ code that uses Numeric for volume data because our wrapping program (wrappy) does not handle this. So it is some work to switch to Numpy, and I am unlikely to do so until it is absolutely clear that Numpy is superceding Numeric and numarray. What is the multiarray.so error on OSX when you use Numeric and Numpy? If there is a shared library conflict, then I probably will have the same trouble if our C++ code tries to support reading both formats for surfaces. Tom From cwmoad at gmail.com Mon Apr 3 17:25:51 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 3 Apr 2006 20:25:51 -0400 Subject: [Chimera-users] Please consider adding PyTables to Chimera In-Reply-To: <200604040015.k340Fcm31815622@guanine.cgl.ucsf.edu> References: <44319C5D.2020106@lbl.gov> <6382066a0604031524t7daecae5pda109546064ef15b@mail.gmail.com> <200604040015.k340Fcm31815622@guanine.cgl.ucsf.edu> Message-ID: <6382066a0604031725t2e9e547aya0103248fdeda2d2@mail.gmail.com> On 4/3/06, Thomas Goddard wrote: > Hi Charlie, > > Currently Chimera uses Numeric and not numarray or Numpy. I write > my own Python wrappers for our Chimera C++ code that uses Numeric for > volume data because our wrapping program (wrappy) does not handle > this. So it is some work to switch to Numpy, and I am unlikely to do > so until it is absolutely clear that Numpy is superceding Numeric and > numarray. > > What is the multiarray.so error on OSX when you use Numeric and Numpy? > If there is a shared library conflict, then I probably will have the > same trouble if our C++ code tries to support reading both formats for > surfaces. >>> import numpy >>> import Numeric Traceback (most recent call last): File "", line 1, in ? import Numeric File "/Applications/Chimera.app/Contents/Resources/lib/python2.4/site-packages/Numeric/Numeric.py", line 91, in ? import multiarray SystemError: dynamic module not initialized properly They both work fine when used separately. I have no clue what OSX does differently to bring this up. From nimrodg at post.tau.ac.il Tue Apr 4 01:32:51 2006 From: nimrodg at post.tau.ac.il (Guy Nimrod) Date: Tue, 4 Apr 2006 11:32:51 +0300 Subject: [Chimera-users] question about CHIMERA Message-ID: <000f01c657c2$5c70dc10$bd2a4284@NirB5> Hello, I am a PhD student in the department of Biochemistry of the Tel-Aviv University and often use your great application, CHIMERA. Is it possible to view on chimera the selected part only? Regarding this, is it possible to split a model to its units (so each chain/ligand) will be considered as a model? Thanks Guy Nimrod http://ashtoret.tau.ac.il/~nimrodg -------------- next part -------------- An HTML attachment was scrubbed... URL: From meng at cgl.ucsf.edu Tue Apr 4 09:57:43 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Tue, 4 Apr 2006 09:57:43 -0700 Subject: [Chimera-users] question about CHIMERA In-Reply-To: <000f01c657c2$5c70dc10$bd2a4284@NirB5> References: <000f01c657c2$5c70dc10$bd2a4284@NirB5> Message-ID: <0e0035e7c9b0ad2c6b2e6abf604b26f6@cgl.ucsf.edu> Hi Guy, > ? > I am a PhD student in the department of Biochemistry of the Tel-Aviv > University and often use your great application, CHIMERA. > ? > Is it possible to view on chimera the selected part only? Regarding > this, is it possible to split a model to its units (so each > chain/ligand) will be considered as a model? Thanks for your kind note! Yes, you can show just the selected part; for just atoms and bonds, the command show sel or ~disp; disp sel would do it. If you also wanted to show ribbon and/or surface for just the selection, the easiest way would be to undisplay everything and then display the ribbon and/or surface for just the selected part. In commands, that would be ~ribbon; ~surf ribbon sel; surf sel You could do the same thing with the menus, but in that case you would Hide the ribbon and surface before making the selection, then make the selection, then use the menus to Show ribbon/surface (which would automatically affect just the selected part). Currently you cannot split the model into multiple models. However, there are few ways you could end up with the parts in different models. (1) edit the file into multiple files before opening in Chimera (this is only good if you are comfortable with text editing) (2) select a part you want to make a separate model, write that out (Actions... Write PDB with "Save selected atoms only" turned on), read it back in (3) open the file multiple times and then delete from each model all the parts you don't want in that model (can be tedious if you have many chains). For example (commands below; you could also do it with selecting the part you want and then Select... Invert (selected models) and then Actions... Atoms/Bonds... delete): open myfile.pdb open myfile.pdb sel #0:.a sel invert sel delete sel sel #1:.b sel invert sel delete sel This would give model 0 containing only chain A and model 1 containing only chain B. I hope one of these options will be useful for you! Elaine ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html From meng at cgl.ucsf.edu Tue Apr 4 10:25:37 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Tue, 4 Apr 2006 10:25:37 -0700 Subject: [Chimera-users] question about CHIMERA In-Reply-To: <0e0035e7c9b0ad2c6b2e6abf604b26f6@cgl.ucsf.edu> References: <000f01c657c2$5c70dc10$bd2a4284@NirB5> <0e0035e7c9b0ad2c6b2e6abf604b26f6@cgl.ucsf.edu> Message-ID: <5f6280c3558f11213aee87e21bc7bb64@cgl.ucsf.edu> Hi Guy, Instead of hiding everything first, a shorter way would be to invert the selection before hiding or deleting. Say you wanted to show only the ligand. Menu example: Select.. Structure... ligand Select... Invert (either all models or selected models, depending what you really want) Actions... Atoms/Bonds (Ribbon,Surface)... hide (you could delete instead of hiding if you really want the other atoms gone) Commands example: ~disp ~ ligand That means undisplay everything that is not ligand. You could also do it the longer way with selecting, inverting, etc., and/or use "delete" instead of "~disp" There are multiple ways to do everything in Chimera! I hope this wasn't too confusing, Elaine From esanzgar at terra.es Tue Apr 4 11:07:51 2006 From: esanzgar at terra.es (Eduardo Sanz Garcia) Date: Tue, 04 Apr 2006 12:07:51 -0600 Subject: [Chimera-users] Collaboratory session Message-ID: <4432B5F7.5010306@terra.es> I have been trying to set up a collaboratory session, but I could not see the model. I was able to chat and to see the pointer of the other person, anything else. Any idea? How can I know if it is a problem caused by the firewall? From goddard at cgl.ucsf.edu Tue Apr 4 11:57:03 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Tue, 4 Apr 2006 11:57:03 -0700 (PDT) Subject: [Chimera-users] Please consider adding PyTables to Chimera In-Reply-To: <6382066a0604031725t2e9e547aya0103248fdeda2d2@mail.gmail.com> (cwmoad@gmail.com) References: <44319C5D.2020106@lbl.gov> <6382066a0604031524t7daecae5pda109546064ef15b@mail.gmail.com> <200604040015.k340Fcm31815622@guanine.cgl.ucsf.edu> <6382066a0604031725t2e9e547aya0103248fdeda2d2@mail.gmail.com> Message-ID: <200604041857.k34Iv3R71735648@guanine.cgl.ucsf.edu> Hi Charlie, The error when importing numpy and Numeric on Mac OSX is something to be solved by the numpy developers. When NumPy 1.0 comes out we will look at switching Chimera to use it. If we switch we will drop Numeric support. Chimera uses about 25 third-party Python modules and maintaining them takes time away from developing new features. The main consideration will be that NumPy is the most reliable, stable, trouble-free solution. Tom > Date: Mon, 3 Apr 2006 20:25:51 -0400 > From: "Charlie Moad" > To: "Thomas Goddard" > Subject: Re: [Chimera-users] Please consider adding PyTables to Chimera > Cc: chimera-users at cgl.ucsf.edu > > >>> import numpy > >>> import Numeric > Traceback (most recent call last): > File "", line 1, in ? > import Numeric > File "/Applications/Chimera.app/Contents/Resources/lib/python2.4/site-packages/Numeric/Numeric.py", > line 91, in ? > import multiarray > SystemError: dynamic module not initialized properly > > They both work fine when used separately. I have no clue what OSX > does differently to bring this up. From goddard at cgl.ucsf.edu Tue Apr 4 12:09:36 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Tue, 4 Apr 2006 12:09:36 -0700 (PDT) Subject: [Chimera-users] Chains as separate molecules In-Reply-To: <000f01c657c2$5c70dc10$bd2a4284@NirB5> (nimrodg@post.tau.ac.il) References: <000f01c657c2$5c70dc10$bd2a4284@NirB5> Message-ID: <200604041909.k34J9aNZ1739050@guanine.cgl.ucsf.edu> Hi Guy, I added a Chimera command called "split" that makes separate molecules out of the chains of a molecule you have opened in Chimera. It is available on the Experimental Chimera Features web page (linked from Chimera download page): http://www.cgl.ucsf.edu/chimera/experimental/experimental.html Tom From cwmoad at gmail.com Tue Apr 4 12:18:32 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Tue, 4 Apr 2006 15:18:32 -0400 Subject: [Chimera-users] Chains as separate molecules In-Reply-To: <200604041909.k34J9aNZ1739050@guanine.cgl.ucsf.edu> References: <000f01c657c2$5c70dc10$bd2a4284@NirB5> <200604041909.k34J9aNZ1739050@guanine.cgl.ucsf.edu> Message-ID: <6382066a0604041218y8278284jb51b6daf528cd97f@mail.gmail.com> This raises a question in my mind. Is there an easy way to make a deep copy of a molecule from the python interface? On 4/4/06, Thomas Goddard wrote: > Hi Guy, > > I added a Chimera command called "split" that makes separate molecules > out of the chains of a molecule you have opened in Chimera. It is available > on the Experimental Chimera Features web page (linked from Chimera download > page): > > http://www.cgl.ucsf.edu/chimera/experimental/experimental.html > > Tom > _______________________________________________ > Chimera-users mailing list > Chimera-users at cgl.ucsf.edu > http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users > From goddard at cgl.ucsf.edu Tue Apr 4 12:35:05 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Tue, 4 Apr 2006 12:35:05 -0700 (PDT) Subject: [Chimera-users] Chains as separate molecules In-Reply-To: <6382066a0604041218y8278284jb51b6daf528cd97f@mail.gmail.com> (cwmoad@gmail.com) References: <000f01c657c2$5c70dc10$bd2a4284@NirB5> <200604041909.k34J9aNZ1739050@guanine.cgl.ucsf.edu> <6382066a0604041218y8278284jb51b6daf528cd97f@mail.gmail.com> Message-ID: <200604041935.k34JZ5Ha1746405@guanine.cgl.ucsf.edu> Hi Charlie, There is not a standard molecule deep copy routine in Chimera. The "split" command python code (in __init__.py) contains about 80 lines of code to copy atoms of a chain as a separate molecule, preserving most of the display style (ribbon, sphere, coloring, ...). It does not preserve everything, for example, if you change atom radii or bond linewidth, I didn't copy these attributes. Why not? Laziness. Two other Chimera tools, Unit Cell and Multiscale Models, also copy molecules and they use other code (written by me): share/PDBmatrices/copymolecule.py This is even a more basic copying (36 lines of code) that copies only the data (atom names, connectivity, residue numbers) but not the display attributes like colors, ribbon display, atom style (sphere, ball and stick, ...). We probably should have a copy routine that copies everything but it hasn't been a pressing need so far. Tom From Klinkhardt at em.uni-frankfurt.de Wed Apr 5 06:14:57 2006 From: Klinkhardt at em.uni-frankfurt.de (Klinkhardt at em.uni-frankfurt.de) Date: Wed, 05 Apr 2006 15:14:57 +0200 Subject: [Chimera-users] further levels of detail in low-res surface of a single chain Multiscale model Message-ID: <20060405151457.g3b8s9przbwwk8k0@webmail.server.uni-frankfurt.de> Hello, I would like to divide/define the low-res structure of a multiscale model which contains only one chain. I need further levels of detail in this single chain (preferentially all single nucleotide bases as small podgy shapes and the backbone of phosphate-sugars as an irregular rope) so I can can animate the resulating smaller units later. In your online hept (documentation) there is written that a python script like #bluetongue.py# can create a multiscale model with further levels of (individual?) structure. I have opend the python script but unfortunately I am no programmer so I am not able to modify this script to my requirements. Is there a #more general# script which I can use for my chain or any other workaround?? Thanks a lot in advance, best regards Ute Klinkhardt From goddard at cgl.ucsf.edu Wed Apr 5 10:37:05 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Wed, 5 Apr 2006 10:37:05 -0700 (PDT) Subject: [Chimera-users] further levels of detail in low-res surface of a single chain Multiscale model In-Reply-To: <20060405151457.g3b8s9przbwwk8k0@webmail.server.uni-frankfurt.de> (Klinkhardt@em.uni-frankfurt.de) References: <20060405151457.g3b8s9przbwwk8k0@webmail.server.uni-frankfurt.de> Message-ID: <200604051737.k35Hb5gA2076597@guanine.cgl.ucsf.edu> Hi Ute, Here are two ideas about how to get nucleic acid depictions with bases and backbone as distinct blobs. Both use the Multiscale tool. One idea is just use a resolution of 1 angstrom in the multiscale tool. Also adjust two other multiscale surfacing parameters by pressing the "..." checkbutton to the right of the Resolution field in the multiscale dialog. Change "Threshold atom density" to 0.01 to get a fatter surface. And change smoothing iterations to 5 to get a smoother surface. Here is the result on PDB 100d: http://www.cgl.ucsf.edu/home/goddard/temp/100d-1A-5i.png A second approach is to make each base be a separate surface, and have the backbone be a separate surface. The trick to doing this is to give each base a separate PDB chain id. The multiscale tool makes a surface for each separate chain. You can do this by just editting the PDB file changing the chain ids for each base. That is pretty tedious work so I made a script that can do that in Chimera. It is available on the Chimera experimental feature page along with pictures of the resulting Multiscale surfaces: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html A third idea (not using multiscale) is to use the Chimera Nucleotides tools (menu entry Tools / Depiction / Nucleotides). It can depict bases as discs or rectangular slabs. Here is an example from the Chimera image gallery http://www.cgl.ucsf.edu/chimera/ImageGallery/entries/pret.html and here is a tutorial about how that image was made. http://www.cgl.ucsf.edu/Outreach/Workshops/UCI-2005/02-PubPres/Publish_Tutorial.html Tom From esanzgar at terra.es Thu Apr 6 14:15:18 2006 From: esanzgar at terra.es (Eduardo Sanz Garcia) Date: Thu, 06 Apr 2006 15:15:18 -0600 Subject: [Chimera-users] Name selection Message-ID: <443584E6.2020700@terra.es> Hi everybody, Is there any way to give a name to a selection from the command line? Same as: *Select... Name Selection...* but from the command line. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From meng at cgl.ucsf.edu Thu Apr 6 14:37:15 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Thu, 6 Apr 2006 14:37:15 -0700 Subject: [Chimera-users] Name selection In-Reply-To: <443584E6.2020700@terra.es> References: <443584E6.2020700@terra.es> Message-ID: <450230E1-DC3E-4E77-9D51-2BDFCE11F1F5@cgl.ucsf.edu> Hi Eduardo, We intend to add a command to name the selection, but this has not yet been done. In the meanwhile, the "alias" command might do what you need. For example, instead of first selecting command> select ions z<5 & :/kdHydrophobicity>1 & ~ :trp (residues within 5 Angstroms of ions, with Kyte-Doolittle hydrophobicity greater than 1, but not tryptophans) and then naming the selection, you could alias the expression and reuse it: command> alias mystuff ions z<5 & :/kdHydrophobicity>1 & ~ :trp command> col byatom mystuff command> repr stick mystuff (etc.) or even command> sel mystuff if you needed the atoms to be selected for some other purpose. Man page for "alias": http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/alias.html Man page for command-line specifications: http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/ frameatom_spec.html I hope this helps, Elaine On Apr 6, 2006, at 2:15 PM, Eduardo Sanz Garcia wrote: > Hi everybody, > > Is there any way to give a name to a selection from the command line? > Same as: Select... Name Selection... but from the command line. > > Thank you. ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html From esanzgar at terra.es Fri Apr 7 11:04:01 2006 From: esanzgar at terra.es (Eduardo Sanz Garcia) Date: Fri, 07 Apr 2006 12:04:01 -0600 Subject: [Chimera-users] Read PDB file Message-ID: <4436A991.1090506@terra.es> Hi, Is it possible to read the PDB file of the molecule directly from chimera? Thank you Eduardo Sanz From meng at cgl.ucsf.edu Fri Apr 7 11:08:26 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Fri, 7 Apr 2006 11:08:26 -0700 Subject: [Chimera-users] Read PDB file In-Reply-To: <4436A991.1090506@terra.es> References: <4436A991.1090506@terra.es> Message-ID: Hi Eduardo, I am not sure what you mean. Do you mean read a PDB file directly from the Protein Data Bank into Chimera? You can do that with File... Fetch by ID or even using the command line, for example, command> open 2gbp If that's not what you mean, please provide more details... I hope this helps, Elaine On Apr 7, 2006, at 11:04 AM, Eduardo Sanz Garcia wrote: > Hi, > > Is it possible to read the PDB file of the molecule directly from > chimera? > > Thank you > > Eduardo Sanz ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html From meng at cgl.ucsf.edu Fri Apr 7 11:38:29 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Fri, 7 Apr 2006 11:38:29 -0700 Subject: [Chimera-users] Read PDB file In-Reply-To: <4436AF8C.30906@terra.es> References: <4436A991.1090506@terra.es> <4436AF8C.30906@terra.es> Message-ID: Hi Eduardo, Aha! You can see all the header information from the PDB file (the lines that come before the coordinates). How to do that: open the Model Panel (Favorites... Model Panel) and for the model you are interested in, click "attributes..." Click the "PDB Headers..." button at the bottom of the resulting attributes panel. Currently the header lines are shown in a different order than in the original PDB file (they are sorted alphabetically by type, but wthin each type such as REMARK the order is not changed), so you will have to scroll down to the SOURCE record to see the organism. Best, Elaine On Apr 7, 2006, at 11:29 AM, Eduardo Sanz Garcia wrote: > My real situation: > 1. I have File... Fletch by ID using 2ypi > 2. I didn't know what source organism they are using to get the > structure. > > Option a: go to www.pdb.org and obtain the information. > Option from chimera?: display the text file 2ypi.pdb to get the > necessary information? > > I was wondering if there is a command or function to display (the > text) of a PDB file. > ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html From goddard at cgl.ucsf.edu Fri Apr 7 15:04:16 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Fri, 7 Apr 2006 15:04:16 -0700 (PDT) Subject: [Chimera-users] Move atoms with mouse Message-ID: <200604072204.k37M4G6Y1852521@guanine.cgl.ucsf.edu> I put a tool on the Chimera experimental features web page that enhances the standard rotation and translation mouse modes (left and middle mouse buttons) to enable moving helices, strands, turns, PDB chains, any selected set of atoms, or multiscale model chains. http://www.cgl.ucsf.edu/chimera/experimental/experimental.html The molecular pieces are translated or rotated by dragging them with the mouse. It requires Chimera version 1.2206 or newer, and that is only available for Macintosh computers right now. Tom From shafriry at mail.nih.gov Fri Apr 7 13:14:40 2006 From: shafriry at mail.nih.gov (Shafrir, Yinon (NIH/NCI) [F]) Date: Fri, 7 Apr 2006 16:14:40 -0400 Subject: [Chimera-users] Newbie Questions Message-ID: Hi there! I have two questions regarding using Chimera. How do you break a molecule to different models using the command line? I have a protein composed of 4 chains. It loads as one piece and designated model 0 I then select a single chain and I want to designate it as a new model. How do I do that using the command line (so I can write a script)? Also, when I select the chain and use the write command in this manner "write selected su1.pdb" the save dialog box pops up (even though I designated a filename) When I try "write selected 0 su1.pdb" nothing happens. My other question is: How can you force chimera to assign secondary type display to residues without editing the PDB file first? Say I want to show 30 residues that are not detected by ksdssp as beta sheets. Still, I want to represent them as beta sheets. Do I need to edit the pdb file? Best regards Yinon Shafrir -------------- next part -------------- An HTML attachment was scrubbed... URL: From shafriry at mail.nih.gov Fri Apr 7 13:17:56 2006 From: shafriry at mail.nih.gov (Shafrir, Yinon (NIH/NCI) [F]) Date: Fri, 7 Apr 2006 16:17:56 -0400 Subject: [Chimera-users] Newbie Questions Message-ID: Hi there! I have two questions regarding using Chimera. How do you break a molecule to different models using the command line? I have a protein composed of 4 chains. It loads as one piece and designated model 0 I then select a single chain and I want to designate it as a new model. How do I do that using the command line (so I can write a script)? Also, when I select the chain and use the write command in this manner "write selected su1.pdb" the save dialog box pops up (even though I designated a filename) When I try "write selected 0 su1.pdb" nothing happens. My other question is: How can you force chimera to assign secondary type display to residues without editing the PDB file first? Say I want to show 30 residues that are not detected by ksdssp as beta sheets. Still, I want to represent them as beta sheets. Do I need to edit the pdb file? Best regards Yinon Shafrir -------------- next part -------------- An HTML attachment was scrubbed... URL: From meng at cgl.ucsf.edu Mon Apr 10 09:35:49 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Mon, 10 Apr 2006 09:35:49 -0700 Subject: [Chimera-users] Newbie Questions In-Reply-To: References: Message-ID: Hi Shafrir, (1) The write command that you gave should have worked to write the file without bringing up a save dialog. I just tried this in version 1.2199 on the mac and it worked correctly. You could send more information on this problem (version used, platform, any error messages) to chimera-bugs at cgl.ucsf.edu Although there is no command to split a model in the released Chimera, you can download an "experimental feature" to do it. Instead of putting a *selected* chain into a different model, however, it puts each chain in the original file into a separate model. The split command is about the fourth thing on the experimental features page: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html Actually, I'm not sure what your script is doing, so another possible approach would be to delete the rest of the chains, resulting in a model with only your chain of interest. For example: command> sel :.a command> sel invert sel command> delete sel (2) To assign secondary structure arbitrarily (without using the ksdssp program), select the residues of interest, and click the button on the lower right corner of Chimera to open the Selection Inspector. In the Selection Inspector, change to Inspect Residue, then set "in helix" to false and "in strand" to true. If you wanted to save (write) the file for later, the changed assignments will be reflected in the HELIX and SHEET records. I hope this helps, Elaine p.s. no need to send the mail twice (delay is only because our moderator has to approve the message sometimes) On Apr 7, 2006, at 1:17 PM, Shafrir, Yinon ((NIH/NCI)) [F] wrote: > Hi there! > > > > I have two questions regarding using Chimera. > > > > How do you break a molecule to different models using the command > line? > > I have a protein composed of 4 chains. It loads as one piece and > designated model 0 > > > > I then select a single chain and I want to designate it as a new > model. How do I do that using the command line (so I can write a > script)? > > > > Also, when I select the chain and use the write command in this > manner ?write selected su1.pdb? the save dialog box pops up (even > though I designated a filename) > > When I try ?write selected 0 su1.pdb? nothing happens. > > > > > > My other question is: > > How can you force chimera to assign secondary type display to > residues without editing the PDB file first? > > Say I want to show 30 residues that are not detected by ksdssp as > beta sheets. Still, I want to represent them as beta sheets. Do I > need to edit the pdb file? > > > > > > Best regards > > Yinon Shafrir > > > > _______________________________________________ > Chimera-users mailing list > Chimera-users at cgl.ucsf.edu > http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html From conrad at cgl.ucsf.edu Mon Apr 10 09:40:36 2006 From: conrad at cgl.ucsf.edu (Conrad Huang) Date: Mon, 10 Apr 2006 09:40:36 -0700 Subject: [Chimera-users] Collaboratory session In-Reply-To: <4432B5F7.5010306@terra.es> References: <4432B5F7.5010306@terra.es> Message-ID: <2BEAB3A7-D34B-4DF0-9E81-3A21A8BB30FF@cgl.ucsf.edu> Unfortunately, the collaboratory code in 1.2199 is broken. We've fixed it in-house. Can you please tell us what platforms (Windows, Mac, etc) you're working on, and we will put a snapshot release on the Chimera download web page in the next couple days. Conrad On Apr 4, 2006, at 11:07 AM, Eduardo Sanz Garcia wrote: > I have been trying to set up a collaboratory session, but I could not > see the model. I was able to chat and to see the pointer of the other > person, anything else. > Any idea? How can I know if it is a problem caused by the firewall? > _______________________________________________ > Chimera-users mailing list > Chimera-users at cgl.ucsf.edu > http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users From goddard at cgl.ucsf.edu Mon Apr 10 10:05:47 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Mon, 10 Apr 2006 10:05:47 -0700 (PDT) Subject: [Chimera-users] Newbie Questions In-Reply-To: (shafriry@mail.nih.gov) References: Message-ID: <200604101705.k3AH5l0P1605916@guanine.cgl.ucsf.edu> Hi Yinon, Elaine mentioned the split molecule command available from the Chimera experimental features page: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html For this to be useful in a script you have to know how it assigns new model numbers to the chains. I've just now changed the split molecule code so it assigns the model numbers in a predictable way. If you have model #0 with chains A, B, C, the "split" command will make 3 models: chain A is #0.1, chain B is #0.2, and chain C is #0.3. The chains are sorted alphabetically and each has the same model id number as the original model and a sub-id number. This improved "split" command is on the experimental features web page now. Tom From jordan.benjamin at gmail.com Mon Apr 10 15:05:48 2006 From: jordan.benjamin at gmail.com (Jordan Benjamin) Date: Mon, 10 Apr 2006 15:05:48 -0700 Subject: [Chimera-users] Axis display Message-ID: Is there a convenient way to display the axes of the coordinate system (and preferably the origin)? Forgive me if this is addressed in the documentation, but I wasn't able to find it. Thanks, Jordan From meng at cgl.ucsf.edu Mon Apr 10 15:16:26 2006 From: meng at cgl.ucsf.edu (Elaine Meng) Date: Mon, 10 Apr 2006 15:16:26 -0700 Subject: [Chimera-users] Axis display In-Reply-To: References: Message-ID: Hi Jordan, Currently Chimera does not have a "show axes" function, but if you open the attached file in Chimera, it generates a model showing the axes X, Y, and Z with red, yellow, and blue arrows, respectively. This is in the BILD file format, in which it is pretty easy to change the colors, dimensions, etc. of the objects. BILD format description: http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html I hope this helps, Elaine On Apr 10, 2006, at 3:05 PM, Jordan Benjamin wrote: > Is there a convenient way to display the axes of the coordinate system > (and preferably the origin)? Forgive me if this is addressed in the > documentation, but I wasn't able to find it. Thanks, > > Jordan ----- Elaine C. Meng, Ph.D. meng at cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html -------------- next part -------------- A non-text attachment was scrubbed... Name: axes.bild Type: application/octet-stream Size: 117 bytes Desc: not available URL: -------------- next part -------------- From pett at cgl.ucsf.edu Tue Apr 11 16:16:20 2006 From: pett at cgl.ucsf.edu (Eric Pettersen) Date: Tue, 11 Apr 2006 16:16:20 -0700 Subject: [Chimera-users] Newbie Questions In-Reply-To: References: Message-ID: <28754B2E-FE9F-4696-B04A-49A35F78B265@cgl.ucsf.edu> On Apr 7, 2006, at 1:17 PM, Shafrir, Yinon ((NIH/NCI)) [F] wrote: > Also, when I select the chain and use the write command in this > manner ?write selected su1.pdb? the save dialog box pops up (even > though I designated a filename) > > When I try ?write selected 0 su1.pdb? nothing happens. Elaine covered most of the answer here. Just a couple of things... The first write command you mention is missing the model number. So Chimera interprets "su1.pdb" as the model number (which is obviously kind of stupid) and the file name as missing, so it brings up a browser. I'll fix things so that it does some sanity checking on the "model number" and issues a syntax error in this case. The second write command probably did work but silently. I'll add a status message when the write command succeeds so that it doesn't seem like nothing happened. Also, the file gets written into the "current working directory", which may not be anyplace useful on Windows or the Mac, so on those platforms you may want to specify a complete path name for the file (or use the browser version of the command). --Eric Eric Pettersen UCSF Computer Graphics Lab pett at cgl.ucsf.edu http://www.cgl.ucsf.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordan.benjamin at gmail.com Tue Apr 11 16:38:04 2006 From: jordan.benjamin at gmail.com (Jordan Benjamin) Date: Tue, 11 Apr 2006 16:38:04 -0700 Subject: [Chimera-users] Rotation about an axis Message-ID: I'm trying to rotate a model about a specified axis and origin (preferably in global coordinates). I would like the rotation to be applied on top of whatever transformations have been applied already. I've looked at the documentation, including the programmer's FAQ and the source code for ConstrainedMove. I couldn't figure out how to do this, so I wrote the following function based on the ConstrainedMove code to do the rotation relative to another model: def rotate_around_model_axis(ref_model, model, origin, axis, angle_deg): mvo = apply(chimera.Vector, origin) vo = ref_model.openState.xform.apply(mvo) mva = apply(chimera.Vector, axis) va = ref_model.openState.xform.apply(mva) xf = chimera.Xform() xf.translate(vo) xf.rotate(va, angle_deg) xf.translate(-vo) model.openState.globalXform(xf) But, this doesn't seem to work as I'd intended. Is there a way to do this? Also, I'm a little confused about the coordinate system. It seems like the concept of a global coordinate system may not apply in Chimera the way I'm used to (like in Amira for example) since the camera is fixed. Is this true, or am I totally lost? Thanks in advance for any help you can provide. Jordan From goddard at cgl.ucsf.edu Tue Apr 11 18:30:28 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Tue, 11 Apr 2006 18:30:28 -0700 (PDT) Subject: [Chimera-users] Rotation about an axis In-Reply-To: (jordan.benjamin@gmail.com) References: Message-ID: <200604120130.k3C1USMD1641045@guanine.cgl.ucsf.edu> Hi Jordan, I see one mistake in your code, related to a confusing aspect of Chimera transform objects. mvo = apply(chimera.Vector, origin) vo = ref_model.openState.xform.apply(mvo) Here you use Xform.apply(Vector). Xform is a rotation and a translation but when applied to a Vector you get only the rotation applied. That is what you want if you are reorienting an axis, but not if you are repositioning the origin. The Xform.apply(Point) method applies both the rotation and translation. So you want: mvo = apply(chimera.Point, origin) vo = ref_model.openState.xform.apply(mvo) In fact, that apply() call is old style Python and I would use: mvo = chimera.Point(*origin) vo = ref_model.openState.xform.apply(mvo) The * in front of the argument means each element of the sequence origin is passed as a separate argument. This change messes up the translate() lines further down: xf.translate(vo) xf.rotate(va, angle_deg) xf.translate(-vo) The Xform.translate(Vector) requires a Vector argument not a Point. So I'd change that to use Xform.translate(x,y,z) as follows xf.translate(vo.x, vo.y, vo.z) xf.rotate(va, angle_deg) xf.translate(-vo.x, -vo.y, -vo.z) An important detail to note is that the transform xf when applied to a point first translates by -vo, then rotates, the translates by +vo. That is the order is backwards from the above function calls that created the transform. (In the ContrainedMove code there is an incorrect comment about translate(u) actually translating by -u -- I didn't realize what was going on when I wrote that code.) If I understand your code correctly you are specifying a line (origin and axis) to rotate about in the coordinate system of ref_model, then expressing that line in Chimera global coordinates, and then rotating the second model about that line. There are so many pits to fall into with the Xform / Vector / Point Chimera code. And there is not documentation for it, other than reading the source code. This is especially excruciating because it is hard to even find the source code. I looked at Chimera source code file chimera/libs/_chimera/pyinterface to see the Python interface to the C++ Xform, Vector, and Point objects. And then when I needed to actually look at the Xform C++ code I found that in otf/lib/geom3d/Xform.cpp which is in the Chimera foreign source code distribution (200 Mb) in a tar ball: chimera/foreign/otf/otf.tar.gz This source code is available from the Chimera web site. Could we make it any more difficult for you? It's a shameful mess. Feel free to ask further questions. There is a Chimera developers mailing list chimera-dev at cgl.ucsf.edu that is more appropriate for coding questions. Tom From cwmoad at gmail.com Tue Apr 11 18:31:31 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Tue, 11 Apr 2006 21:31:31 -0400 Subject: [Chimera-users] Rotation about an axis In-Reply-To: References: Message-ID: <6382066a0604111831o78fc2a5ckf9d1e58d4b693306@mail.gmail.com> On 4/11/06, Jordan Benjamin wrote: > I'm trying to rotate a model about a specified axis and origin > (preferably in global coordinates). I would like the rotation to be > applied on top of whatever transformations have been applied already. > I've looked at the documentation, including the programmer's FAQ and > the source code for ConstrainedMove. I couldn't figure out how to do > this, so I wrote the following function based on the ConstrainedMove > code to do the rotation relative to another model: > > def rotate_around_model_axis(ref_model, model, origin, axis, angle_deg): > mvo = apply(chimera.Vector, origin) > vo = ref_model.openState.xform.apply(mvo) > mva = apply(chimera.Vector, axis) > va = ref_model.openState.xform.apply(mva) > > xf = chimera.Xform() > xf.translate(vo) > xf.rotate(va, angle_deg) > xf.translate(-vo) > > model.openState.globalXform(xf) > > But, this doesn't seem to work as I'd intended. Is there a way to do > this? Also, I'm a little confused about the coordinate system. It > seems like the concept of a global coordinate system may not apply in > Chimera the way I'm used to (like in Amira for example) since the > camera is fixed. Is this true, or am I totally lost? Thanks in advance > for any help you can provide. I have very similar code that works. How you derive "vo" seems a bit strange to me, but it may be that I don't fully understand what you are doing. I edited the code so it makes a little sense alone. Basically I rotate modelB by modelA's rotation. xf = modelA.openState.xform centerVec = modelB.bbox()[1].center().toVector() delta = chimera.Xform() delta.translate(centerVec) delta.rotate(*xf.getRotation()) centerVec.negate() delta.translate(centerVec) modelB.openState.globalXform(delta) Good luck and I feel your pain. I remember doing a lot of hacking before I got my desired results. - Charlie From goddard at cgl.ucsf.edu Wed Apr 12 09:40:41 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Wed, 12 Apr 2006 09:40:41 -0700 (PDT) Subject: [Chimera-users] Volume series tool Message-ID: <200604121640.k3CGefGx1854241@guanine.cgl.ucsf.edu> I wrote a Chimera tool to display sequences of volume data sets. They are displayed one at a time like a movie and a slider lets you choose any particular volume. It is intended for looking at 3-D optical microscopy time series, or a sequence of single particle density map reconstructions. Available on the Chimera experimental features web page: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html Tom From goddard at cgl.ucsf.edu Wed Apr 12 15:28:05 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Wed, 12 Apr 2006 15:28:05 -0700 (PDT) Subject: [Chimera-users] Sum of volume data values In-Reply-To: <443D688A.1070704@burnham.org> (message from Eran Shacham on Wed, 12 Apr 2006 13:52:26 -0700) References: <443D688A.1070704@burnham.org> Message-ID: <200604122228.k3CMS5gl1948367@guanine.cgl.ucsf.edu> Hi Eran, You can open your MRC file in Chimera, then open the following script "volumesum.py" which contains Python code to have the sum of all the volume values printed. Use menu entry File / Open to open both files. If you want to do this many times I can give you a modified version that creates a Chimera menu entry (under the Tools menu) that runs the script. Tom ------------ File volumesum.py follows: # Script to print the sum of volume data values. # Get the volume dialog object import VolumeViewer d = VolumeViewer.volume_dialog() # Get the volume data currently shown by the volume dialog dr = d.focus_region m = dr.full_matrix() # Compute the sum of the elements of the volume matrix. import Numeric sum = Numeric.sum(m.flat) # Print the sum to the reply log dialog. message = 'Sum of values of %s = %.6g' % (dr.full_name(), sum) print message # Display the reply log dialog. from chimera import dialogs dialogs.display('reply') ------------- > Date: Wed, 12 Apr 2006 13:52:26 -0700 > From: Eran Shacham > To: Thomas Goddard > Subject: Reading mrc files > > Hi Tom, > > Can I use Chimera's code for reading in mrc files? Essentially, I would > like to read in an mrc file and access its values. It is a mask file, > and I simply need to add up it values. Any suggestions on how to do that > easily with a Chimera module? > > Cheers, > Eran From goddard at cgl.ucsf.edu Wed Apr 12 16:17:06 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Wed, 12 Apr 2006 16:17:06 -0700 (PDT) Subject: [Chimera-users] Sum of volume data values In-Reply-To: <443D7526.30307@burnham.org> (message from Eran Shacham on Wed, 12 Apr 2006 14:46:14 -0700) References: <443D688A.1070704@burnham.org> <200604122228.k3CMS5gl1948367@guanine.cgl.ucsf.edu> <443D7526.30307@burnham.org> Message-ID: <200604122317.k3CNH6fQ1954720@guanine.cgl.ucsf.edu> Hi Eran, Ok, here is code to read an MRC file and print the sum of map values without using Chimera. You need Python, the Numeric Python module which handles multidimensional arrays and the VolumeData module from Chimera. Numeric is obtained from sourceforge: http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=1351 The VolumeData module is in your Chimera distribution. chimera/share/VolumeData Here's an example running the script where I've set PYTHONPATH to have access to the VolumeData module: % env PYTHONPATH=/usr/local/chimera/share python2.4 volumesum2.py Sum of values of groel.mrc = 21720.8984375 Send future questions to chimera-users at cgl.ucsf.edu so others who have similar problems can benefit. I get that email just as fast. Tom ------- file volumesum2.py follows: # Script to print the sum of volume data values. # Does not need Chimera, just the VolumeData module and Numeric and Python. path = 'groel.mrc' # Read the MRC volume data and get the 3-D Numeric array. from VolumeData.mrc.mrc_format import MRC_Data data = MRC_Data(path) m = data.matrix() # Compute the sum of the elements of the volume matrix. import Numeric sum = Numeric.sum(m.flat) # Print the sum print 'Sum of values of', path, ' = ', sum ------- > Date: Wed, 12 Apr 2006 14:46:14 -0700 > From: Eran Shacham > To: Thomas Goddard > Subject: Re: Sum of volume data values > > Hey Tom, > > Thanks for your reply. However, I would like to do that from within a > script I already wrote. i.e I would like to integrate a read_in method > for an MRC file, access it values and then calculate the sum. I would > like to avoid doing that by opening my file in Chimera at this stage of > the program. Can it be done by importing some of your code? > > Thanks, > Eran. From eshacham at burnham.org Wed Apr 12 16:01:45 2006 From: eshacham at burnham.org (Eran Shacham) Date: Wed, 12 Apr 2006 16:01:45 -0700 Subject: [Chimera-users] Sum of volume data values In-Reply-To: <200604122317.k3CNH6fQ1954720@guanine.cgl.ucsf.edu> References: <443D688A.1070704@burnham.org> <200604122228.k3CMS5gl1948367@guanine.cgl.ucsf.edu> <443D7526.30307@burnham.org> <200604122317.k3CNH6fQ1954720@guanine.cgl.ucsf.edu> Message-ID: <443D86D9.4060502@burnham.org> Hey Tom, Sure, from now on I will send my questions to chimera-users email address. Sorry about that. The Numeric flat() method doesn't work for me. Error is: ValueError: flattened indexing only available for contiguous array So, instead I just wrote a loop to 'flatten' the array down: for i in m: for x in i: for j in x: for u in j: sum = sum + u Does that seem fine, or is .flat() doing something else? Cheers, Eran. Thomas Goddard wrote: > Hi Eran, > > Ok, here is code to read an MRC file and print the sum of map values > without using Chimera. You need Python, the Numeric Python module which > handles multidimensional arrays and the VolumeData module from Chimera. > Numeric is obtained from sourceforge: > > http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=1351 > > The VolumeData module is in your Chimera distribution. > > chimera/share/VolumeData > > Here's an example running the script where I've set PYTHONPATH to have > access to the VolumeData module: > > % env PYTHONPATH=/usr/local/chimera/share python2.4 volumesum2.py > Sum of values of groel.mrc = 21720.8984375 > > Send future questions to chimera-users at cgl.ucsf.edu so others who > have similar problems can benefit. I get that email just as fast. > > Tom > > ------- > file volumesum2.py follows: > > # Script to print the sum of volume data values. > # Does not need Chimera, just the VolumeData module and Numeric and Python. > > path = 'groel.mrc' > > # Read the MRC volume data and get the 3-D Numeric array. > from VolumeData.mrc.mrc_format import MRC_Data > data = MRC_Data(path) > m = data.matrix() > > # Compute the sum of the elements of the volume matrix. > import Numeric > sum = Numeric.sum(m.flat) > > # Print the sum > print 'Sum of values of', path, ' = ', sum > > ------- > > >> Date: Wed, 12 Apr 2006 14:46:14 -0700 >> From: Eran Shacham >> To: Thomas Goddard >> Subject: Re: Sum of volume data values >> >> Hey Tom, >> >> Thanks for your reply. However, I would like to do that from within a >> script I already wrote. i.e I would like to integrate a read_in method >> for an MRC file, access it values and then calculate the sum. I would >> like to avoid doing that by opening my file in Chimera at this stage of >> the program. Can it be done by importing some of your code? >> >> Thanks, >> Eran. >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goddard at cgl.ucsf.edu Thu Apr 13 10:06:08 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Thu, 13 Apr 2006 10:06:08 -0700 (PDT) Subject: [Chimera-users] Sum of volume data values In-Reply-To: <443D86D9.4060502@burnham.org> (message from Eran Shacham on Wed, 12 Apr 2006 16:01:45 -0700) References: <443D688A.1070704@burnham.org> <200604122228.k3CMS5gl1948367@guanine.cgl.ucsf.edu> <443D7526.30307@burnham.org> <200604122317.k3CNH6fQ1954720@guanine.cgl.ucsf.edu> <443D86D9.4060502@burnham.org> Message-ID: <200604131706.k3DH68Na1672634@guanine.cgl.ucsf.edu> Hi Eran, The m.flat only works for "contiguous arrays". Contiguous means you the values are all layed out in memory in order with no gaps. You get a non-contiguous array if you take an array subblock m2 = m[50:100,:,:], or if you change the step size m2 = m[::2,:,:], or if you permute the order of the axes m2 = Numeric.transpose(m). The only case you can get from the MRC_Data.matrix() call is the permuting of axes. The MRC format supports permutations of data axes, so depending on your file the m.flat will fail. The solution is to use import Numeric m1d = Numeric.ravel(m) sum = Numeric.sum(m1d) instead of import Numeric sum = Numeric.sum(m.flat) The Numeric.ravel() call makes a 1D array, making a copy if the passed in array is non-contiguous. This will certainly be much faster than your nested for loops for large arrays. Tom From goddard at cgl.ucsf.edu Fri Apr 21 11:01:11 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Fri, 21 Apr 2006 11:01:11 -0700 (PDT) Subject: [Chimera-users] Rotation about an axis In-Reply-To: (jordan.benjamin@gmail.com) References: <200604120130.k3C1USMD1641045@guanine.cgl.ucsf.edu> Message-ID: <200604211801.k3LI1Bi91988622@guanine.cgl.ucsf.edu> Hi Jordan, Aha! It turns out I wrote code that does exactly what you want last year. It is called the symmetric molecule copies command at the bottom of the Chimera experimental features web page: http://www.cgl.ucsf.edu/chimera/experimental/experimental.html It is not distributed with Chimera yet but you can download it on that page and install it with your existing Chimera. I hate to discourage you from Python programming in Chimera but I think this is just what you need. You open one copy of your molecule and then use this "sym" command to make the hexamer. Then when you move the original copy of the molecule relative to your map, the other 5 copies automatically reposition to maintain the 6-fold symmetry. To get a more detailed description look at the "details" link on the experimental features page. The hexamer symmetry comes from the BIOMT matrices in the PDB file. This sym command treats those matrices in the coordinate system of the density map (yes, a bit weird). The key here is to make sure the symmetry axis of the density map matches the symmetry axis of the BIOMT matrices. The easiest approach is probably to make the BIOMT matrices produce a hexamer about the z-axis through (0,0,0). When you open your density map in Chimera it may not have the hexamer density centered at (0,0,0). You will need to adjust its origin so the density hexamer is centered at (0,0,0). Use the volume dialog menu entry Features / Origin and Scale to adjust the position of the lower left front corner of the map. Assuming the hexamer is centered in a 128 x 128 x 100 grid with voxel size 0.8 angstroms you would set the origin to (-50.8, -50.8, -39.6) = (-63.5 * 0.8, -63.5 * 0.8, -49.5 * 0.8). The weird 63.5 = 128/2 - .5 instead of 64 = 128/2 is easiest to understand if you think of a map that is only 2 by 2 by 2 in size. Remember to press the Enter key in one of the origin fields in the volume dialog to have the new position take effect. In any case that may still be a half voxel off depending on your map, or it may be way off. Of course you have to know the position of the center of the hexamer in your density to make this work. A way to verify that you have set the correct origin is to open 2 copies of the map -- set the map origins, then use constrained move to rotate just one copy keeping the other one fixed. It is easy then to visually see if the two copies are concentric. For convenience you can save your map as an MRC file with the new origin with the volume dialog File / Save As... menu entry. Saving a Chimera session also saves the origin in the Chimera session file (the map is not modified). I can see various troubles with using the Multiscale tool. First Multiscale low resolution surfaces are not reliably synchronized to the individual PDB models. If you change a PDB model position Multiscale won't realize it and the low resolution surface will not move to the new location. If you are using the latest Chimera snapshot (1.2224, April 10, 2006) then the problems will be even more severe because I changed the way Multiscale positions PDB models. Instead of setting the pdb_model.openState.xform it changes the atom coordinates of the model (setting atom.coord = x,y,z). All the xforms of the 6 models in a hexamer would be the same in Chimera 1.2224. This change was made to allow correctly moving individual chains of multiscale models, possible with the "movement mouse mode" feature on the experimental features web page. Lastly some clarification about Chimera's coordinate systems. First there is a global Chimera coordinates system with the x axis always horizontal relative to your graphics window, the y axis always vertical, and the z axis always pointing out of the screen at you. When you rotate models with the mouse, this coordinate system does not change -- the individual matrices positioning the models are changed. The origin of this global coordinate system is not necessarily in the center of the screen. It can be anywhere including off-screen. The global coordinates for the center of the screen are set to match the center of the bounding box of the first model you open in Chimera. Besides the global coordinate system each model has a local coordinate system. With a PDB file, the atom coordinate positions are in the local coordinate system. If you open a PDB model in Chimera and rotate it, the atom.coord x,y,z values do not change -- they are expressed in the local coordinate system which is fixed to the atoms and rotates with the model. (You can however change the atom.coord positions using Python code.) The pdb_model.openState.xform 3 row by 4 column matrix gives the rotation and translation that maps the local coordinates (e.g. a PDB atom position) into Chimera global coordinates. Other types of Chimera models like density maps are just like PDB models having a local coordinate system -- the density map grid points have unchanging coordinates in the local coordinate system. More than you wanted to know. Tom > Date: Thu, 20 Apr 2006 19:51:40 -0700 > From: "Jordan Benjamin" > To: "Thomas Goddard" > Subject: Re: [Chimera-users] Rotation about an axis > > Ah, it looks like it still works for normal models. The weird behavior > was with a model that had been generated with the Multiscale Models > tool from crystal contacts. I still wish I understood the > global-vs-local issue better though. > > > On 4/20/06, Jordan Benjamin wrote: > > Thank you for your help on this. I have a further question. Basically, > I'm trying to dock into electron density the crystal structure of a > protein that forms a hexamer. I would like to be able to have six > copies of the monomer structure loaded at once, and when I move or > rotate one copy, I'd like to be able to transform the other five to > match. So, I thought the ConstrainedMove code would be a good starting > point, since what I'm trying to do is the same thing it does, just > with the rotation specified by degrees instead of by dragging the > mouse. > > After you sent the email below, I modifed the function I was writing > accordingly, and it worked. However, I'm trying to use it now, and > it's not working. I'm a little lost on debugging it, because I don't > even know what Chimera's concept of a global coordinate system is, nor > do I have any way to visually display the local origin and axis for > each object. Is there a way to do these things that you know of? Do > you know of a simple way to rotate an object X degrees around a > specified axis (relative to another object if needed)? > > If these are really hard questions and the answer is just that I > should read the source code until I figure it out, that's totally > fine. I just thought I'd ask. > > At least with Chimera the code IS available, unlike the situation with > Amira where things would be undocumented and broken, and there'd be no > way to fix them... > > Thanks so much, > Jordan > > The function I was using is as follows (yes, it's brittle and ugly, > but it's all I had time for): > def update_hexamer(ref_model,model,*rest): > origin = (0,0,0) > axis = (0,0,1) > angle_deg = 60 > > mvo = chimera.Point(*origin) > vo = ref_model.openState.xform.apply(mvo) > mva = apply(chimera.Vector, axis) > va = ref_model.openState.xform.apply(mva) > > xf_original = model.openState.xform > > for i in range(5): > xf = chimera.Xform() > xf.translate(*vo) > xf.rotate(va, angle_deg+60*i) > xf.translate(-vo.x, -vo.y, -vo.z) > model.openState.globalXform(xf) > rest[i].openState.xform = model.openState.xform > model.openState.xform = xf_original > From eshacham at burnham.org Fri Apr 21 12:40:17 2006 From: eshacham at burnham.org (Eran Shacham) Date: Fri, 21 Apr 2006 12:40:17 -0700 Subject: [Chimera-users] writing mrc files Message-ID: <44493521.2050106@burnham.org> Hey there, I am trying to write an mrc file using the write_mrc2000_grid_data module. My function is below. My array of data is a . Which is a basically a matrix with dimensions: (243, 243, 243). When trying to write an mrc file using this array I get the following error: ************************* File "/home/eshacham/cctbx/mrc_functions.py", line 20, in write_mrc write_mrc2000_grid_data(g, path) File "CHIMERA/share/VolumeData/mrc/writemrc.py", line 44, in write_mrc2000_grid_data File "CHIMERA/share/VolumeData/arraygrid.py", line 48, in submatrix ValueError: need more than 1 value to unpack Code used *********************** def write_mrc(data): print data origin = (1.54, 2.45, 3.45) # XYZ coordinates of array index (0,0,0) step = (.25, .25, .25) # Spacing between grid points import Numeric a = Numeric.array(data, Numeric.Float32) arrays = [a] import VolumeData g = VolumeData.Array_Grid_Data(arrays, origin, step) path = '/home/eshacham/structures/result.mrc' from VolumeData.mrc import write_mrc2000_grid_data write_mrc2000_grid_data(g, path) I am assuming that it has to do with my array dimensions. Any help would be greatly appreciated. Cheers, Eran. From goddard at cgl.ucsf.edu Fri Apr 21 13:46:56 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Fri, 21 Apr 2006 13:46:56 -0700 (PDT) Subject: [Chimera-users] writing mrc files In-Reply-To: <44493521.2050106@burnham.org> (message from Eran Shacham on Fri, 21 Apr 2006 12:40:17 -0700) References: <44493521.2050106@burnham.org> Message-ID: <200604212046.k3LKkuWN2032166@guanine.cgl.ucsf.edu> Hi Eran, The problem is the argument "data" being passed to your routine is 1-dimensional, it needs to be 3-dimensional. For instance you are passing an array to your write_mrc() routine that looks like data = (1,2,3,4,5,6,7,8) instead of data = (((1,2),(3,4)),((5,6), (7,8))) # Dimensions 2 by 2 by 2 There are two solutions. Either you pass in the 3-dimensional array to your routine, or you pass in 1-dimensional array and a second argument which gives the grid size. This second option would look like: def write_mrc(data, zyx_grid_size): print data origin = (1.54, 2.45, 3.45) # XYZ coordinates of array index (0,0,0) step = (.25, .25, .25) # Spacing between grid points import Numeric a = Numeric.array(data, Numeric.Float32) a = a.resize(zyx_grid_size) arrays = [a] import VolumeData g = VolumeData.Array_Grid_Data(arrays, origin, step) path = '/home/eshacham/structures/result.mrc' from VolumeData.mrc import write_mrc2000_grid_data write_mrc2000_grid_data(g, path) Example call: data = (1,2,3,4,5,6,7,8) zyx_grid_size = (2,2,2) write_mrc(data, zyx_grid_size) Notice that the grid size is 3 numbers (zs,ys,xs) the first being the z-axis size. Also the data values in the 1-D array have to be ordered such that x varies fastest, y second fastest, and z slowest. In other words the first xs*ys numbers are the first z plane of data. Tom From goddard at cgl.ucsf.edu Fri Apr 21 13:50:45 2006 From: goddard at cgl.ucsf.edu (Thomas Goddard) Date: Fri, 21 Apr 2006 13:50:45 -0700 (PDT) Subject: [Chimera-users] writing mrc files In-Reply-To: <200604212046.k3LKkuWN2032166@guanine.cgl.ucsf.edu> (message from Thomas Goddard on Fri, 21 Apr 2006 13:46:56 -0700 (PDT)) References: <44493521.2050106@burnham.org> <200604212046.k3LKkuWN2032166@guanine.cgl.ucsf.edu> Message-ID: <200604212050.k3LKojv92037095@guanine.cgl.ucsf.edu> Hi Eran, Oops! My suggested code was wrong. a = a.resize(grid_size) gives an error because Numeric tries copy values of a into a instead of just rebinding variable a. The corrected version is below. Tom def write_mrc(data, zyx_grid_size): print data origin = (1.54, 2.45, 3.45) # XYZ coordinates of array index (0,0,0) step = (.25, .25, .25) # Spacing between grid points import Numeric a = Numeric.array(data, Numeric.Float32) a_3d = a.resize(zyx_grid_size) arrays = [a_3d] import VolumeData g = VolumeData.Array_Grid_Data(arrays, origin, step) path = '/home/eshacham/structures/result.mrc' from VolumeData.mrc import write_mrc2000_grid_data write_mrc2000_grid_data(g, path) From fabrizio.briganti at unifi.it Wed Apr 26 07:20:54 2006 From: fabrizio.briganti at unifi.it (Prof. Fabrizio Briganti) Date: Wed, 26 Apr 2006 16:20:54 +0200 Subject: [Chimera-users] Stereo angle value Message-ID: <01M1PXGEEDOE91XXE0@unifi.it> Hi, I have not been able to find any reference to the value for the angle difference between Right and Left views in Stereo Images made with Chimera. Can you help me find it? Is there any way to change such angle value? Thanks Fabrizio -------------- next part -------------- An HTML attachment was scrubbed... URL: From rker at bioinf.uab.es Fri Apr 28 06:50:03 2006 From: rker at bioinf.uab.es (Isaac Amela Abellan) Date: Fri, 28 Apr 2006 15:50:03 +0200 Subject: [Chimera-users] libGL.so Message-ID: <44521D8B.7060401@bioinf.uab.es> Hello, I'm using Linux and when I had tried to execute chimera this message appeared: "OpenGL misconfiguration detected. /usr/lib/libGL.so.1 differs from /usr/X11R6/lib/libGL.so.1. Please read installation instructions." I said it several times to my system administrator and he solved it using your instructions (see below): "If Chimera terminates with the error OpenGL misconfiguration detected, that means that you have two different versions of libGL.so installed -- one in /usr/lib (installed by your graphics card drivers) and one in /usr/X11R6/lib (possibly installed by Mesa, which if so would mean no hardware graphics acceleration if this version were used). Reinstalling your graphics card drivers should remove the /usr/X11R6/lib version. Alternatively, you could rename or remove the /usr/X11R6/lib version yourself. With the latter approach you might want to verify that all OpenGL applications that you use continue to work before permanently removing the library. On startup, you may see the warning Xlib: extension "Xfre86-DRI" missing on display "0.0". That means that there was no graphics driver found for your card that uses the DRI, direct rendering interface, technology for fast 3D graphics. The solution is to either ignore the warning or to upgrade your hardware and software (see Mesa/OpenGL issues below)." The problem is that when I reboot my computer the problem still appears and we should do the same procedure explained above. We can't configure the system conservating the libraries of my card drivers (/usr/lib) without removing the Mesa ones (/usr/X11R6/lib). How can we solve the problem? We will be waiting for your response. -- ------------------------------------------------ Isaac Amela Abellan PhD Student Laboratory of Bioinformatics Institute of Biotechnology and Biomedicine (IBB) Autonomous University of Barcelona (UAB) 08193 Bellaterra, Barcelona. Spain. Phone: 34-93-5812807 e-mail: iamela at bioinf.uab.es ------------------------------------------------