From: DeLano, W. <wa...@su...> - 2001-11-15 00:49:21
|
There are a number of different ways to do this, but the easiest is: obj_name =3D cmd.identify('pk1',1)[0][0] To be safe, your code should probably make sure that the selection pk1 exists and contains at least one atom: obj_name =3D None if 'pk1' in cmd.get_names('selections'): if cmd.count_atoms('pk1',1): obj_name =3D cmd.identify('pk1',1)[0][0] if obj_name: # do something here... Cheers, Warren -- mailto:wa...@su... Warren L. DeLano, Ph.D. Informatics Scientist Sunesis Pharmaceuticals, Inc. 341 Oyster Point Blvd. S. San Francisco, CA 94080 (650)-266-3606 fax: (650)-266-3501 > -----Original Message----- > From: Ezequiel Panepucci [mailto:za...@SL...] > Sent: Wednesday, November 14, 2001 4:30 PM > To: PyM...@li... > Subject: [PyMOL] molecule name from PK* selections >=20 >=20 > Hello, > Is there a way to get the corresponding molecule (or model) > name for a given PK1 selection? > Thanks, > Zac >=20 >=20 >=20 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 |