Sorry the below actually won't work, you'll need something more...
nth_residue = 3
previous = -1
cur_res = 0
nth_resi = 0
for at in cmd.get_model("molecule1 and chainA").atom:
if (at.resi != previous):
cur_res++
if (cur_res == nth_residue):
nth_resi = at.resi
break
# Now do the selection...
cmd.select("myselection", "molecule1 and chain A and resi %s" % (nth_resi))
There might be a cleaner way, but something along these lines should work.
Sorry for the first email,
Dan
This looks better. However you'll want to put it in a script, wrap it
with a function, etc... I haven't test the above though.
Dan Kulp wrote:
I just needed to do this and this was my solution
NTH_RESIDUE=3
cmd.select("myselection", "molecule1 and chain A and resi %s" %
(cmd.get_model("molecule1 and chain A").atom[NTH_RESIDUE]))
will create a selection named myselection and contain only the
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
http://mail.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through
log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users
--
Dan Kulp
Biophysics Graduate Student @ UPenn
dwk...@mail.med.upenn.edu
http://dwkulp.homelinux.net/tiki/tiki-index.php
--