コード例 #1
0
    def find_pairs(selection1,
                   selection2,
                   state1=1,
                   state2=1,
                   cutoff=3.5,
                   mode=0,
                   angle=45,
                   _self=cmd):
        '''
DESCRIPTION

    "find_pairs" is currently undocumented.

        '''
        # preprocess selection
        selection1 = selector.process(selection1)
        selection2 = selector.process(selection2)
        #
        r = DEFAULT_ERROR
        try:
            _self.lock(_self)
            r = _cmd.find_pairs(_self._COb, "(" + str(selection1) + ")",
                                "(" + str(selection2) + ")",
                                int(state1) - 1,
                                int(state2) - 1, int(mode), float(cutoff),
                                float(angle))
            # 0 = default mode
        finally:
            _self.unlock(r, _self)
        if _raising(r, _self): raise pymol.CmdException
        return r
コード例 #2
0
ファイル: querying.py プロジェクト: jchodera/pymol
    def find_pairs(selection1,
                   selection2,
                   state1=1,
                   state2=1,
                   cutoff=3.5,
                   mode=0,
                   angle=45,
                   _self=cmd):
        '''
DESCRIPTION

    API only function. Returns a list of atom pairs. Atoms are represented as
    (model,index) tuples.

    Can be restricted to hydrogen-bonding-like contacts. WARNING: Only checks
    atom orientation, not atom type (so would hydrogen bond between carbons for
    example), so make sure to provide appropriate atom selections.

ARGUMENTS

    selection1, selection2 = string: atom selections

    state1, state2 = integer: state-index (only positive values allowed) {default: 1}

    cutoff = float: distance cutoff {default: 3.5}

    mode = integer: if mode=1, do coarse hydrogen bonding assessment {default: 0}

    angle = float: hydrogen bond angle cutoff, only if mode=1 {default: 45.0}

NOTE

    Although this does a similar job like "distance", it uses a completely
    different routine and the "mode" argument has different meanings!
        '''
        # preprocess selection
        selection1 = selector.process(selection1)
        selection2 = selector.process(selection2)
        #
        r = DEFAULT_ERROR
        try:
            _self.lock(_self)
            r = _cmd.find_pairs(_self._COb, "(" + str(selection1) + ")",
                                "(" + str(selection2) + ")",
                                int(state1) - 1,
                                int(state2) - 1, int(mode), float(cutoff),
                                float(angle))
            # 0 = default mode
        finally:
            _self.unlock(r, _self)
        if _raising(r, _self): raise pymol.CmdException
        return r
コード例 #3
0
ファイル: querying.py プロジェクト: gratefulfrog/lib
    def find_pairs(selection1,selection2,state1=1,state2=1,cutoff=3.5,mode=0,angle=45,_self=cmd):
        '''
DESCRIPTION

    API only function. Returns a list of atom pairs. Atoms are represented as
    (model,index) tuples.

    Can be restricted to hydrogen-bonding-like contacts. WARNING: Only checks
    atom orientation, not atom type (so would hydrogen bond between carbons for
    example), so make sure to provide appropriate atom selections.

ARGUMENTS

    selection1, selection2 = string: atom selections

    state1, state2 = integer: state-index (only positive values allowed) {default: 1}

    cutoff = float: distance cutoff {default: 3.5}

    mode = integer: if mode=1, do coarse hydrogen bonding assessment {default: 0}

    angle = float: hydrogen bond angle cutoff, only if mode=1 {default: 45.0}

NOTE

    Although this does a similar job like "distance", it uses a completely
    different routine and the "mode" argument has different meanings!
        '''
        # preprocess selection
        selection1 = selector.process(selection1)
        selection2 = selector.process(selection2)
        #      
        r = DEFAULT_ERROR
        try:
            _self.lock(_self)
            r = _cmd.find_pairs(_self._COb,"("+str(selection1)+")",
                                      "("+str(selection2)+")",
                                      int(state1)-1,int(state2)-1,
                                      int(mode),float(cutoff),float(angle))
            # 0 = default mode
        finally:
            _self.unlock(r,_self)
        if _raising(r,_self): raise pymol.CmdException
        return r
コード例 #4
0
ファイル: querying.py プロジェクト: Almad/pymol
    def find_pairs(selection1,selection2,state1=1,state2=1,cutoff=3.5,mode=0,angle=45,_self=cmd):
        '''
DESCRIPTION

    "find_pairs" is currently undocumented.

        '''
        # preprocess selection
        selection1 = selector.process(selection1)
        selection2 = selector.process(selection2)
        #      
        r = DEFAULT_ERROR
        try:
            _self.lock(_self)
            r = _cmd.find_pairs(_self._COb,"("+str(selection1)+")",
                                      "("+str(selection2)+")",
                                      int(state1)-1,int(state2)-1,
                                      int(mode),float(cutoff),float(angle))
            # 0 = default mode
        finally:
            _self.unlock(r,_self)
        if _raising(r,_self): raise pymol.CmdException
        return r