How to print/write the selected (atoms/residues) from selction?
Dear All,
I selected some set of atoms and the residues with the following two commends:
s=selection(mdl1.atoms['CA:102:A].select_sphere(10)) s=selection(mdl1.atoms['CA:102:A].select_sphere(10)).by_residue()
And, When I try to print the selected atoms/residues Its just giving the counts not the atoms/residues. So could you tell me how to do the same.
Thanking you in advance
On 6/23/16 9:20 AM, Mahesh Velusamy wrote: > I selected some set of atoms and the residues with the following two > commends: > > s=selection(mdl1.atoms['CA:102:A].select_sphere(10)) > s=selection(mdl1.atoms['CA:102:A].select_sphere(10)).by_residue() > > And, When I try to print the selected atoms/residues Its just giving the > counts not the atoms/residues. So could you tell me how to do the same.
A selection acts much like a Python set, so you can just iterate through it and print each element, e.g.
print [a for a in s]
Ben Webb, Modeller Caretaker
participants (2)
-
Mahesh Velusamy
-
Modeller Caretaker