From: Warren D. <wa...@de...> - 2006-01-19 23:54:30
|
res_list =3D [] iterate name ca, res_list.append(chain+"/"+resi+"/") cmd.indicate(res_list[2]) =20 -- Warren L. DeLano, Ph.D. =20 Principal Scientist . DeLano Scientific LLC =20 . 400 Oyster Point Blvd., Suite 213 =20 . South San Francisco, CA 94080 USA =20 . Biz:(650)-872-0942 Tech:(650)-872-0834 =20 . Fax:(650)-872-0273 Cell:(650)-346-1154 . mailto:wa...@de... =20 =20 > -----Original Message----- > From: pym...@li...=20 > [mailto:pym...@li...] On Behalf Of Dan Kulp > Sent: Thursday, January 19, 2006 9:37 AM > To: dw...@ma... > Cc: Alex Luso; pym...@li... > Subject: Re: [PyMOL] Possible to select the nth residue? >=20 > Sorry the below actually won't work, you'll need something more... >=20 > nth_residue =3D 3 > previous =3D -1 > cur_res =3D 0 > nth_resi =3D 0 > for at in cmd.get_model("molecule1 and chainA").atom: > if (at.resi !=3D previous): > cur_res++ >=20 > if (cur_res =3D=3D nth_residue): > nth_resi =3D at.resi > break >=20 > # Now do the selection... > cmd.select("myselection", "molecule1 and chain A and resi %s"=20 > % (nth_resi)) >=20 >=20 > There might be a cleaner way, but something along these lines=20 > should work. >=20 > Sorry for the first email, > Dan >=20 > This looks better. However you'll want to put it in a script,=20 > wrap it with a function, etc... I haven't test the above though. >=20 >=20 > Dan Kulp wrote: > > I just needed to do this and this was my solution > > > > NTH_RESIDUE=3D3 > > cmd.select("myselection", "molecule1 and chain A and resi %s" %=20 > > (cmd.get_model("molecule1 and chain A").atom[NTH_RESIDUE])) > > > > will create a selection named myselection and contain only the=20 > > NTH_RESIDUE of molecule1 and chain A. > > > > Hope this helps, > > ~Dan > > > > Alex Luso wrote: > >> One more question. > >> > >> Someone asked me this: is it possible in Pymol to select > >> the nth (e.g. the 3rd) residue in a molecule/chain without > >> knowing the pdb residue # itself? > >> > >> -Alex > >> > >> __________________________________________________ > >> Do You Yahoo!? > >> Tired of spam? Yahoo! Mail has the best spam protection around=20 > >> http://mail.yahoo.com > >> > >> ------------------------------------------------------- > >> This SF.net email is sponsored by: Splunk Inc. Do you grep through=20 > >> log files > >> for problems? Stop! Download the new AJAX search engine=20 > that makes > >> searching your log files as easy as surfing the web. =20 > DOWNLOAD SPLUNK! > >>=20 > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > >> _______________________________________________ > >> PyMOL-users mailing list > >> PyM...@li... > >> https://lists.sourceforge.net/lists/listinfo/pymol-users > >> > >> =20 > > > > >=20 >=20 > --=20 > Dan Kulp > Biophysics Graduate Student @ UPenn > dw...@ma... > http://dwkulp.homelinux.net/tiki/tiki-index.php > -- >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. =20 > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 >=20 >=20 >=20 |