Am 04.03.2009 um 06:46 schrieb Warren DeLano:

Hey Warren,

It is remarkable that a question like this hasn't come up before, but it reveals a rather large whole in PyMOL's selection language: though we have some proximity operators, we are not currently able to select atoms based on absolute or relative coordinate vector relationships.

So the present answer to your question appears to be "no". Sorry about that!

Just to give the application to my question: If you wanna select the upper leaflet of a bilayer - an easy method - shown to me in VMD is to select "by residue" all Phosphor atoms with e.g. z > 40...

Well I scripted a bit around it which worked in my case:

def leafletIndex():
    '''
Create leaflet indices for upper and lower bilayer, based on Phosphor atoms
    '''

    cmd.delete("Phosphor")
    cmd.delete("UpperLeaflet")
    cmd.delete("LowerLeaflet")


    cmd.select("Phosphor","name P*")
    ext=cmd.get_extent("Phosphor")
    lower=ext[0][2]
    upper=ext[1][2]
    middle=upper-lower
    atoms = cmd.get_model("Phosphor")

    cmd.select("UpperLeaflet",None)
    cmd.select("LowerLeaflet",None)

    for at in atoms.atom:
        if at.coord[2] > middle:
cmd.select("UpperLeaflet","UpperLeaflet or index %d"%at.index)
        else:
cmd.select("LowerLeaflet","LowerLeaflet or index %d"%at.index)

    cmd.select("UpperLeaflet","byres UpperLeaflet")
    cmd.select("LowerLeaflet","byres LowerLeaflet")
    cmd.deselect()


Best
        Martin

Reply via email to