当前位置: 首页>>代码示例>>Python>>正文


Python OrangeWidgets.OWGUI类代码示例

本文整理汇总了Python中Orange.OrangeWidgets.OWGUI的典型用法代码示例。如果您正苦于以下问题:Python OWGUI类的具体用法?Python OWGUI怎么用?Python OWGUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OWGUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self,parent=None, signalManager = None):
        OWWidget.__init__(self, parent, signalManager, "&Display Motifs", 0)

        # set default settings
        self.colorBy = None
        self.pvalThresholdIndex = None
        self.pvalThreshold = None

        #load settings
        self.loadSettings()

        # GUI
        self.graph = OWGraph(self.mainArea)
        self.graph.setYRlabels(None)
        self.graph.enableGridXB(0)
        self.graph.enableGridYL(1)
        self.graph.setAxisMaxMinor(QwtPlot.xBottom, 10)
        self.graph.setAxisMaxMajor(QwtPlot.xBottom, 10)
        self.graph.setAxisAutoScale(QwtPlot.xBottom)
        self.graph.setAxisScale(QwtPlot.xBottom, -1020, 0, 0)
        self.mainArea.layout().addWidget(self.graph)
        
        # inputs
        # data and graph temp variables
        self.inputs = [("Examples", ExampleTable, self.cdata, Default), ("Genes", list, self.newGeneList, Default), ("Motifs", list, self.newMotifList, Default)]

        self.data = None
        self.motifLines = []
        self.visibleValues = []
        self.valueToCurve = {}
        self.allGenes = [] ## genes displayed always in same order
        self.geneList = [] ## selected genes
        self.motifList = [] ## selected motifs
        self.valuesPresentInData = []

        self.clusterPostProbThreshold = 0

        # GUI
        self.selValues = OWGUI.widgetBox(self.controlArea, "Values")
        self.selcolorBy = OWGUI.widgetBox(self.controlArea, "Color By")

        self.colorByCombo = OWGUI.comboBox(self.selcolorBy, self, "colorBy",
                                           items=[],
                                           callback=self.colorByChanged)
        
        self.pvalThresholdCombo = OWGUI.comboBox(self.selValues, self, "pvalThresholdIndex",
                                                 items=[],
                                                 callback=self.pvalThresholdChanged)
        
        self.valuesQLB = QListWidget(self.selValues)
        self.valuesQLB.setSelectionMode(QListWidget.MultiSelection)
        self.connect(self.valuesQLB, SIGNAL("itemSelectionChanged()"), self.valuesSelectionChange)
        self.selValues.layout().addWidget(self.valuesQLB)
        
        self.unselectAllQLB = OWGUI.button(self.selValues, self, "Unselect all",
                                           callback = self.unselAll)
开发者ID:acopar,项目名称:orange-bio,代码行数:56,代码来源:OWDisplayMotifs.py

示例2: __init__

    def __init__(self, parent=None, signalManager=None, title="Databases Pack"):

        super(OWDatabasesPack, self).__init__(parent, signalManager, title, wantMainArea=False)

        self.fileslist = [("Taxonomy", "ncbi_taxonomy.tar.gz")]
        self.downloadurl = "https://dl.dropboxusercontent.com/u/100248799/sf_pack.tar.gz"
        self.downloadmessage = (
            "Downloading a subset of available databases for a smoother " + "ride through the workshop"
        )
        self.loadSettings()
        self._tmpfile = None
        self.reply = None

        # Locks held on server files
        self.locks = []
        self.net_manager = QNetworkAccessManager()
        # Lock all files in files list so any other (in process) atempt to
        # download the files waits)
        box = OWGUI.widgetBox(self.controlArea, "Info")
        self.info = OWGUI.widgetLabel(box, self.downloadmessage)
        self.info.setWordWrap(True)

        box = OWGUI.widgetBox(self.controlArea, "Status")
        self.statusinfo = OWGUI.widgetLabel(box, "Please wait")
        self.statusinfo.setWordWrap(True)
        self.progressbar = QProgressBar()
        box.layout().addWidget(self.progressbar)

        self.setMinimumWidth(250)

        already_available = [
            (domain, filename) for domain in serverfiles.listdomains() for filename in serverfiles.listfiles(domain)
        ]

        if set(self.fileslist) <= set(already_available):
            # All files are already downloaded
            self.statusinfo.setText("All files already available")
            self.setStatusMessage("Done")
        else:
            for domain, filename in self.fileslist + [("_tmp_cache_", "pack")]:
                manager = serverfiles._lock_file(domain, filename)
                try:
                    manager.__enter__()
                except Exception:
                    warnings.warn("Could not acquire lock for {0} {0}".format(domain, filename))
                    self.warning(0, "...")
                else:
                    self.locks.append(manager)

            QTimer.singleShot(0, self.show)
            QTimer.singleShot(0, self.run)
开发者ID:testmana2,项目名称:orange,代码行数:51,代码来源:OWDatabasesPack.py

示例3: __init__

    def __init__(self, parent=None, signalManager = None):
        OWWidget.__init__(self, parent, signalManager, "Save Data Files", wantMainArea = 0, resizingEnabled = 1)

        self.inputs = [("Structured Data", DataFiles, self.structuredData, Default)]
        self.outputs = []
        self.dataStructure = None

        # Settings
        self.recentDirs=[]
        self.selectedDirName = "(none)"
        self.loadSettings()

        # GUI
        rfbox = OWGUI.widgetBox(self.controlArea, "Directory", orientation="horizontal", addSpace = True)
        self.dircombo = QComboBox(rfbox)
        rfbox.layout().addWidget(self.dircombo)
        browse = OWGUI.button(rfbox, self, '&...', callback = self.browseDirectory, disabled=0)
        browse.setMaximumWidth(25)
        # info
        box = OWGUI.widgetBox(self.controlArea, "Info", addSpace = True)
        self.infoa = OWGUI.widgetLabel(box, 'No data on input.')
        # Output
        box = OWGUI.widgetBox(self.controlArea, "Output", addSpace = True)
        self.save = OWGUI.button(box, self, '&Save', callback = self.saveData, disabled=1)
        self.adjustSize()
           
        # initial settings            
        self.recentDirs=filter(os.path.exists, self.recentDirs)
        self.setDirlist()
        self.dircombo.setCurrentIndex(0)
        self.resize(300,self.height())
开发者ID:acopar,项目名称:orange-bio,代码行数:31,代码来源:OWDataFilesSave.py

示例4: __init__

    def __init__(self, parent):
        QObject.__init__(self)
        grid = OWGUI.widgetBox(parent, "", orientation = "horizontal")
        grid.setMinimumWidth(250)
        grid.setMinimumHeight(100)

        self.boxes = [ OWGUI.listBox(grid, self) for a in range(2) ]

        for box in self.boxes: 
            #box.setSelectionMode(QListWidget.SingleSelection)
            box.setSelectionMode(QListWidget.MultiSelection)

        self.connect(self.boxes[0], SIGNAL("itemSelectionChanged ()"), self.highlighted1)
        self.connect(self.boxes[1], SIGNAL("itemSelectionChanged ()"), self.highlighted2)

        self.classes = []

        def createSquarePixmap(color = Qt.black):
            return OWGUI.createAttributePixmap("", color)

        self.whiteSq = createSquarePixmap(Qt.white)
        self.marked = [ createSquarePixmap(Qt.red), createSquarePixmap(Qt.blue) ]

        self.classVals = []
开发者ID:JakaKokosar,项目名称:orange-bio,代码行数:24,代码来源:OWGsea.py

示例5: __init__

    def __init__(self, parent=None, signalManager = None):
        OWWidget.__init__(self, parent, signalManager, 'Data Files Selector', wantMainArea = 0, resizingEnabled = 1)

        self.callbackDeposit = []

        self.inputs = [("Structured Data", DataFiles, self.onDataInput)]
        self.outputs = [("Examples", ExampleTable), ("Structured Data", DataFiles)]

        self.dataStructure = None
        self.datasets = None
        self.lastSentIds = []

        # Settings
        self.applyOnChange = 0
        self.loadSettings()

        # GUI
        # info
        box = OWGUI.widgetBox(self.controlArea, "Info", addSpace = True)
        self.infoa = OWGUI.widgetLabel(box, 'No data loaded.')
        self.infob = OWGUI.widgetLabel(box, '')
        self.infoc = OWGUI.widgetLabel(box, '')
            
        # LIST VIEW
        frmListView = OWGUI.widgetBox(self.controlArea, None, addSpace = True)
        self.tree = QTreeWidget(frmListView)
        self.tree.setSelectionMode(QAbstractItemView.MultiSelection)
        self.tree.setHeaderLabel("Directory/Data File")
        frmListView.layout().addWidget(self.tree)
        self.connect(self.tree,SIGNAL('itemSelectionChanged()'),self.selectionChanged)

        # Output
        box = OWGUI.widgetBox(self.controlArea, "Output", addSpace = True)
        OWGUI.checkBox(box, self, 'applyOnChange', 'Commit data on selection change')
        self.commitBtn = OWGUI.button(box, self, "Commit", callback=self.sendData, disabled=1)
        self.resize(300,600)
开发者ID:acopar,项目名称:orange-bio,代码行数:36,代码来源:OWDataFilesSelector.py

示例6: __init__

 def __init__(self, parent=None, signalManager=None, name="Normalize Expression Array"):
     OWWidget.__init__(self, parent, signalManager, name, wantGraph=True)
     
     self.inputs = [("Expression array", ExampleTable, self.setData)]
     self.outputs = [("Normalized expression array", ExampleTable, Default), ("Filtered expression array", ExampleTable)]
     
     self.selectedGroup = 0
     self.selectedCenterMethod = 0
     self.selectedMergeMethod = 0
     self.zCutoff = 1.96
     self.appendZScore = False
     self.appendRIValues = False
     self.autoCommit = False
     
     self.loadSettings()
     ## GUI
     self.infoBox = OWGUI.widgetLabel(OWGUI.widgetBox(self.controlArea, "Info", addSpace=True),
                                      "No data on input.")
     
     box = OWGUI.widgetBox(self.controlArea, "Split by", addSpace=True)
     self.groupCombo = OWGUI.comboBox(box, self, "selectedGroup", 
                                      callback=self.onGroupSelection
                                      )
     
     self.centerCombo = OWGUI.comboBox(self.controlArea, self, "selectedCenterMethod",
                                       box="Center Fold-change Using",
                                       items=[name for name, _ in self.CENTER_METHODS],
                                       callback=self.onCenterMethodChange,
                                       addSpace=True
                                       )
     
     self.mergeCombo = OWGUI.comboBox(self.controlArea, self, "selectedMergeMethod",
                                      box="Merge Replicates",
                                      items=[name for name, _ in self.MERGE_METHODS],
                                      tooltip="Select the method for replicate merging",
                                      callback=self.onMergeMethodChange,
                                      addSpace=True
                                      )
     
     box = OWGUI.doubleSpin(self.controlArea, self, "zCutoff", 0.0, 3.0, 0.01,
                            box="Z-Score Cutoff",
                            callback=[self.replotMA, self.commitIf])
     
     OWGUI.separator(self.controlArea)
     
     box = OWGUI.widgetBox(self.controlArea, "Ouput")
     OWGUI.checkBox(box, self, "appendZScore", "Append Z-Scores",
                    tooltip="Append calculated Z-Scores to output",
                    callback=self.commitIf
                    )
     
     OWGUI.checkBox(box, self, "appendRIValues", "Append Log Ratio and Intensity values",
                    tooltip="Append calculated Log Ratio and Intensity values to output data",
                    callback=self.commitIf
                    )
     
     cb = OWGUI.checkBox(box, self, "autoCommit", "Commit on change",
                    tooltip="Commit data on any change",
                    callback=self.commitIf
                    )
     
     b = OWGUI.button(box, self, "Commit", callback=self.commit)
     OWGUI.setStopper(self, b, cb, "changedFlag", callback=self.commit)
     
     self.connect(self.graphButton, SIGNAL("clicked()"), self.saveGraph)
     
     OWGUI.rubber(self.controlArea)
     self.graph = OWGraph(self.mainArea)
     self.graph.setAxisTitle(QwtPlot.xBottom, "Intensity: log<sub>10</sub>(R*G)")
     self.graph.setAxisTitle(QwtPlot.yLeft, "Log ratio: log<sub>2</sub>(R/G)")
     self.graph.showFilledSymbols = True
     self.mainArea.layout().addWidget(self.graph)
     self.groups = []
     self.split_data = None, None
     self.merged_splits = None, None
     self.centered = None, None
     self.changedFlag = False
     self.data = None
     
     self.resize(800, 600)
开发者ID:JakaKokosar,项目名称:orange-bio,代码行数:80,代码来源:OWMAPlot.py

示例7: __init__

    def __init__(self, parent=None, signalManager = None):
        OWWidget.__init__(self, parent, signalManager, 'ANOVA')
        # input / output data: [("name1", [orange.ExampleTable1a,...]), ("name2", [orange.ExampleTable2a,...])]
        self.inputs = [("Structured Data", DataFiles, self.onDataInput)]
        self.outputs = [("Example Selection", ExampleSelection, Default), ("Selected Structured Data", DataFiles, Default), ("Other Structured Data", DataFiles)]

        # data, p-values, selected examples
        self.dataStructure = None                       # input data
        self.numExamples = 0
        self.numVariables = 0
        self.ps = Numeric.ones((3,0), Numeric.Float)    # p-values: 2D Numeric.array of shape (3, numExamples)
        self.selectorName = ""                          # for Example Selection output: (self.selectorName, [0,1,0,...])

        # Settings
        self.anovaType = OWHypTest.StSST
        self.popMean = 0         # single sample t-test, value to compare to
        self.useFactors = [0,0,0]       # [use factor A, use factor B, use interaction]
        self._interaction = 0           # to store last setting: 0: no interaction, 1: test for interaction effect (set this value manually !!!)
        self.selectorA = True
        self.selectorB = False
        self.selectorI = False
        self.alphaA = "0.05"
        self.alphaB = "0.05"
        self.alphaI = "0.05"
        self.autoUpdateSelName = 1
        self.sendNotSelectedData = 1
        self.sendProbabilities = 0
        self.commitOnChange = 0
        self.loadSettings()

        # GUI
        self.mainArea.setFixedWidth(0)
        ca=QFrame(self.controlArea)
        gl=QGridLayout(ca,4,1,5)
        
        # info
        box = QVGroupBox("Info", ca)
        gl.addWidget(box,0,0)
        self.infoa = QLabel('No data on input.', box)
        self.infob = QLabel('', box)
        self.infoc = QLabel('', box)

        # ANOVA type
        self.boxAnovaType = QVButtonGroup("Statistics", ca)
        gl.addWidget(self.boxAnovaType,1,0)
        self.boxAnovaType.setDisabled(1)

        self.boxAnovaType.setRadioButtonExclusive(1)
        self.boxAnovaType.buttons = []
##        for i,lbl in enumerate(OWHypTest.StNames):
##            w = QRadioButton(lbl, self.boxAnovaType)
##            w.setOn(self.anovaType == i)
##            self.boxAnovaType.buttons.append(w)
##            if i == OWHypTest.StSST:
##                self.boxPopMean = QHBox(self.boxAnovaType)
##                QLabel("             population mean  ", self.boxPopMean)
##                OWGUI.lineEdit(self.boxPopMean, self, "popMean", callback=self.onPopMeanChange)
        for i,lbl in enumerate(OWHypTest.StNames):
            w = QRadioButton(lbl, self.boxAnovaType)
            w.setOn(self.anovaType == i)
            self.boxAnovaType.buttons.append(w)
            if i == OWHypTest.StSST:
                self.boxPopMean = QHBox(self.boxAnovaType)
                QLabel("       population mean  ", self.boxPopMean)
                OWGUI.lineEdit(self.boxPopMean, self, "popMean", callback=self.onPopMeanChange)
        OWGUI.connectControl(self.boxAnovaType, self, "anovaType", self.onAnovaType, "clicked(int)", OWGUI.CallFront_radioButtons(self.boxAnovaType))
        
        # selection of examples
        self.boxSelection = QVGroupBox("Example Selection", ca)
        gl.addWidget(self.boxSelection,2,0)
        self.lblNumGenes = []   # list of labels
        # selector A
        self.boxSelectorA = QVBox(self.boxSelection)
        self.cbSelectorA = OWGUI.checkBox(self.boxSelectorA, self, "selectorA", "Factor A (variables)", callback=self.onSelectionChange,
                                          tooltip='H0: The mean does not depend on factor A (represented by variables).')
        frmA = QFrame(self.boxSelectorA)
        glA = QGridLayout(frmA,1,3,5)
        leA = OWGUI.lineEdit(frmA, self, "alphaA", orientation="horizontal", controlWidth=None, callback=lambda x=0: self.onAlphaChange(x))
        glA.addWidget(leA,0,1) # Qt.AlignRight
        glA.addWidget(QLabel("     p <= ", frmA), 0,0)
        self.lblNumGenes.append(QLabel('', frmA))
        glA.addWidget(self.lblNumGenes[-1],0,2) # Qt.AlignRight | 0x22

        # selector B
        self.boxSelectorB = QVBox(self.boxSelection)
        self.cbSelectorB = OWGUI.checkBox(self.boxSelectorB, self, "selectorB", "Factor B (data sets)", callback=self.onSelectionChange,
                                          tooltip='H0: The mean does not depend on factor B (represented by data sets).')
        frmB = QFrame(self.boxSelectorB)
        glB = QGridLayout(frmB,1,3,5)
        leB = OWGUI.lineEdit(frmB, self, "alphaB", orientation="horizontal", callback=lambda x=1: self.onAlphaChange(x))
        glB.addWidget(leB,0,1)
        glB.addWidget(QLabel("     p <= ", frmB), 0,0)
        self.lblNumGenes.append(QLabel('', frmB))
        glB.addWidget(self.lblNumGenes[-1],0,2)
        
        # selector I
        self.boxSelectorI = QVBox(self.boxSelection)
        self.cbSelectorI = OWGUI.checkBox(self.boxSelectorI, self, "selectorI", "Interaction (variables * data sets)", callback=self.onSelectionChange,
                                          tooltip='H0: There is no interaction between factor A and factor B.')
        frmI = QFrame(self.boxSelectorI)
#.........这里部分代码省略.........
开发者ID:acopar,项目名称:orange-bio,代码行数:101,代码来源:OWHypTest.py

示例8: __init__

    def __init__(self, parent=None, signalManager = None, loaddata=1):
        OWWidget.__init__(self, parent, signalManager, 'Data Files', wantMainArea = 0, resizingEnabled = 1)

        self.callbackDeposit = []

        self.inputs = []
        self.outputs = [("Examples", ExampleTable), ("Structured Data", DataFiles)]

        self.dataStructure = []
        self.datasets = None
        self.lastSentIds = []

        # Settings
        self.recentDirs=[]  
        self.selectedDirName = "None"
        self.applyOnChange = 0
        self.loadSettings()

        # CONTROLS
        box = OWGUI.widgetBox(self.controlArea, "Directory", addSpace = True, orientation=0)
        self.dircombo=QComboBox(box)
        box.layout().addWidget(self.dircombo)
        button = OWGUI.button(box, self, '...', callback = self.browseDirectory, disabled=0)
        button.setMaximumWidth(25)
        # connecting GUI to code
        self.connect(self.dircombo,SIGNAL('activated(int)'),self.selectDir)

        # info
        box = OWGUI.widgetBox(self.controlArea, "Info", addSpace = True)
        self.infoa = OWGUI.widgetLabel(box, 'No data loaded.')
        self.infob = OWGUI.widgetLabel(box, '')
        self.infoc = OWGUI.widgetLabel(box, '')
            
        # LIST VIEW
        frmListView = OWGUI.widgetBox(self.controlArea, None, addSpace = True)
        self.tree = QTreeWidget(frmListView)
        self.tree.setSelectionMode(QAbstractItemView.MultiSelection)
        self.tree.setHeaderLabel("Directory/Data File")
        frmListView.layout().addWidget(self.tree)
        self.connect(self.tree,SIGNAL('itemSelectionChanged()'),self.selectionChanged)

        # Output
        box = OWGUI.widgetBox(self.controlArea, "Output", addSpace = True)
        OWGUI.checkBox(box, self, 'applyOnChange', 'Commit data on selection change')
        self.commitBtn = OWGUI.button(box, self, "Commit", callback=self.sendData, disabled=1)
        self.resize(300,600)

        # initial settings            
        self.recentDirs=filter(os.path.exists,self.recentDirs)
        self.setDirlist()
        self.dircombo.setCurrentIndex(0)
        if self.recentDirs!=[] and loaddata:
            self.loadData(self.recentDirs[0])
开发者ID:acopar,项目名称:orange-bio,代码行数:53,代码来源:OWDataFiles.py

示例9: __init__

    def __init__(self, parent=None, signalManager = None, name='Approximate Profiles'):
        self.callbackDeposit = [] # deposit for OWGUI callback functions
        OWWidget.__init__(self, parent, signalManager, name)

        self._data = None       # exampleTable
        self._dataN = None      # 2d numeric array
        self._chipdata = None       # [(dirname0, [et0, et1, ...]), ...]
        self._chipdataN = None      # 3d numeric array
        self.kernel = 0
        self.kernels = ["Orthogonal polynomials", "Trigonometric functions"]
        self.kernelSize = None
        self.kernelSizes = [    ["Const"] + map(lambda x: "degree <= %i"%x, range(1,99)),
                                ["Const", "cos x", "sin x"] + reduce(lambda x,y: x+[y[0],y[1]], map(lambda i: ("cos %ix"%i, "sin %ix"%i), range(2,99)), [])
                            ]
        self.useSignificance = 0
        self.alpha = 3
        self.alphas = [0.0001, 0.001, 0.01, 0.05, 0.1, 0.2, 0.5]
        self.commitOnChange = 1
               
        # Settings
        self.loadSettings()

        # GUI: info, comboKernelSize, cbUseSignificance, vboxSignificance, commitBtn
        # info
        box = QVGroupBox("Info", self.controlArea)
        self.infoa = QLabel("No examples on input", box)
        OWGUI.separator(box,250)
        self.infob = QLabel("No structured data on input", box)
        OWGUI.separator(self.controlArea)

        # kernel selection
        box = QVGroupBox("Kernel functions", self.controlArea)
        OWGUI.comboBox(box, self, "kernel", items=self.kernels, callback=self.kernelChange)
        OWGUI.separator(self.controlArea)

        # kernel settings
        box = QVGroupBox("Kernel settings", self.controlArea)
        self.comboKernelSize = OWGUI.comboBox(box, self, "kernelSize", callback=self.kernelSizeChange, label="Number of kernel functions", labelWidth=135, orientation="horizontal", valueType=int)
        self.comboKernelSize.setDisabled(1)
        self.cbUseSignificance = OWGUI.checkBox(box, self, "useSignificance", "Significance of coefficients (F-statistics)", callback=self.useSignificanceChange, tooltip="Use kernels with coefficients significantly different from 0.")
        self.vboxSignificance = QVBox(box)
        OWGUI.comboBox(self.vboxSignificance, self, "alpha", items = self.alphas, callback=self.alphaChange, label="p <", labelWidth=20, orientation="horizontal")
        OWGUI.separator(self.controlArea)

        # output
        box = QVGroupBox("Output", self.controlArea)
        OWGUI.checkBox(box, self, 'commitOnChange', 'Commit data on selection change')
        self.commitBtn = OWGUI.button(box, self, "Commit", callback=self.senddata, disabled=1)

        self.inputs = [("Examples", ExampleTable, self.data), ("Structured Data", DataFiles, self.chipdata)]
        self.outputs = [("Approximated Examples", ExampleTable, Default), ("Approximation Coefficients", ExampleTable), ("Approximated Structured Data", DataFiles, Default), ("Structured Approximation Coefficients", DataFiles)]
        self.resize(200,100)
开发者ID:acopar,项目名称:orange-bio,代码行数:52,代码来源:OWApproxProfiles.py

示例10: __init__

    def __init__(self, parent=None, signalManager=None, name="KEGG Pathways"):
        OWWidget.__init__(self, parent, signalManager, name, wantGraph=True)
        self.inputs = [("Examples", Orange.data.Table, self.SetData),
                       ("Reference", Orange.data.Table, self.SetRefData)]
        self.outputs = [("Selected Examples", Orange.data.Table),
                        ("Unselected Examples", Orange.data.Table)]
        self.organismIndex = 0
        self.geneAttrIndex = 0
        self.autoCommit = False
        self.autoResize = True
        self.useReference = False
        self.useAttrNames = 0
        self.showOrthology = True

        self.loadSettings()

        self.organismCodes = []
        self._changedFlag = False

        self.controlArea.setMaximumWidth(250)
        box = OWGUI.widgetBox(self.controlArea, "Info")
        self.infoLabel = OWGUI.widgetLabel(box, "No data on input\n")

        # Organism selection.
        box = OWGUI.widgetBox(self.controlArea, "Organism")
        self.organismComboBox = OWGUI.comboBox(
            box, self, "organismIndex",
            items=[],
            callback=self.Update,
            addSpace=True,
            debuggingEnabled=0,
            tooltip="Select the organism of the input genes")

        # Selection of genes attribute
        box = OWGUI.widgetBox(self.controlArea, "Gene attribute")
        self.geneAttrCandidates = VariableListModel(parent=self)
        self.geneAttrCombo = OWGUI.comboBox(
            box, self, "geneAttrIndex", callback=self.Update)
        self.geneAttrCombo.setModel(self.geneAttrCandidates)

        OWGUI.checkBox(box, self, "useAttrNames",
                       "Use variable names",
                       disables=[(-1, self.geneAttrCombo)],
                       callback=self.Update)

        self.geneAttrCombo.setDisabled(bool(self.useAttrNames))

        OWGUI.separator(self.controlArea)

        OWGUI.checkBox(self.controlArea, self, "useReference",
                       "From signal",
                       box="Reference",
                       callback=self.Update)

        OWGUI.separator(self.controlArea)

        OWGUI.checkBox(self.controlArea, self, "showOrthology",
                       "Show pathways in full orthology",
                       box="Orthology",
                       callback=self.UpdateListView)

        OWGUI.checkBox(self.controlArea, self, "autoResize",
                       "Resize to fit",
                       box="Image",
                       callback=self.UpdatePathwayViewTransform)

        box = OWGUI.widgetBox(self.controlArea, "Cache Control")

        OWGUI.button(box, self, "Clear cache",
                     callback=self.ClearCache,
                     tooltip="Clear all locally cached KEGG data.")

        OWGUI.separator(self.controlArea)

        box = OWGUI.widgetBox(self.controlArea, "Selection")
        cb = OWGUI.checkBox(box, self, "autoCommit", "Commit on update")
        button = OWGUI.button(box, self, "Commit", callback=self.Commit,
                              default=True)
        OWGUI.setStopper(self, button, cb, "_changedFlag", self.Commit)

        OWGUI.rubber(self.controlArea)

        spliter = QSplitter(Qt.Vertical, self.mainArea)
        self.pathwayView = PathwayView(self, spliter)
        self.pathwayView.scene().selectionChanged.connect(
            self._onSelectionChanged
        )
        self.mainArea.layout().addWidget(spliter)

        self.listView = QTreeWidget(spliter)
        spliter.addWidget(self.listView)

        self.listView.setAllColumnsShowFocus(1)
        self.listView.setColumnCount(4)
        self.listView.setHeaderLabels(["Pathway", "P value",
                                       "Genes", "Reference"])

        self.listView.setSelectionMode(QTreeWidget.SingleSelection)

        self.listView.setSortingEnabled(True)
#.........这里部分代码省略.........
开发者ID:acopar,项目名称:orange-bio,代码行数:101,代码来源:OWKEGGPathwayBrowser.py

示例11: __init__

    def __init__(self, parent=None, signalManager=None,
                 title="Venn Diagram"):
        super(OWVennDiagram, self).__init__(parent, signalManager, title,
                                            wantGraph=True)

        self.autocommit = False
        # Selected disjoint subset indices
        self.selection = []

        # Stored input set hints
        # {(index, inputname, attributes): (selectedattrname, itemsettitle)}
        # The 'selectedattrname' can be None
        self.inputhints = {}

        # Use identifier columns for instance matching
        self.useidentifiers = 1

        self.loadSettings()

        # Output changed flag
        self._changed = False
        # Diagram update is in progress
        self._updating = False
        # Input update is in progress
        self._inputUpdate = False
        # All input tables have the same domain.
        self.samedomain = True
        # Input datasets in the order they were 'connected'.
        self.data = OrderedDict()
        # Extracted input item sets in the order they were 'connected'
        self.itemsets = OrderedDict()

        # GUI
        box = OWGUI.widgetBox(self.controlArea, "Info")
        self.info = OWGUI.widgetLabel(box, "No data on input\n")

        self.identifiersBox = OWGUI.radioButtonsInBox(
            self.controlArea, self, "useidentifiers", [],
            box="Data Instance Identifiers",
            callback=self._on_useidentifiersChanged
        )
        self.useequalityButton = OWGUI.appendRadioButton(
            self.identifiersBox, self, "useidentifiers",
            "Use instance equality"
        )
        rb = OWGUI.appendRadioButton(
            self.identifiersBox, self, "useidentifiers",
            "Use identifiers"
        )
        self.inputsBox = OWGUI.indentedBox(
            self.identifiersBox, sep=OWGUI.checkButtonOffsetHint(rb)
        )
        self.inputsBox.setEnabled(self.useidentifiers == 1)

        for i in range(5):
            box = OWGUI.widgetBox(self.inputsBox, "Data set #%i" % (i + 1),
                                  flat=True)
            model = OWItemModels.VariableListModel(parent=self)
            cb = QComboBox()
            cb.setModel(model)
            cb.activated[int].connect(self._on_inputAttrActivated)
            box.setEnabled(False)
            # Store the combo in the box for later use.
            box.combo_box = cb
            box.layout().addWidget(cb)

        OWGUI.rubber(self.controlArea)

        box = OWGUI.widgetBox(self.controlArea, "Output")
        cb = OWGUI.checkBox(box, self, "autocommit", "Commit on any change")
        b = OWGUI.button(box, self, "Commit", callback=self.commit,
                         default=True)
        OWGUI.setStopper(self, b, cb, "_changed", callback=self.commit)

        # Main area view
        self.scene = QGraphicsScene()
        self.view = QGraphicsView(self.scene)
        self.view.setRenderHint(QPainter.Antialiasing)
        self.view.setBackgroundRole(QPalette.Window)
        self.view.setFrameStyle(QGraphicsView.StyledPanel)

        self.mainArea.layout().addWidget(self.view)
        self.vennwidget = VennDiagram()
        self.vennwidget.resize(400, 400)
        self.vennwidget.itemTextEdited.connect(self._on_itemTextEdited)
        self.scene.selectionChanged.connect(self._on_selectionChanged)

        self.scene.addItem(self.vennwidget)

        self.resize(self.controlArea.sizeHint().width() + 550,
                    max(self.controlArea.sizeHint().height(), 550))

        self._queue = []
        self.graphButton.clicked.connect(self.saveImage)
开发者ID:AutumnLight,项目名称:orange,代码行数:94,代码来源:OWVennDiagram.py

示例12: __init__

    def __init__(self, parent=None, signalManager=None, name="dictyExpress"):
        OWWidget.__init__(self, parent, signalManager, name)
        self.outputs = [("Example table", ExampleTable)]
        self.serverToken = ""
        self.server = obiDicty.defaddress

        self.platform = None

        self.selectedExperiments = []
        self.buffer = obiDicty.CacheSQLite(bufferfile)

        self.searchString = ""
        self.excludeconstant = False
        
        box = OWGUI.widgetBox(self.controlArea, "Cache")
        OWGUI.button(box, self, "Clear cache", callback=self.clear_buffer)

        OWGUI.checkBox(self.controlArea, self, "excludeconstant", "Exclude labels with constant values" )

        OWGUI.button(self.controlArea, self, "&Commit", callback=self.Commit)
        box  = OWGUI.widgetBox(self.controlArea, "Server")
        OWGUI.lineEdit(box, self, "serverToken","Token", callback=self.Connect)
        OWGUI.rubber(self.controlArea)

        OWGUI.lineEdit(self.mainArea, self, "searchString", "Search", callbackOnType=True, callback=self.SearchUpdate)
        self.experimentsWidget = QTreeWidget()
        self.experimentsWidget.setHeaderLabels(["Strain", "Treatment", "Growth condition", "Platform", "N", "Chips"]) 
        self.experimentsWidget.setSelectionMode(QTreeWidget.ExtendedSelection)
        self.experimentsWidget.setRootIsDecorated(False)
        self.experimentsWidget.setSortingEnabled(True)
##        self.experimentsWidget.setAlternatingRowColors(True)

        self.mainArea.layout().addWidget(self.experimentsWidget)

        self.loadSettings()
        self.dbc = None        

        QTimer.singleShot(0, self.UpdateExperiments)        

        self.resize(800, 600)
开发者ID:JakaKokosar,项目名称:orange-bio,代码行数:40,代码来源:OWDicty.py

示例13: __init__

    def __init__(self, parent=None, signalManager=None):
        OWWidget.__init__(self, parent, signalManager, "MeshBrowser")
        self.inputs = [("Reference data", ExampleTable, self.getReferenceData), ("Cluster data", ExampleTable, self.getClusterData)]
        self.outputs = [("Selected examples", ExampleTable)]

        # widget variables
        self.loadedRef = 0
        self.loadedClu = 0
        self.maxPValue = 0.05
        self.minExamplesInTerm = 5
        self.multi = 1
        self.reference = None
        self.cluster = None
        self.loadSettings()
        self.mesh = obiMeSH() # main object is created
        self.dataLoaded = self.mesh.dataLoaded

        # left pane
        box = OWGUI.widgetBox(self.controlArea, "Info")
        #box = QGroupBox("Info", self.controlArea)
        self.infoa = OWGUI.label(box, self, "No reference data.")
        self.infob = OWGUI.label(box, self, "No cluster data.")
        self.ratio = OWGUI.label(box, self, "")
        self.ref_att = OWGUI.label(box, self, "")
        self.clu_att = OWGUI.label(box, self, "")
        self.resize(960, 600)
        OWGUI.separator(self.controlArea)

        self.optionsBox = OWGUI.widgetBox(self.controlArea, "Options")
        self.maxp = OWGUI.lineEdit(self.optionsBox, self, "maxPValue", label="threshold:", orientation="horizontal", labelWidth=120, valueType=float)
        self.minf = OWGUI.lineEdit(self.optionsBox, self, "minExamplesInTerm", label="min. frequency:", orientation="horizontal", labelWidth=120, valueType=int)
        #OWGUI.checkBox(self.optionsBox, self, 'multi', 'Multiple selection', callback= self.checkClicked)
        OWGUI.button(self.optionsBox, self, "Refresh", callback=self.refresh)

        # right pane
        self.col_size = [280, 84, 84, 100, 110]
        self.sort_col = 0
        self.sort_dir = True
        self.columns = ['MeSH term', '# reference', '# cluster', 'p value', 'fold enrichment'] # both datasets

        self.splitter = QSplitter(Qt.Vertical, self.mainArea)
        self.mainArea.layout().addWidget(self.splitter)

        # list view
        self.meshLV = QTreeWidget(self.splitter)
        #self.meshLV.setSelectionMode(QAbstractItemView.MultiSelection)
        self.meshLV.setAllColumnsShowFocus(1)
        self.meshLV.setColumnCount(len(self.columns))
        self.meshLV.setHeaderLabels(self.columns)

        self.meshLV.header().setClickable(True)
        #self.meshLV.header().setSortIndicatorShown(True)
        #self.meshLV.setSortingEnabled(True)
        self.meshLV.setRootIsDecorated(True)
        self.connect(self.meshLV, SIGNAL("itemSelectionChanged()"), self.viewSelectionChanged)
        #self.meshLV.setItemDelegateForColumn(3, EnrichmentColumnItemDelegate(self))
        #self.tooltips = ListViewToolTip(self.meshLV,0, self.mesh.toDesc)

        # table of significant mesh terms
        self.sigTermsTable = QTableWidget(self.splitter)
        self.sigTermsTable.setColumnCount(len(self.columns))
        self.sigTermsTable.setRowCount(4)
        ## hide the vertical header
        self.sigTermsTable.verticalHeader().hide()
        #self.sigTermsTable.setLeftMargin(0)
        #self.sigTermsTable.setSelectionMode(QAbstractItemView.MultiSelection)

        for i in range(0, len(self.columns)):
            self.sigTermsTable.horizontalHeader().resizeSection(i, self.col_size[i])
            self.meshLV.header().resizeSection(i, self.col_size[i])

        self.sigTermsTable.setHorizontalHeaderLabels(self.columns)

        self.connect(self.sigTermsTable, SIGNAL("itemSelectionChanged()"), self.tableSelectionChanged)
        self.connect(self.sigTermsTable, SIGNAL("clicked(int,int,int,const QPoint&)"), self.tableClicked)
        self.splitter.show()
        self.optionsBox.setDisabled(1)
开发者ID:JakaKokosar,项目名称:orange-bio,代码行数:77,代码来源:OWMeSHBrowser.py

示例14: __init__

    def __init__(self, parent=None, signalManager=None, title="Expression Profile Distances"):
        OWWidget.__init__(self, parent, signalManager, title)

        self.inputs = [("Example Table", ExampleTable, self.set_data)]
        self.outputs = [("Distances", Orange.core.SymMatrix), ("Sorted Example Table", ExampleTable)]

        self.distance_measure = 0
        self.auto_commit = False
        self.changed_flag = False

        self.loadSettings()

        ########
        # GUI
        ########

        self.info_box = OWGUI.widgetLabel(
            OWGUI.widgetBox(self.controlArea, "Input", addSpace=True), "No data on input\n"
        )

        box = OWGUI.widgetBox(self.controlArea, "Separate By", addSpace=True)
        self.separate_view = QListView()
        self.separate_view.setSelectionMode(QListView.MultiSelection)
        box.layout().addWidget(self.separate_view)

        box = OWGUI.widgetBox(self.controlArea, "Sort By", addSpace=True)
        self.relevant_view = QListView()
        self.relevant_view.setSelectionMode(QListView.MultiSelection)
        box.layout().addWidget(self.relevant_view)

        self.distance_view = OWGUI.comboBox(
            self.controlArea,
            self,
            "distance_measure",
            box="Distance Measure",
            items=[d[0] for d in self.DISTANCE_FUNCTIONS],
        )

        OWGUI.rubber(self.controlArea)

        box = OWGUI.widgetBox(self.controlArea, "Commit")
        cb = OWGUI.checkBox(
            box,
            self,
            "auto_commit",
            "Commit on any change",
            tooltip="Compute and send the distances on any change.",
            callback=self.commit_if,
        )

        b = OWGUI.button(
            box,
            self,
            "Commit",
            tooltip="Compute the distances and send the output signals.",
            callback=self.commit,
            default=True,
        )

        OWGUI.setStopper(self, b, cb, "changed_flag", callback=self.commit)

        self.groups_box = OWGUI.widgetBox(self.mainArea, "Groups")
        self.groups_scroll_area = QScrollArea()
        self.groups_box.layout().addWidget(self.groups_scroll_area)

        self.data = None
        self.partitions = []
        self.matrix = None
        self.split_groups = []
        self._disable_updates = False

        self.resize(800, 600)
开发者ID:pombredanne,项目名称:orange-bio,代码行数:72,代码来源:OWGenotypeDistances.py

示例15: __init__

    def __init__(self, parent=None, signalManager = None):
        OWWidget.__init__(self, parent, signalManager, 'Process Chip Data')
        self.callbackDeposit = []

        self.inputs = [("Structured Data", DataFiles, self.chipdata)]
        self.outputs = [("Structured Data", DataFiles)]

        self.chipdata = None; self.datasets = None
        self.std = [("No preprocessing", None),
                    ("Array-based standardization", chipstat.standardize_arrays),
                    ("Gene-based standardization", chipstat.standardize_genes),
                    ("First array-, then gene-based standardization", lambda e,r: chipstat.standardize_genes(chipstat.standardize_arrays(e,r),r)),
                    ("First gene-, then array-based standardization", lambda e,r: chipstat.standardize_arrays(chipstat.standardize_genes(e,r),r))]
        # Settings
        self.data = None
        self.preStdMethod = 0; self.preStdRob = 1
        self.postStdMethod = 0; self.postStdRob = 1
        
        self.mergeType = 0
        self.commitOnChange = 0
        self.loadSettings()

        # GUI
        # info
        box = QVGroupBox("Info", self.controlArea)
        self.infoa = QLabel('No data on input.', box)
        self.infob = QLabel('', box)
        
        # preprocessing
        OWGUI.separator(self.controlArea)
        box = QVGroupBox("Preprocessing", self.controlArea)
        labels = [x[0] for x in self.std]
        OWGUI.comboBox(box, self, 'preStdMethod', label=None, labelWidth=None, orientation='vertical', items=labels, callback=self.selectionChange)
        self.preRobBtn = OWGUI.checkBox(box, self, "preStdRob", "Robust standardization", callback=self.selectionChange)
        
        # merge
        OWGUI.separator(self.controlArea)
        self.mergeTypes = [(0, "No merging"), ('mean', 'Mean'), ('median', 'Median'), ('min', 'Minimum expression'), ('max', 'Maximum expression')]
        labels = [x[1] for x in self.mergeTypes]
        OWGUI.radioButtonsInBox(self.controlArea, self, 'mergeType', labels, box='Merge Replicas', tooltips=None, callback=self.selectionChange)

        # postprocessing
        OWGUI.separator(self.controlArea)
        self.boxPostproc = QVGroupBox("Postprocessing", self.controlArea)
        labels = [x[0] for x in self.std]
        OWGUI.comboBox(self.boxPostproc, self, 'postStdMethod', label=None, labelWidth=None, orientation='vertical', items=labels, callback=self.selectionChange)
        self.postRobBtn = OWGUI.checkBox(self.boxPostproc, self, "postStdRob", "Robust standardization", callback=self.selectionChange)

        # output
        OWGUI.separator(self.controlArea)
        box = QVGroupBox("Output", self.controlArea)
        OWGUI.checkBox(box, self, 'commitOnChange', 'Commit data on selection change')
        self.commitBtn = OWGUI.button(box, self, "Commit", callback=self.selectionChange, disabled=1)

        self.setBtnsState()
        self.resize(100,100)
开发者ID:acopar,项目名称:orange-bio,代码行数:56,代码来源:OWProcessChipData.py


注:本文中的Orange.OrangeWidgets.OWGUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。