Search code examples
alignmentpymol

PyMOL: Get sequence of selection


I have made a selection of residues like this:

fetch 1bsx
select interface_1bsx, byres((1bs and chain A) within 5A of (1bsx and chain X)) 

How do I get the sequence of interface_1bsx?


Solution

  • Use the iterate command (pymol wiki):

    iterate interface_1bsx, resn
    

    Or if you prefer to have it in a python list:

    residues = []
    iterate interface_1bsx, residues.append(resn)
    print(residues)