Re: [PyMOL] How to get the coordinates of the center of a group of atoms?
Dear Jason, Thank you for you quick reply! And This problem is solved! Yours, Zhang Cun On Thu, Apr 29, 2010 at 9:31 PM, Jason Vertrees wrote: > Hi Cun, > > That's a good start. Just a couple things needs to be changed. > First, frames don't track coordinates, states do. Frames are for > movies; states are for coordinates. Next, instead of using center, > use the origin command with the state parameter specified. Here's > example code for 1NMR a multi-state protein, adjust his for your > application: > > python > cmd.fetch("1nmr", async=0) > coord=[] > for i in range(1,cmd.count_states()+1): > cmd.origin("i. 1-24", state=i) > coord.append(cmd.get_position()) > print coord > python end > > Cheers, > > -- Jason > > On Thu, Apr 29, 2010 at 8:58 AM, Cun Zhang wrote: >> hi, >> I have a pdb file with serveral frames, I hope to get the trajectory >> of the center of a selected group of atoms. >> I use the following commands, but return the same coord. >> >> cmd.load("a.pdb") >> coord=[] >> for i in range(cmd.count_frames()): >> cmd.frame(i+1) >> cmd.center('id 1-24') >> coord.append(cmd.get_position()) >> >> >> What should I do? >> >> Thank you! >> >> Zhang Cun >> >> -- >> Blog: http://www.edwardpku.com/cun >> >> -- >> ___ >> 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 >> > > > > -- > Jason Vertrees, PhD > PyMOL Product Manager > Schrodinger, LLC > > (e) jason.vertr...@schrodinger.com > (o) +1 (603) 374-7120 > -- Blog: http://blog.4message.net -- ___ 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
Re: [PyMOL] How to get the coordinates of the center of a group of atoms?
Hi Cun, That's a good start. Just a couple things needs to be changed. First, frames don't track coordinates, states do. Frames are for movies; states are for coordinates. Next, instead of using center, use the origin command with the state parameter specified. Here's example code for 1NMR a multi-state protein, adjust his for your application: python cmd.fetch("1nmr", async=0) coord=[] for i in range(1,cmd.count_states()+1): cmd.origin("i. 1-24", state=i) coord.append(cmd.get_position()) print coord python end Cheers, -- Jason On Thu, Apr 29, 2010 at 8:58 AM, Cun Zhang wrote: > hi, > I have a pdb file with serveral frames, I hope to get the trajectory > of the center of a selected group of atoms. > I use the following commands, but return the same coord. > > cmd.load("a.pdb") > coord=[] > for i in range(cmd.count_frames()): > cmd.frame(i+1) > cmd.center('id 1-24') > coord.append(cmd.get_position()) > > > What should I do? > > Thank you! > > Zhang Cun > > -- > Blog: http://www.edwardpku.com/cun > > -- > ___ > 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 > -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) jason.vertr...@schrodinger.com (o) +1 (603) 374-7120 -- ___ 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
[PyMOL] How to get the coordinates of the center of a group of atoms?
hi, I have a pdb file with serveral frames, I hope to get the trajectory of the center of a selected group of atoms. I use the following commands, but return the same coord. cmd.load("a.pdb") coord=[] for i in range(cmd.count_frames()): cmd.frame(i+1) cmd.center('id 1-24') coord.append(cmd.get_position()) What should I do? Thank you! Zhang Cun -- Blog: http://www.edwardpku.com/cun -- ___ 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