Hi Martin, Here's a fourth option (and the technique worth noting :p ):
print len( set( [(i.chain,i.resi,i.resn) for i in cmd.get_model(selection).atom] ) ) Cheers, Tsjerk On Tue, Nov 29, 2011 at 4:26 PM, Jason Vertrees <jason.vertr...@schrodinger.com> wrote: > Hi Martin, > > You get three options: > > (1) You can count alpha carbons: > > fetch 1rx1, async=0 > > count_atoms n. CA > > > (2) But, a protein could be missing alpha carbons then this is more > complete (and the technique worth noting): > > n=0 > select qq, polymer > select pp, None > python > while cmd.count_atoms("qq"): > cmd.select("pp", "br. first qq") > cmd.select("qq", "qq and not pp") > n+=1 > python end > print "count_atoms: %d" % n > > If you put: > > select qq, * > > you'll get a higher count (160) because one atom in 1rx1's inorganic > set is also named "CA". > > > (3) The shorter version of (2) is: > > print len(cmd.get_model("poly").get_residues()) > > Cheers, > > -- Jason > > > On Tue, Nov 29, 2011 at 9:50 AM, Martin Hediger <ma....@bluewin.ch> wrote: >> Dear List >> How can I compute the numbers of residues in a model? >> >> Martin >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure >> contains a definitive record of customers, application performance, >> security threats, fraudulent activity, and more. Splunk takes this >> data and makes sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-novd2d >> _______________________________________________ >> 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 > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > 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 > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ 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