Ejemplo n.º 1
0
    def callout(name,
                label,
                pos='',
                screen='auto',
                state=-1,
                color='front',
                quiet=1,
                _self=cmd):
        '''
DESCRIPTION

    Create a new screen-stabilized callout object.

ARGUMENTS

    name = str: object name

    label = str: label text

    pos = str or list: anchor in model space as 3-float coord list or atom
    selection. If empty, don't draw an arrow. {default: }

    screen = str or list: position on screen as 2-float list between [-1,-1]
    (lower left) and [1,1] (upper right) or "auto" for smart placement.
    {default: auto}
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 2
0
    def find(name, i=0, quiet=1, _self=cmd):
        '''
DESCRIPTION

    Find an item in the object menu panel and scroll it to the top.
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 3
0
    def focal_blur(aperture=2.0,
                   samples=10,
                   ray=0,
                   filename='',
                   quiet=1,
                   _self=cmd):
        '''
DESCRIPTION

    Creates fancy figures by introducing a focal blur to the image.
    The object at the origin will be in focus.

USAGE

    focal_blur [ aperture [, samples [, ray [, filename ]]]]

ARGUMENTS

    aperture = float: aperture angle in degrees {default: 2.0}

    samples = int: number of images for averaging {default: 10}

    ray = 0/1: {default: 0}

    filename = str: write image to file {default: temporary}

AUTHORS

    Jarl Underhaug, Jason Vertrees and Thomas Holder

EXAMPLES

    focal_blur 3.0, 50
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 4
0
def assign_stereo(selection='all',
                  state=-1,
                  method='',
                  quiet=1,
                  prop='stereo',
                  _self=cmd):
    '''
DESCRIPTION

    Assign "stereo" atom property (R/S stereochemistry).

    Requires either a Schrodinger Suite installation (SCHRODINGER
    environment variable set) or RDKit (rdkit Python module).

USAGE

    assign_stereo [selection [, state [, method ]]]

ARGUMENTS

    selection = str: atom selection {default: all}

    state = int: object state {default: -1 (current)}

    method = schrodinger or rdkit: {default: try both}
    '''
    raise pymol.IncentiveOnlyException()
Ejemplo n.º 5
0
def read_collada(contents: bytes, oname, state=0, zoom=-1, *, _self=cmd):
    '''
DESCRIPTION

    Load COLLADA content as a CGO object
    '''
    raise pymol.IncentiveOnlyException(
            "COLLADA import not supported by this PyMOL build")
Ejemplo n.º 6
0
def read_stlstr(contents, object, state=0, zoom=-1, _self=cmd):
    '''
DESCRIPTION

    Load STL ASCII or binary content as a CGO object
    '''
    raise pymol.IncentiveOnlyException(
            "STL import not supported by this PyMOL build")
Ejemplo n.º 7
0
def get_stlstr(binary=1, quiet=0, _self=cmd):
    '''
DESCRIPTION

    STL geometry export
    '''
    raise pymol.IncentiveOnlyException(
            "STL export not supported by this PyMOL build")
Ejemplo n.º 8
0
    def help_setting(name, quiet=1, _self=cmd):
        '''
DESCRIPTION

    Print documentation for a setting.

USAGE

    help_setting name
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 9
0
    def desaturate(selection="all", a=0.5, quiet=1, _self=cmd):
        '''
DESCRIPTION

    Desaturate the colors in the given selection.

ARGUMENTS

    selection = str: atom selection {default: all}

    a = float [0..1]: desaturation factor {default: 0.5}
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 10
0
def morph(name,
          sele1,
          sele2=None,
          state1=-1,
          state2=-1,
          refinement=3,
          steps=30,
          method='rigimol',
          match='align',
          quiet=1,
          _self=cmd):
    '''
DESCRIPTION

    Creates an interpolated trajectory between two or multiple conformations.
    If the two input objects are not the same, match them based on sequence
    alignment.

    This command supports two methods: rigimol and linear. RigiMOL is an
    incentive feature and only available to official PyMOL sponsors. Linear
    morphing is quick and robust but likely to produce distorted intermediates.

ARGUMENTS

    name = string: name of object to create

    sele1 = string: atom selection of first conformation

    sele2 = string: atom selection of second conformation {default: <sele1>}

    state1 = int: sele1 state {default: 1}. If state1=0 and sele1 has N
    states, create N morphings between all consecutive states and back from
    state N to 1 (so the morph will have N*steps states). If state2=0, create
    N-1 morphings and stop at last state.

    state2 = int: sele2 state {default: 2 if sele1=sele2, else 1}

    refinement = int: number of sculpting refinement cycles to clean
    distorted intermediates {default: 3}

    steps = int: number of states for sele2 object {default: 30}

    method = string: rigimol or linear {default: rigimol}

EXAMPLE

    fetch 1akeA 4akeA, async=0
    align 1akeA, 4akeA
    morph mout, 1akeA, 4akeA
    '''
    raise pymol.IncentiveOnlyException()
Ejemplo n.º 11
0
def diagnostics(filename='', compact=0, quiet=1):
    '''
DESCRIPTION

    Get system level diagnostics data

USAGE

    diagnostics [ filename ]

ARGUMENTS

    filename = str: If given, write output to text file
    '''
    import pymol
    raise pymol.IncentiveOnlyException()
Ejemplo n.º 12
0
    def pi_interactions(name="",
                        selection1="all",
                        selection2="same",
                        state=ALL_STATES,
                        state1=-3,
                        state2=-3,
                        quiet=1,
                        reset=0,
                        _self=cmd):
        '''
DESCRIPTION

    Find pi-pi and pi-cation interactions.

    Identical to cmd.distance(..., mode=5, label=0)

SEE ALSO

    distance
        '''
        raise pymol.IncentiveOnlyException()
Ejemplo n.º 13
0
def validate():
    global _rigimol_exe
    if _rigimol_exe != None:  # _rigimol_exe assigned, so presume valid
        return

    paths = [
        os.path.dirname(__file__),
        os.path.dirname(sys.executable),
    ] + os.getenv('PATH', '').split(os.pathsep)

    for exe in ['rigimol.exe', 'rigimol']:
        for p in paths:
            test_path = os.path.join(p, exe)
            if os.path.isfile(test_path):
                _rigimol_exe = test_path
                return

        if sys.platform.startswith('win'):
            # skip looking for rigimol without .exe extension
            break

    raise pymol.IncentiveOnlyException("rigimol not available")
Ejemplo n.º 14
0
def _load(oname,finfo,state,ftype,finish,discrete,
          quiet=1,multiplex=0,zoom=-1,mimic=1,
          plugin='',
          object_props=None,
          atom_props=None, _self=cmd):
    # WARNING: internal routine, subject to change
    # caller must already hold API lock
    # NOTE: state index assumes 1-based state
    r = DEFAULT_ERROR
    size = 0
    if ftype not in (loadable.model,loadable.brick):
        if ftype == loadable.r3d:
            from . import cgo
            obj = cgo.from_r3d(finfo)
            if is_ok(obj):
                r = _cmd.load_object(_self._COb,str(oname),obj,int(state)-1,loadable.cgo,
                                      int(finish),int(discrete),int(quiet),
                                      int(zoom))
            else:
                print("Load-Error: Unable to open file '%s'."%finfo)
        elif ftype == loadable.cc1: # ChemDraw 3D
            obj = chempy.io.cc1.fromFile(finfo)
            if obj:
                r = _cmd.load_object(_self._COb,str(oname),obj,int(state)-1,loadable.model,
                                      int(finish),int(discrete),
                                      int(quiet),int(zoom))
        elif ftype == loadable.moe:
            try:
                # BEGIN PROPRIETARY CODE SEGMENT
                from epymol import moe
                moe_str = _self.file_read(finfo)
                r = moe.read_moestr(moe_str,str(oname),int(state),
                                int(finish),int(discrete),int(quiet),int(zoom),_self=_self)

                # END PROPRIETARY CODE SEGMENT
            except ImportError:
                raise pymol.IncentiveOnlyException(".MOE format not supported by this PyMOL build.")

        elif ftype == loadable.mae:
            try:
                # BEGIN PROPRIETARY CODE SEGMENT
                from epymol import mae
                mae_str = _self.file_read(finfo)
                r = mae.read_maestr(mae_str,str(oname),
                                    int(state),
                                    int(finish),int(discrete),
                                    int(quiet),int(zoom),int(multiplex),
                                    int(mimic),
                                    _self=_self)

                # END PROPRIETARY CODE SEGMENT
            except ImportError:
                raise pymol.IncentiveOnlyException(".MAE format not supported by this PyMOL build.")

        else:
            if ftype in _load2str and ('://' in finfo
                    or cmd.gz_ext_re.search(finfo)
                    or any(c > '~' for c in finfo) # ascii check
                    ):
                # NOTE: we could safely always do this, not only for URLs and
                # compressed files. But I don't want to change the old behavior
                # that regular files are read from the C function.
                finfo = _self.file_read(finfo)
                ftype = _load2str[ftype]
            r = _cmd.load(_self._COb,str(oname),finfo,int(state)-1,int(ftype),
                          int(finish),int(discrete),int(quiet),
                          int(multiplex),int(zoom), plugin, object_props)
    else:
        try:
            x = chempy.io.pkl.fromFile(finfo)
            if isinstance(x, (list, tuple)):
                for a in x:
                    r = _cmd.load_object(_self._COb,str(oname),a,int(state)-1,
                                                int(ftype),0,int(discrete),int(quiet),
                                                int(zoom))
                    if(state>0):
                        state = state + 1
                _cmd.finish_object(_self._COb,str(oname))
            else:
                r = _cmd.load_object(_self._COb,str(oname),x,
                                            int(state)-1,int(ftype),
                                            int(finish),int(discrete),
                                            int(quiet),int(zoom))
        except:
#            traceback.print_exc()
            print("Load-Error: Unable to load file '%s'." % finfo)
    return r