I am currently working on a protein where I have selected residues within 10A of its bound ligand in pymol. However, I can not find a way to print out what residues are contained in that group of residues that are within 10A.
So far, I have tried this:
print or output the selected residues in pymol
specifically,
iterate selected and name CA, print (resi, resn)
However, after cross-referencing the residues printed with those that I can see selected in the pdb file sequence, this method omits many of the residues.
Does anyone have a pymol command line they have used to accomplish this?
Kathryn Myers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
ok here is my attempt; from pymol console:
fetch 5NLM
remove chain B
remove solvent
select ios , resn ios ---> LIGAND
select 10atoms, chain A within 10 of ios --> selection "10atoms" defined with 695 atoms.
ls = []
iterate 10atoms, ls.append((resi, resn))
print(ls)
print(len(ls)) ---> 695
ls_set = set(ls)
print(len(ls_set)) ---> 70
print(ls_set)
while using
ls = []
iterate 10atoms and name CA, ls.append((resi, resn))-> Iterate: iterated over 45 atoms.
print(ls)
print(len(ls)) ---> 45
ls_set = set(ls)
print(len(ls_set)) ---> 45
print(ls_set)
Its because in :
within
“within” finds atoms in the first selection within a cutoff distance of atoms in the second selection.
Usage
selection within distance of selection
So if only some atoms of a residue but not CAs, are within your cutoff distance
using:
iterate 10atoms and name CA, ls.append((resi, resn))
will loose them from your list
NOTE
because of the way I used
select 10atoms, chain A within 10 of ios
ios
is part of the results too