Re: [PyMOL] measure angles in programming

2014-09-25 Thread Thomas Holder
Hi Lei, those tunnel atoms all have the same name, thus the selection is not unique (not a *single* atom but multiple). For a script like that, it's best to select by atom index. cmd.iterate("tunnel", 'stored.centers.append("(%s`%d)" % (model, index))') Cheers, Thomas On 24 Sep 2014, at 23:

Re: [PyMOL] measure angles in programming

2014-09-25 Thread Gianluca Santoni
It seems due to the fact that youre selection s is not a valid selection. Try to simplify it by simply giving (model, chain, resi, name) It should be enough to define a single atom, as required by get_angle On 9/25/14 5:27 AM, Lei Chen wrote: > Hi, > I still have trouble. I am not sure if it is

Re: [PyMOL] measure angles in programming

2014-09-24 Thread Lei Chen
Hi, I still have trouble. I am not sure if it is because the tunnel pdb is not standard. (it's an output file from another software called CAVER.) My tunnel pdb looks like: ATOM 1 H FIL T 537 -44.636 -88.973 27.3945.02 ATOM 2 H FIL T 537 -44.620 -88.474 27.363

Re: [PyMOL] measure angles in programming

2014-09-24 Thread Sampson, Jared
Hi Lei - The `get_angle` command needs an atom selection for your “tunnel" atoms, which, like the B-factor as Matt mentioned, you can also get using `iterate`: ### # create a list stored.centers = [] # get the macro selection string for each atom in tunnel cmd.iterate("tunnel", 'stored.centers

Re: [PyMOL] measure angles in programming

2014-09-24 Thread Matthew Baumgartner
Hi, you can just use the 'angle' command. cmd.angle('angle1', 'start_point', 'end_point', a) To print the b-factor you can use the iterate command (http://www.pymolwiki.org/index.php/Iterate) cmd.iterate('(a)', 'print b') HTH, Matt Baumgartner On 09/24/2014 06:35 PM, rainfieldcn wrote: > Hi al

[PyMOL] measure angles in programming

2014-09-24 Thread rainfieldcn
Hi all, I generate two pseudoatoms "start_point" and "end_point" by center_of_mass.py. I load an object "tunnel" which has a sets of atoms in one chain. I want to measure the angle from each atoms in "tunnel" to "end_point" to "start_point". at the same time, I want to print the B-factor of ato