예제 #1
0
def ssm_fit(aRefMol, aRefSel, aMovMol, aMovSel):
    mgr = cuemol.getService("MolAnlManager");
    refMol = cuemol.obj(aRefMol)
    refSel = cuemol.sel(aRefSel, refMol.getScene())
    movMol = cuemol.obj(aMovMol)
    movSel = cuemol.sel(aMovSel, movMol.getScene())
    mgr.superposeSSM1(refMol, refSel, movMol, movSel, False);
예제 #2
0
def merge(aToMol, aFromMol, aFromSel, aCopy=False):
    mgr = cuemol.getService("MolAnlManager");
    toMol = cuemol.obj(aToMol)
    fromMol = cuemol.obj(aFromMol)
    fromSel = cuemol.sel(aFromSel, fromMol.getScene())
    mgr.copyAtoms(toMol, fromMol, fromSel);
    if not aCopy:
        mgr.deleteAtoms(fromMol, fromSel);
예제 #3
0
def calc_rmsd(aRefMol, aRefSel, aMovMol, aMovSel):
    mgr = cuemol.getService("MolAnlManager")
    refMol = cuemol.obj(aRefMol)
    refSel = cuemol.sel(aRefSel, refMol.getScene())
    movMol = cuemol.obj(aMovMol)
    movSel = cuemol.sel(aMovSel, movMol.getScene())
    rmsd = mgr.calcRMSD(refMol, refSel, movMol, movSel, "")
    return rmsd
예제 #4
0
파일: cmd.py 프로젝트: ishitani/cuemol2
def delete(aObj, aType=None):
    tgt = None
    if cuemol.iswrapper(aObj):
        tgt = aObj
    else:
        # try renderer name/uid
        try:
            tgt = cuemol.rend(aObj)
        except:
            pass

        # try object name/uid
        if tgt == None:
            try:
                tgt = cuemol.obj(aObj)
            except:
                return False

    if cuemol.isobj(tgt):
        sc = tgt.getScene()
        sc.destroyObject(tgt.uid)
        return True
    elif cuemol.isrend(tgt):
        obj = tgt.getClientObj()
        obj.destroyRenderer(tgt.uid)
        return True

    return False
예제 #5
0
파일: cmd.py 프로젝트: CueMol/cuemol2
def delete(aObj, aType=None):
    tgt = None
    if cuemol.iswrapper(aObj):
        tgt = aObj
    else:
        # try renderer name/uid
        try:
            tgt = cuemol.rend(aObj)
        except:
            pass

        # try object name/uid
        if tgt==None:
            try:
                tgt = cuemol.obj(aObj)
            except:
                return False

    if cuemol.isobj(tgt):
        sc = tgt.getScene()
        sc.destroyObject(tgt.uid)
        return True
    elif cuemol.isrend(tgt):
        obj = tgt.getClientObj()
        obj.destroyRenderer(tgt.uid)
        return True

    return False
예제 #6
0
    def __init__(self, aMol, aSel):
        molObj = cuemol.obj(aMol)
        selObj = cuemol.sel(aSel, molObj.scene_uid)

        self.mIter = cuemol.createObj("ResidIterator");
        self.mIter.target = molObj;
        self.mIter.sel = selObj;

        self.mIter.first()
예제 #7
0
def saveObject(aObj, aFileName, aFmtName, aOpts=None):
    obj = cuemol.obj(aObj)

    strMgr = cuemol.svc("StreamManager")
    writer = strMgr.createHandler(aFmtName, 1)
    writer.setPath(aFileName)

    writer.attach(obj)
    writer.write()
    writer.detach()
예제 #8
0
    def __init__(self, aMol, aSel="*"):
        molObj = cuemol.obj(aMol)
        #uid = molObj.uid
        selObj = cuemol.sel(aSel, molObj.scene_uid)

        self.mIter = cuemol.createObj("AtomIterator")
        self.mIter.target = molObj
        self.mIter.sel = selObj

        self.mIter.first()
예제 #9
0
def saveObject(aObj, aFileName, aFmtName, aOpts=None):
    obj = cuemol.obj(aObj)

    strMgr = cuemol.svc("StreamManager")
    writer = strMgr.createHandler(aFmtName, 1)

    if aOpts is not None:
        for k, v in aOpts.items():
            print("writer set prop: k=", k, "v=", v)
            ci.setProp(writer, k, v)

    writer.setPath(aFileName)

    writer.attach(obj)
    writer.write()
    writer.detach()
예제 #10
0
파일: fileio.py 프로젝트: CueMol/cuemol2
def saveObject(aObj, aFileName, aFmtName, aOpts=None):
    obj = cm.obj(aObj)

    strMgr = cm.strMgr()
    writer = strMgr.createHandler(aFmtName, 1)

    if aOpts is not None:
        for k,v in aOpts.items():
            print("writer set prop: k=",k,"v=",v)
            ci.setProp(writer._wrapped, k, v)

    writer.setPath(aFileName)

    writer.attach(obj)
    writer.write();
    writer.detach();
예제 #11
0
def forEachResid(aMol, aSel, aFn):
    molObj = cuemol.obj(aMol)

    selObj = cuemol.sel(aSel, molObj.scene_uid)

    iter = cuemol.createObj("ResidIterator");

    iter.target = molObj;
    iter.sel = selObj;

    iter.first()
    while True:
        if not iter.hasMore():
            break
        resid = iter.get()
        if aFn(resid):
            break
        iter.next()
예제 #12
0
def chg_chain(aFromMol, aFromSel, aNewChName):
    mgr = cuemol.getService("MolAnlManager");
    fromMol = cuemol.obj(aFromMol)
    fromSel = cuemol.sel(aFromSel, fromMol.getScene())
    mgr.changeChainName(fromMol, fromSel, aNewChName);
예제 #13
0
def del_atoms(aMol, aSel):
    mgr = cuemol.getService("MolAnlManager");
    mol = cuemol.obj(aMol)
    sel = cuemol.sel(aSel, mol.getScene())
    mgr.deleteAtoms(mol, sel);