placing a helium atom at a given position.

Hi again, that follows an e-mail exchange with Eric a while ago. I am trying to place a given atom (for the moment, helium is fine) to given x,y,z coordinates. You told me that the new BuildStructure module could do that, unfortunately after having imported the module import BuildStructure when I do BuildStructure.placeHelium(res,model=0,position=13.2909,75.4474,25.4248) I have SyntaxError: non-keyword arg after keyword arg I tried different argumentations of this but I can't have it working, if you can tell me how to do this, that would be perfect. All the best, JD some time ago Eric On Thu, 2008-02-21 at 12:00 -0800, chimera-users-request@cgl.ucsf.edu wrote:
Send Chimera-users mailing list submissions to chimera-users@cgl.ucsf.edu
To subscribe or unsubscribe via the World Wide Web, visit http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users or, via email, send a message with subject or body 'help' to chimera-users-request@cgl.ucsf.edu
You can reach the person managing the list at chimera-users-owner@cgl.ucsf.edu
When replying, please edit your Subject line so it is more specific than "Re: Contents of Chimera-users digest..."
Today's Topics:
1. Re: distance (Elaine Meng)
----------------------------------------------------------------------
Message: 1 Date: Thu, 21 Feb 2008 09:00:37 -0800 From: Elaine Meng <meng@cgl.ucsf.edu> Subject: Re: [Chimera-users] distance To: "??" <lynnwuchao@gmail.com> Cc: chimera-users@cgl.ucsf.edu Message-ID: <0E85C396-8C7D-4182-A029-5C0155245C3A@cgl.ucsf.edu> Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed
Hi!
The distances are listed in a separate dialog - choose "Tools... Structure Analysis... Distances" from the menu to open that dialog. You can adjust the number of decimal places in the measurement, and there is a "Save" button if you want to save distances or other measurements to a text file.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@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
On Feb 20, 2008, at 11:38 PM, ?? wrote:
Hi, folks, I select two atoms and measured their distance using the command distance and can see the exact distance value in the graphic interface, but when I go the log file i can not find it. Can anybody give me a hand and tell me why can I find it? Thanks.. _______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
------------------------------
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
End of Chimera-users Digest, Vol 58, Issue 24 *********************************************

On Feb 22, 2008, at 7:59 AM, Jean-Didier Maréchal wrote:
Hi again,
that follows an e-mail exchange with Eric a while ago.
I am trying to place a given atom (for the moment, helium is fine) to given x,y,z coordinates. You told me that the new BuildStructure module could do that, unfortunately after having imported the module import BuildStructure when I do BuildStructure.placeHelium (res,model=0,position=13.2909,75.4474,25.4248) I have SyntaxError: non-keyword arg after keyword arg I tried different argumentations of this but I can't have it working, if you can tell me how to do this, that would be perfect.
All the best, JD
Hi JD, The are a few things wrong with your placeHelium() call, some of them due to incorrect Python syntax (thereby producing the SyntaxError) and some from not providing the kind of input the routine expects. They are actually interrelated in your case. As mentioned in the doc string for the placeHelium() function, the 'model' argument has to be a string or a chimera.Molecule instance, not an integer. If it's a string, a new Molecule will be created with that string as its name. If you want to put the atom in model 0 (it seems like you do), you need to get the Molecule instance of model 0. Like so: from chimera import openModels, Molecule model0 = openModels.list(id=0, modelTypes=[Molecule])[0] The 'modelTypes=' part isn't necessary if the only thing in model 0 is a structure, but if you have a surface on the structure (which is a separate model of type MSMSModel) then you do need it. Similarly, the 'position' argument needs to be a chimera.Point instance or None. If None, the atom will be placed in the center of the view. Clearly, you want a Point, like so: from chimera import Point pt = Point(13.2909,75.4474,25.4248) This also where the syntax error occurred. Commas separate arguments in Python calls, so the second and third numbers in your placeHelium () call were interpreted as additional arguments, not as part of the value being specified for the 'position' keyword. You would have needed to surround the three numbers with parentheses to have them treated as a single argument (which would have avoided the SyntaxError but would have still failed since it wasn't a Point instance). With the above, your call to placeHelium would be: BuildStructure.placeHelium(res, model=model0, position=pt) --Eric
participants (2)
-
Eric Pettersen
-
Jean-Didier Maréchal