예제 #1
0
    def testPolI(self):
        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        g = xla.get_gui()

        g.modelSelect.doSync(ms)

        xFrame = g.Xlinks

        xFrame.displayDefault()

        self.assertEqual(1, len(xFrame.getXlinkDataMgrs()))

        xmgr = xFrame.getXlinkDataMgrs()[0]
        # self.assertEqual(171, len(xmgr.pbg.pseudoBonds))

        xFrame.ld_score_var.set(30.0)

        displayed = len([pb for pb in xmgr.pbg.pseudoBonds if pb.display == True])
        # self.assertEqual(106, displayed)

        #just test open windows
        # g.configFrame.domainsButton.invoke()
        # g.configFrame.subCompButton.invoke()
    def setUp(self):
        mPaths = ["PolI/4C3H.pdb"]
        super(TestPolI, self).setUp(mPaths)

        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        self.g = xla.get_gui()

        self.g.modelSelect.doSync(ms)
    def setUp(self):
        mPaths = ['Rvb12/yRvb12.hexamer.pdb']
        cPath = 'Rvb12/Rvb12.json'
        super(TestTutorial, self).setUp(mPaths, cPath)
        ms = xla.get_gui().Subunits.table.modelSelect
        self.model = chimera.openModels.list()[0]
        ms.setvalue([self.model])

        self.g = xla.get_gui()

        self.g.modelSelect.doSync(ms)
예제 #4
0
    def setUp(self):
        mPaths = ['PolI/4C3H.pdb']
        super(TestPolI, self).setUp(mPaths)

        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        self.g = xla.get_gui()

        self.g.modelSelect.doSync(ms)
    def setUp(self):
        mPaths = ["Rvb12/yRvb12.hexamer.pdb"]
        cPath = "Rvb12/Rvb12.json"
        super(TestTutorial, self).setUp(mPaths, cPath)
        ms = xla.get_gui().Subunits.table.modelSelect
        self.model = chimera.openModels.list()[0]
        ms.setvalue([self.model])

        self.g = xla.get_gui()

        self.g.modelSelect.doSync(ms)
    def setUp(self):
        mPaths = ['PolI/4C3H.pdb']
        cPath = 'PolI/PolI_old_format.json'
        super(TestPolI, self).setUp(mPaths, cPath)

        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        self.g = xla.get_gui()

        self.g.modelSelect.doSync(ms)
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual("move component", m.mode)

        name = "A49-tWH"
        xla.activateByName(name)
예제 #8
0
    def onAdd(self):
        if self.validate():
            self.synchronize()
            try:
                if not self.differs:
                    if self.listFrame:
                        if type(self.data) == dict:
                            _type = self.fields["type"][3].get()
                            _type = self.typeDict[_type]
                            cp = deepcopy(self.data[_type])
                        else:
                            cp = deepcopy(self.data)
                        self.listFrame.container.addItem(cp)
                        self.listFrame.synchronize()
                        self.listFrame.toBottom()
                elif self.differs:
                    _type = self.fields["Type"][3].get()
                    name = self.fields["Choose"][3].get()
                    pool = self.fields["Choose"][0][_type]
                    choice = [p for p in pool if p.name == name][0]
                    if self.listFrame:
                        self.listFrame.container.addItem(choice)
                        self.listFrame.synchronize()
                        self.listFrame.toBottom()
            finally:
                self.empty()

        g = xlinkanalyzer.get_gui()
        g.configFrame._disableHack()
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        name = 'A49-tWH'
        xla.activateByName(name)
    def testPolI(self):
        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        g = xla.get_gui()

        g.modelSelect.doSync(ms)

        xFrame = g.Xlinks

        xFrame.displayDefault()

        self.assertEqual(1, len(xFrame.getXlinkDataMgrs()))

        xmgr = xFrame.getXlinkDataMgrs()[0]
        self.assertNotEqual(0, len(xmgr.pbg.pseudoBonds))
예제 #11
0
    def testPolI(self):
        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        g = xla.get_gui()

        g.modelSelect.doSync(ms)

        xFrame = g.Xlinks

        xFrame.displayDefault()

        self.assertEqual(1, len(xFrame.getXlinkDataMgrs()))

        xmgr = xFrame.getXlinkDataMgrs()[0]
        self.assertNotEqual(0, len(xmgr.pbg.pseudoBonds))
    def testLoad(self):
        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        g = xla.get_gui()

        g.modelSelect.doSync(ms)

        xFrame = g.Xlinks

        xFrame.displayDefault()

        self.assertEqual(1, len(xFrame.getXlinkDataMgrs()))

        xmgr = xFrame.getXlinkDataMgrs()[0]
        displayed = len([pb for pb in xmgr.pbg.pseudoBonds if pb.display == True])
        self.assertEqual(75, displayed)
예제 #13
0
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        # name = 'A190'
        name = 'testdom'
        # name = 'testsubcomplex'
        xla.activateByName(name)
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        name = 'Rvb1'
        # xla.activateByName(name)
        # xla.activateByName(name, 'A')
        xla.activateByName(name, ['A', 'B'])
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        name = 'Rvb1'
        # xla.activateByName(name)
        # xla.activateByName(name, 'A')
        xla.activateByName(name, ['A', 'B'])
예제 #16
0
    def testLoad(self):
        ms = xla.get_gui().Subunits.table.modelSelect
        m = chimera.openModels.list()[0]
        ms.setvalue([m])

        g = xla.get_gui()

        g.modelSelect.doSync(ms)

        xFrame = g.Xlinks

        xFrame.displayDefault()

        self.assertEqual(1, len(xFrame.getXlinkDataMgrs()))

        xmgr = xFrame.getXlinkDataMgrs()[0]
        displayed = len(
            [pb for pb in xmgr.pbg.pseudoBonds if pb.display == True])
        self.assertEqual(75, displayed)
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        name = 'Rvb1'
        # xla.activateByName(name)
        xla.activateByName(name, 'C')
        # xla.activateByName(name, ['A', 'C'])
        #move around, should move
        symmover = symmove.SymMover()
        symmover.activate()
예제 #18
0
    def setUp(self, mPaths, cPath):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [path.join(xlaTestPath, _path) for _path in mPaths]
        self.xlaTestCPath = path.join(xlaTestPath, cPath)

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
    def testMover(self):
        m = xla.get_gui().Subunits.table.mover

        self.assertEqual('move component', m.mode)

        name = 'Rvb1'
        # xla.activateByName(name)
        xla.activateByName(name, 'C')
        # xla.activateByName(name, ['A', 'C'])
        #move around, should move
        symmover = symmove.SymMover()
        symmover.activate()
예제 #20
0
    def setUp(self, mPaths, cPath):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [
            path.join(xlaTestPath, _path) for _path in mPaths
        ]
        self.xlaTestCPath = path.join(xlaTestPath, cPath)

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
예제 #21
0
    def setUp(self, mPaths):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [path.join(xlaTestPath, _path) for _path in mPaths]

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
        guiWin.configFrame.resMngr.config.loadFromStructure(self.models[-1])

        guiWin.configFrame.clear()
        guiWin.configFrame.update()
        guiWin.configFrame.config.state = "changed"

        self.config = guiWin.configFrame.config
예제 #22
0
    def setUp(self, mPaths, cPath):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [path.join(xlaTestPath, _path) for _path in mPaths]
        self.xlaTestCPath = path.join(xlaTestPath, cPath)

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
        guiWin.configFrame.resMngr.loadAssembly(guiWin, self.xlaTestCPath)
        guiWin.configFrame.clear()
        guiWin.configFrame.update()
        guiWin.configFrame.mainWindow.setTitle(guiWin.configFrame.config.file)
        guiWin.configFrame.config.state = "unchanged"

        self.config = guiWin.configFrame.config
예제 #23
0
    def setUp(self, mPaths):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [
            path.join(xlaTestPath, _path) for _path in mPaths
        ]

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
        guiWin.configFrame.resMngr.config.loadFromStructure(self.models[-1])

        guiWin.configFrame.clear()
        guiWin.configFrame.update()
        guiWin.configFrame.config.state = "changed"

        self.config = guiWin.configFrame.config
예제 #24
0
    def setUp(self, mPaths, cPath):

        mPath = xlinkanalyzer.__path__[0]
        xlaTestPath = path.join(path.split(mPath)[0], 'pytests/test_data')
        self.xlaTestMPaths = [
            path.join(xlaTestPath, _path) for _path in mPaths
        ]
        self.xlaTestCPath = path.join(xlaTestPath, cPath)

        [chimera.openModels.open(_path) for _path in self.xlaTestMPaths]
        self.models = chimera.openModels.list()

        gui.show_dialog()
        guiWin = xlinkanalyzer.get_gui()
        guiWin.configFrame.resMngr.loadAssembly(guiWin, self.xlaTestCPath)
        guiWin.configFrame.clear()
        guiWin.configFrame.update()
        guiWin.configFrame.mainWindow.setTitle(guiWin.configFrame.config.file)
        guiWin.configFrame.config.state = "unchanged"

        self.config = guiWin.configFrame.config
예제 #25
0
def is_satisfied(b, threshold):
    if b:
        return b.length() < threshold

def restyleXlinks(xMgrs, threshold=None):
    '''Restyle xlinks in provided XlinkDataMgr objects.'''
    good_color = chimera.MaterialColor(0,0,255)
    bad_color = chimera.MaterialColor(255,0,0)

    for xMgr in xMgrs:
        for b in xMgr.iterXlinkPseudoBonds():
            if b is not None:
                b.drawMode = chimera.Bond.Stick

                if threshold is not None:
                    if is_satisfied(b, threshold):
                            b.color = good_color
                            b.radius = 0.6
                    else:
                            b.color = bad_color
                            b.radius = 0.6
                else:
                    b.color = bad_color
                    b.radius = 0.6

chimeraModel = chimera.openModels.list()[-1]
gui = xlinkanalyzer.get_gui()
x = gui.Xlinks.getXlinkDataMgrs()
xMgrs = gui.Xlinks.getXlinkDataMgrs()

restyleXlinks(xMgrs, threshold=30)
예제 #26
0
def get_first_xlinkMgr():
    gui = xla.get_gui()
    xframe = gui.Xlinks
    return xframe.dataMgrs[0]
예제 #27
0
import xlinkanalyzer as xla
reload(xla)

gui = xla.get_gui()

xframe = gui.Xlinks


def get_first_xlinkMgr():
    gui = xla.get_gui()
    xframe = gui.Xlinks
    return xframe.dataMgrs[0]


xframe.getActiveData()

x = get_first_xlinkMgr()
x.countSatisfiedBetweenSelections(30, '#0:.C', '#0:.C')
x.pbg.pseudoBonds
예제 #28
0
        return b.length() < threshold


def restyleXlinks(xMgrs, threshold=None):
    '''Restyle xlinks in provided XlinkDataMgr objects.'''
    good_color = chimera.MaterialColor(0, 0, 255)
    bad_color = chimera.MaterialColor(255, 0, 0)

    for xMgr in xMgrs:
        for b in xMgr.iterXlinkPseudoBonds():
            if b is not None:
                b.drawMode = chimera.Bond.Stick

                if threshold is not None:
                    if is_satisfied(b, threshold):
                        b.color = good_color
                        b.radius = 0.6
                    else:
                        b.color = bad_color
                        b.radius = 0.6
                else:
                    b.color = bad_color
                    b.radius = 0.6


chimeraModel = chimera.openModels.list()[-1]
gui = xlinkanalyzer.get_gui()
x = gui.Xlinks.getXlinkDataMgrs()
xMgrs = gui.Xlinks.getXlinkDataMgrs()

restyleXlinks(xMgrs, threshold=30)
예제 #29
0
def get_first_xlinkMgr():
    gui = xla.get_gui()
    xframe = gui.Xlinks
    return xframe.dataMgrs[0]
예제 #30
0
import xlinkanalyzer as xla
reload(xla)

gui = xla.get_gui()

xframe = gui.Xlinks

def get_first_xlinkMgr():
    gui = xla.get_gui()
    xframe = gui.Xlinks
    return xframe.dataMgrs[0]

xframe.getActiveData()

x = get_first_xlinkMgr()
x.countSatisfiedBetweenSelections(30, '#0:.C', '#0:.C')
x.pbg.pseudoBonds