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)
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)
def __init__(self, parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, 'Example Selector') self.callbackDeposit = [] self.inputs = [("Example Selection", ExampleSelection, self.loadselection, Multiple + Default), ("Structured Data", DataFiles, self.chipdata)] self.outputs = [("Example Selection", ExampleSelection), ("Selected Structured Data", DataFiles, Default), ("Other Structured Data", DataFiles)] # Settings self.negate = 0 self.commitOnChange = 1 self.sendNotSelectedData = 1 self.loadSettings() self.selectors = {} self.data = None # GUI # info box = QVGroupBox("Info", self.controlArea) self.infoa = QLabel('No data on input.', box) self.infob = QLabel('', box) OWGUI.separator(self.controlArea) box.setMinimumWidth(170) # gene selection self.layout=QVBoxLayout(self.mainArea) box = QVGroupBox("Gene Selection", self.mainArea) self.table=QTable(box) self.table.setSelectionMode(QTable.NoSelection) self.layout.add(box) self.table.hide() self.drawtable() OWGUI.checkBox(box, self, 'negate', 'Negate', callback = self.selectionChange) # output box = QVGroupBox("Output", self.controlArea) OWGUI.checkBox(box, self, 'sendNotSelectedData', 'Send not selected data', callback=self.selectionChange) OWGUI.checkBox(box, self, 'commitOnChange', 'Commit data on change') self.commitBtn = OWGUI.button(box, self, "Commit", callback=self.senddata, disabled=1) self.resize(700,100)
def __init__(self, parent=None, signalManager=None): OWWidget.__init__(self, parent, signalManager, 'Data Distance') self.inputs = [("Structured Data", DataFiles, self.chipdata)] self.outputs = [("Distance Matrix", orange.SymMatrix)] self.Metrics = 0 self.loadSettings() self.data = [] ## self.metrics = [("Euclidean", orange.ExamplesDistanceConstructor_Euclidean), ## ("Manhattan", orange.ExamplesDistanceConstructor_Manhattan), ## ("Hamming", orange.ExamplesDistanceConstructor_Hamming)] self.metrics = [("Manhattan", distManhattan), ("Euclidean", distEuclidean), ("1 - (Pearson correlation coefficient)", distPearson), ("1 - (Spearman rank correlation coefficient)", distSpearman)] # GUI self.mainArea.setFixedWidth(0) # Info box box = QVGroupBox("Info", self.controlArea) self.infoa = QLabel('No data on input.', box) self.infob = QLabel('', box) OWGUI.separator(self.controlArea) # Distance metrics selection items = [x[0] for x in self.metrics] OWGUI.comboBox( self.controlArea, self, "Metrics", box="Distance Metrics", items=items, tooltip="Metrics to measure distance between data sets.", callback=self.onMetricsChange) self.resize(384, 138)
def __init__(self, parent=None, signalManager=None, name=" GEO Data Sets"): OWWidget.__init__(self, parent, signalManager, name) self.outputs = [("Expression Data", ExampleTable)] ## Settings self.selectedAnnotation = 0 self.includeIf = False self.minSamples = 3 self.autoCommit = False self.outputRows = 0 self.mergeSpots = True self.filterString = "" self.currentGds = None self.selectionChanged = False self.autoCommit = False self.gdsSelectionStates = {} self.splitterSettings = [ '\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x01\xea\x00\x00\x00\xd7\x01\x00\x00\x00\x07\x01\x00\x00\x00\x02', '\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x01\xb5\x00\x00\x02\x10\x01\x00\x00\x00\x07\x01\x00\x00\x00\x01' ] self.datasetNames = {} self.loadSettings() self.datasetName = "" ## GUI self.infoBox = OWGUI.widgetLabel( OWGUI.widgetBox(self.controlArea, "Info", addSpace=True), "Initializing\n\n" ) box = OWGUI.widgetBox(self.controlArea, "Output", addSpace=True) OWGUI.radioButtonsInBox(box, self, "outputRows", ["Genes or spots", "Samples"], "Rows", callback=self.commitIf) OWGUI.checkBox(box, self, "mergeSpots", "Merge spots of same gene", callback=self.commitIf) OWGUI.separator(box) self.nameEdit = OWGUI.lineEdit( box, self, "datasetName", "Data set name", tooltip="Override the default output data set name", callback=self.onNameEdited ) self.nameEdit.setPlaceholderText("") box = OWGUI.widgetBox(self.controlArea, "Commit", addSpace=True) self.commitButton = OWGUI.button(box, self, "Commit", callback=self.commit) cb = OWGUI.checkBox(box, self, "autoCommit", "Commit on any change") OWGUI.setStopper(self, self.commitButton, cb, "selectionChanged", self.commit) OWGUI.rubber(self.controlArea) self.filterLineEdit = OWGUIEx.lineEditHint( self.mainArea, self, "filterString", "Filter", caseSensitive=False, matchAnywhere=True, callback=self.filter, delimiters=" ") splitter = QSplitter(Qt.Vertical, self.mainArea) self.mainArea.layout().addWidget(splitter) self.treeWidget = QTreeView(splitter) self.treeWidget.setSelectionMode(QAbstractItemView.SingleSelection) self.treeWidget.setRootIsDecorated(False) self.treeWidget.setSortingEnabled(True) self.treeWidget.setAlternatingRowColors(True) self.treeWidget.setUniformRowHeights(True) self.treeWidget.setEditTriggers(QTreeView.NoEditTriggers) linkdelegate = LinkStyledItemDelegate(self.treeWidget) self.treeWidget.setItemDelegateForColumn(1, linkdelegate) self.treeWidget.setItemDelegateForColumn(8, linkdelegate) self.treeWidget.setItemDelegateForColumn( 0, OWGUI.IndicatorItemDelegate(self.treeWidget, role=Qt.DisplayRole)) proxyModel = MySortFilterProxyModel(self.treeWidget) self.treeWidget.setModel(proxyModel) self.treeWidget.selectionModel().selectionChanged.connect( self.updateSelection ) self.treeWidget.viewport().setMouseTracking(True) splitterH = QSplitter(Qt.Horizontal, splitter) box = OWGUI.widgetBox(splitterH, "Description") self.infoGDS = OWGUI.widgetLabel(box, "") self.infoGDS.setWordWrap(True) OWGUI.rubber(box) box = OWGUI.widgetBox(splitterH, "Sample Annotations") self.annotationsTree = QTreeWidget(box) self.annotationsTree.setHeaderLabels( ["Type (Sample annotations)", "Sample count"] ) self.annotationsTree.setRootIsDecorated(True) box.layout().addWidget(self.annotationsTree) self.annotationsTree.itemChanged.connect( self.annotationSelectionChanged ) self._annotationsUpdating = False self.splitters = splitter, splitterH for sp, setting in zip(self.splitters, self.splitterSettings): sp.splitterMoved.connect(self.splitterMoved) sp.restoreState(setting) self.searchKeys = ["dataset_id", "title", "platform_organism", "description"] self.gds = [] self.gds_info = None self.resize(1000, 600) self.setBlocking(True) self.setEnabled(False) self.progressBarInit() self._executor = ThreadExecutor() func = partial(get_gds_model, methodinvoke(self, "_setProgress", (float,))) self._inittask = Task(function=func) self._inittask.finished.connect(self._initializemodel) self._executor.submit(self._inittask) self._datatask = None
def __init__(self, parent=None, signalManager = None, name='GSEA'): OWWidget.__init__(self, parent, signalManager, name) self.inputs = [("Examples", ExampleTable, self.setData)] self.outputs = [("Examples with selected genes only", ExampleTable), ("Results", ExampleTable), ("Distance Matrix", orange.SymMatrix) ] self.res = None self.dm = None self.name = 'GSEA' self.minSubsetSize = 3 self.minSubsetSizeC = True self.maxSubsetSize = 1000 self.maxSubsetSizeC = True self.minSubsetPart = 10 self.minSubsetPartC = True self.perms = 100 self.csgm = False self.gsgo = False self.gskegg = False self.buildDistances = False self.selectedPhenVar = 0 self.organismIndex = 0 self.atLeast = 3 self.permutationTypes = [("Phenotype", "p"),("Gene", "g") ] self.ptype = 0 self.correlationTypes = [ ("Signal2Noise", "s2n") ] self.ctype = 0 self.data = None self.geneSets = {} self.tabs = OWGUI.tabWidget(self.controlArea) ca = OWGUI.createTabPage(self.tabs, "Basic") box = OWGUI.widgetBox(ca, 'Organism') #FROM KEGG WIDGET - organism selection self.organismTaxids = [] self.organismComboBox = cb = OWGUI.comboBox(box, self, "organismIndex", items=[], debuggingEnabled=0) #changed cb.setMaximumWidth(200) #OWGUI.checkBox(box, self, "csgm", "Case sensitive gene matching") box2 = OWGUI.widgetBox(ca, "Descriptors") self.phenCombo = OWGUI.comboBox(box2, self, "selectedPhenVar", items=[], callback=self.phenComboChange, label="Phenotype:") self.geneCombo = OWGUI.comboBox(box2, self, "selectedGeneVar", items=[], label = "Gene:") self.allowComboChangeCallback = False ma = self.mainArea self.listView = QTreeWidget(ma) ma.layout().addWidget(self.listView) self.listView.setAllColumnsShowFocus(1) self.listView.setColumnCount(9) self.listView.setHeaderLabels(["Collection", "Geneset", "NES", "ES", "P-value", "FDR", "Size", "Matched Size", "Genes"]) self.listView.header().setStretchLastSection(True) self.listView.header().setClickable(True) self.listView.header().setSortIndicatorShown(True) self.listView.setSortingEnabled(True) #self.listView.header().setResizeMode(0, QHeaderView.Stretch) self.listView.setSelectionMode(QAbstractItemView.NoSelection) self.connect(self.listView, SIGNAL("itemSelectionChanged()"), self.newPathwaySelected) OWGUI.separator(ca) OWGUI.widgetLabel(ca, "Phenotype selection:") self.psel = PhenotypesSelection(ca) self.resize(600,50) OWGUI.separator(ca) OWGUI.checkBox(ca, self, "buildDistances", "Compute geneset distances") self.btnApply = OWGUI.button(ca, self, "&Compute", callback = self.compute, disabled=0) fileBox = OWGUI.widgetBox(ca, orientation='horizontal') OWGUI.button(fileBox, self, "Load", callback = self.loadData, disabled=0, debuggingEnabled=0) OWGUI.button(fileBox, self, "Save", callback = self.saveData, disabled=0, debuggingEnabled=0) #ca.layout().addStretch(1) ca = OWGUI.createTabPage(self.tabs, "Gene sets") box = OWGUI.widgetBox(ca) self.gridSel = [] self.geneSel = [] #FIXME temporary disabled - use the same as in new "David" widget self.lbgs = OWGUI.listBox(box, self, "gridSel", "geneSel", selectionMode = QListWidget.MultiSelection) OWGUI.button(box, self, "From &File", callback = self.addCollection, disabled=0, debuggingEnabled=0) box = OWGUI.widgetBox(box, "Additional sources:") OWGUI.checkBox(box, self, "gskegg", "KEGG pathways") OWGUI.checkBox(box, self, "gsgo", "GO terms") #ca.layout().addStretch(1) ca = OWGUI.createTabPage(self.tabs, "Settings") box = OWGUI.widgetBox(ca, 'Properties') self.permTypeF = OWGUI.comboBoxWithCaption(box, self, "ptype", items=nth(self.permutationTypes, 0), \ tooltip="Permutation type.", label="Permute") _ = OWGUI.spin(box, self, "perms", 50, 1000, orientation="horizontal", label="Times") self.corTypeF = OWGUI.comboBoxWithCaption(box, self, "ctype", items=nth(self.correlationTypes, 0), \ tooltip="Correlation type.", label="Correlation") box = OWGUI.widgetBox(ca, 'Subset Filtering') _,_ = OWGUI.checkWithSpin(box, self, "Min. Subset Size", 1, 10000, "minSubsetSizeC", "minSubsetSize", "") #TODO check sizes _,_ = OWGUI.checkWithSpin(box, self, "Max. Subset Size", 1, 10000, "maxSubsetSizeC", "maxSubsetSize", "") _,_ = OWGUI.checkWithSpin(box, self, "Min. Subset Part (%)", 1, 100, "minSubsetPartC", "minSubsetPart", "") box = OWGUI.widgetBox(ca, 'Gene Filtering') _ = OWGUI.spin(box, self, "atLeast", 2, 10, label="Min. Values in Group") ca.layout().addStretch(1) self.addComment("Computation was not started.") if sys.platform == "darwin": self.loadFileName = os.path.expanduser("~/") else: self.loadFileName = "." self.gridSels = [] self.loadSettings() self.setBlocking(True) QTimer.singleShot(0, self.UpdateOrganismComboBox) def cleanInvalid(maxn): """ Removes invalid gene set selection """ notAllOk = True while notAllOk: self.gridSels = getattr(self, "gridSels") notAllOk = False for i,a in enumerate(self.gridSels): if a >= maxn: self.gridSels.pop(i) notAllOk = True break cleanInvalid(len(self.geneSel)) self.gridSel = self.gridSels self.gridSels = self.gridSel
def __init__(self, parent=None, signalManager=None, name=" GEO Data Sets"): OWWidget.__init__(self, parent, signalManager, name) self.selectionChanged = False self.filterString = "" self.datasetName = "" ## GUI box = gui.widgetBox(self.controlArea, "Info", addSpace=True) self.infoBox = gui.widgetLabel(box, "Initializing\n\n") box = gui.widgetBox(self.controlArea, "Output", addSpace=True) gui.radioButtonsInBox(box, self, "outputRows", ["Genes in rows", "Samples in rows"], "Rows", callback=self.commitIf) gui.checkBox(box, self, "mergeSpots", "Merge spots of same gene", callback=self.commitIf) gui.separator(box) self.nameEdit = gui.lineEdit( box, self, "datasetName", "Data set name", tooltip="Override the default output data set name", callback=self.onNameEdited ) self.nameEdit.setPlaceholderText("") if sys.version_info < (3, ): box = gui.widgetBox(self.controlArea, "Commit", addSpace=True) self.commitButton = gui.button( box, self, "Commit", callback=self.commit) cb = gui.checkBox(box, self, "autoCommit", "Commit on any change") gui.setStopper(self, self.commitButton, cb, "selectionChanged", self.commit) else: gui.auto_commit(self.controlArea, self, "autoCommit", "Commit", box="Commit") self.commitIf = self.commit gui.rubber(self.controlArea) gui.widgetLabel(self.mainArea, "Filter") self.filterLineEdit = QLineEdit( textChanged=self.filter ) self.completer = TokenListCompleter( self, caseSensitivity=Qt.CaseInsensitive ) self.filterLineEdit.setCompleter(self.completer) self.mainArea.layout().addWidget(self.filterLineEdit) splitter = QSplitter(Qt.Vertical, self.mainArea) self.mainArea.layout().addWidget(splitter) self.treeWidget = QTreeView(splitter) self.treeWidget.setSelectionMode(QTreeView.SingleSelection) self.treeWidget.setRootIsDecorated(False) self.treeWidget.setSortingEnabled(True) self.treeWidget.setAlternatingRowColors(True) self.treeWidget.setUniformRowHeights(True) self.treeWidget.setEditTriggers(QTreeView.NoEditTriggers) linkdelegate = LinkStyledItemDelegate(self.treeWidget) self.treeWidget.setItemDelegateForColumn(1, linkdelegate) self.treeWidget.setItemDelegateForColumn(8, linkdelegate) self.treeWidget.setItemDelegateForColumn( 0, gui.IndicatorItemDelegate(self.treeWidget, role=Qt.DisplayRole)) proxyModel = MySortFilterProxyModel(self.treeWidget) self.treeWidget.setModel(proxyModel) self.treeWidget.selectionModel().selectionChanged.connect( self.updateSelection ) self.treeWidget.viewport().setMouseTracking(True) splitterH = QSplitter(Qt.Horizontal, splitter) box = gui.widgetBox(splitterH, "Description") self.infoGDS = gui.widgetLabel(box, "") self.infoGDS.setWordWrap(True) gui.rubber(box) box = gui.widgetBox(splitterH, "Sample Annotations") self.annotationsTree = QTreeWidget(box) self.annotationsTree.setHeaderLabels( ["Type (Sample annotations)", "Sample count"] ) self.annotationsTree.setRootIsDecorated(True) box.layout().addWidget(self.annotationsTree) self.annotationsTree.itemChanged.connect( self.annotationSelectionChanged ) self._annotationsUpdating = False self.splitters = splitter, splitterH for sp, setting in zip(self.splitters, self.splitterSettings): sp.splitterMoved.connect(self.splitterMoved) sp.restoreState(setting) self.searchKeys = ["dataset_id", "title", "platform_organism", "description"] self.gds = [] self.gds_info = None self.resize(1000, 600) self.setBlocking(True) self.setEnabled(False) self.progressBarInit() self._executor = ThreadExecutor() func = partial(get_gds_model, methodinvoke(self, "_setProgress", (float,))) self._inittask = Task(function=func) self._inittask.finished.connect(self._initializemodel) self._executor.submit(self._inittask) self._datatask = None
def __init__(self, parent=None, signalManager=None, name=" GEO Data Sets"): OWWidget.__init__(self, parent, signalManager, name) self.outputs = [("Expression Data", ExampleTable)] ## Settings self.selectedAnnotation = 0 self.includeIf = False self.minSamples = 3 self.autoCommit = False self.outputRows = 1 self.mergeSpots = True self.filterString = "" self.currentGds = None self.selectionChanged = False self.autoCommit = False self.gdsSelectionStates = {} self.splitterSettings = [ '\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x01\xea\x00\x00\x00\xd7\x01\x00\x00\x00\x07\x01\x00\x00\x00\x02', '\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x01\xb5\x00\x00\x02\x10\x01\x00\x00\x00\x07\x01\x00\x00\x00\x01' ] self.datasetNames = {} self.loadSettings() self.datasetName = "" ## GUI self.infoBox = OWGUI.widgetLabel( OWGUI.widgetBox(self.controlArea, "Info", addSpace=True), "Initializing\n\n" ) box = OWGUI.widgetBox(self.controlArea, "Output", addSpace=True) OWGUI.radioButtonsInBox(box, self, "outputRows", ["Genes in rows", "Samples in rows"], "Rows", callback=self.commitIf) OWGUI.checkBox(box, self, "mergeSpots", "Merge spots of same gene", callback=self.commitIf) OWGUI.separator(box) self.nameEdit = OWGUI.lineEdit( box, self, "datasetName", "Data set name", tooltip="Override the default output data set name", callback=self.onNameEdited ) self.nameEdit.setPlaceholderText("") box = OWGUI.widgetBox(self.controlArea, "Commit", addSpace=True) self.commitButton = OWGUI.button(box, self, "Commit", callback=self.commit) cb = OWGUI.checkBox(box, self, "autoCommit", "Commit on any change") OWGUI.setStopper(self, self.commitButton, cb, "selectionChanged", self.commit) OWGUI.rubber(self.controlArea) self.filterLineEdit = OWGUIEx.lineEditHint( self.mainArea, self, "filterString", "Filter", caseSensitive=False, matchAnywhere=True, callback=self.filter, delimiters=" ") splitter = QSplitter(Qt.Vertical, self.mainArea) self.mainArea.layout().addWidget(splitter) self.treeWidget = QTreeView(splitter) self.treeWidget.setSelectionMode(QAbstractItemView.SingleSelection) self.treeWidget.setRootIsDecorated(False) self.treeWidget.setSortingEnabled(True) self.treeWidget.setAlternatingRowColors(True) self.treeWidget.setUniformRowHeights(True) self.treeWidget.setEditTriggers(QTreeView.NoEditTriggers) linkdelegate = LinkStyledItemDelegate(self.treeWidget) self.treeWidget.setItemDelegateForColumn(1, linkdelegate) self.treeWidget.setItemDelegateForColumn(8, linkdelegate) self.treeWidget.setItemDelegateForColumn( 0, OWGUI.IndicatorItemDelegate(self.treeWidget, role=Qt.DisplayRole)) proxyModel = MySortFilterProxyModel(self.treeWidget) self.treeWidget.setModel(proxyModel) self.treeWidget.selectionModel().selectionChanged.connect( self.updateSelection ) self.treeWidget.viewport().setMouseTracking(True) splitterH = QSplitter(Qt.Horizontal, splitter) box = OWGUI.widgetBox(splitterH, "Description") self.infoGDS = OWGUI.widgetLabel(box, "") self.infoGDS.setWordWrap(True) OWGUI.rubber(box) box = OWGUI.widgetBox(splitterH, "Sample Annotations") self.annotationsTree = QTreeWidget(box) self.annotationsTree.setHeaderLabels( ["Type (Sample annotations)", "Sample count"] ) self.annotationsTree.setRootIsDecorated(True) box.layout().addWidget(self.annotationsTree) self.annotationsTree.itemChanged.connect( self.annotationSelectionChanged ) self._annotationsUpdating = False self.splitters = splitter, splitterH for sp, setting in zip(self.splitters, self.splitterSettings): sp.splitterMoved.connect(self.splitterMoved) sp.restoreState(setting) self.searchKeys = ["dataset_id", "title", "platform_organism", "description"] self.gds = [] self.gds_info = None self.resize(1000, 600) self.setBlocking(True) self.setEnabled(False) self.progressBarInit() self._executor = ThreadExecutor() func = partial(get_gds_model, methodinvoke(self, "_setProgress", (float,))) self._inittask = Task(function=func) self._inittask.finished.connect(self._initializemodel) self._executor.submit(self._inittask) self._datatask = None
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)
def __init__(self,parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, "Nomogram", 1) #self.setWFlags(Qt.WResizeNoErase | Qt.WRepaintNoErase) #this works like magic.. no flicker during repaint! self.parent = parent # self.setWFlags(self.getWFlags()+Qt.WStyle_Maximize) self.callbackDeposit = [] # deposit for OWGUI callback functions self.alignType = 0 self.contType = 0 self.yAxis = 0 self.probability = 0 self.verticalSpacing = 60 self.verticalSpacingContinuous = 100 self.diff_between_ordinal = 30 self.fontSize = 9 self.lineWidth = 1 self.histogram = 0 self.histogram_size = 10 self.data = None self.cl = None self.confidence_check = 0 self.confidence_percent = 95 self.sort_type = 0 self.loadSettings() self.pointsName = ["Total", "Total"] self.totalPointsName = ["Probability", "Probability"] self.bnomogram = None self.inputs=[("Classifier", orange.Classifier, self.classifier), ("Data", Orange.data.Table, self.data)] self.TargetClassIndex = 0 self.targetCombo = OWGUI.comboBox(self.controlArea, self, "TargetClassIndex", " Target Class ", addSpace=True, tooltip='Select target (prediction) class in the model.', callback = self.setTarget) self.alignRadio = OWGUI.radioButtonsInBox(self.controlArea, self, 'alignType', ['Align left', 'Align by zero influence'], box='Attribute placement', tooltips=['Attributes in nomogram are left aligned', 'Attributes are not aligned, top scale represents true (normalized) regression coefficient value'], addSpace=True, callback=self.showNomogram) self.verticalSpacingLabel = OWGUI.spin(self.alignRadio, self, 'verticalSpacing', 15, 200, label = 'Vertical spacing:', orientation = 0, tooltip='Define space (pixels) between adjacent attributes.', callback = self.showNomogram) self.ContRadio = OWGUI.radioButtonsInBox(self.controlArea, self, 'contType', ['1D projection', '2D curve'], 'Continuous attributes', tooltips=['Continuous attribute are presented on a single scale', 'Two dimensional space is used to present continuous attributes in nomogram.'], addSpace=True, callback=[lambda:self.verticalSpacingContLabel.setDisabled(not self.contType), self.showNomogram]) self.verticalSpacingContLabel = OWGUI.spin(OWGUI.indentedBox(self.ContRadio, sep=OWGUI.checkButtonOffsetHint(self.ContRadio.buttons[-1])), self, 'verticalSpacingContinuous', 15, 200, label = "Height", orientation=0, tooltip='Define space (pixels) between adjacent 2d presentation of attributes.', callback = self.showNomogram) self.verticalSpacingContLabel.setDisabled(not self.contType) self.yAxisRadio = OWGUI.radioButtonsInBox(self.controlArea, self, 'yAxis', ['Point scale', 'Log odds ratios'], 'Scale', tooltips=['values are normalized on a 0-100 point scale','values on top axis show log-linear contribution of attribute to full model'], addSpace=True, callback=self.showNomogram) layoutBox = OWGUI.widgetBox(self.controlArea, "Display", orientation=1, addSpace=True) self.probabilityCheck = OWGUI.checkBox(layoutBox, self, 'probability', 'Show prediction', tooltip='', callback = self.setProbability) self.CICheck, self.CILabel = OWGUI.checkWithSpin(layoutBox, self, 'Confidence intervals (%):', min=1, max=99, step = 1, checked='confidence_check', value='confidence_percent', checkCallback=self.showNomogram, spinCallback = self.showNomogram) self.histogramCheck, self.histogramLabel = OWGUI.checkWithSpin(layoutBox, self, 'Show histogram, size', min=1, max=30, checked='histogram', value='histogram_size', step = 1, tooltip='-(TODO)-', checkCallback=self.showNomogram, spinCallback = self.showNomogram) OWGUI.separator(layoutBox) self.sortOptions = ["No sorting", "Absolute importance", "Positive influence", "Negative influence"] self.sortBox = OWGUI.comboBox(layoutBox, self, "sort_type", label="Sort by ", items=self.sortOptions, callback = self.sortNomogram, orientation="horizontal") OWGUI.rubber(self.controlArea) self.connect(self.graphButton, SIGNAL("clicked()"), self.menuItemPrinter) #add a graph widget self.header = OWNomogramHeader(None, self.mainArea) self.header.setFixedHeight(60) self.header.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.header.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.graph = OWNomogramGraph(self.bnomogram, self.mainArea) self.graph.setMinimumWidth(200) self.graph.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.footer = OWNomogramHeader(None, self.mainArea) self.footer.setFixedHeight(60*2+10) self.footer.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.footer.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.mainArea.layout().addWidget(self.header) self.mainArea.layout().addWidget(self.graph) self.mainArea.layout().addWidget(self.footer) self.resize(700,500) #self.repaint() #self.update() # mouse pressed flag self.mousepr = False
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)
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) self.listView.setMaximumHeight(200) self.connect(self.listView, SIGNAL("itemSelectionChanged()"), self.UpdatePathwayView) self.connect(self.graphButton, SIGNAL("clicked()"), self.saveGraph) select = QAction( "Select All", self, shortcut=QKeySequence.SelectAll ) select.triggered.connect(self.selectAll) self.addAction(select) self.data = None self.refData = None self.resize(800, 600) self.connect(self, SIGNAL("widgetStateChanged(QString, int, QString)"), self.onStateChange) self.has_new_data = False self.has_new_reference_set = False self._executor = ThreadExecutor() self.setEnabled(False) self.setBlocking(True) QTimer.singleShot(0, self._initialize) self.infoLabel.setText("Fetching organism definitions\n")
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)
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)
def __init__(self, parent=None, signalManager=None, title="Molecule visualizer"): super(OWMoleculeVisualizer, self).__init__(parent, signalManager, title) self.colorFragments = 1 self.showFragments = 0 self.selectedFragment = "" self.moleculeSmiles = [] self.fragmentSmiles = [] self.defFragmentSmiles = [] self.smiles_var = 0 self.moleculeTitleAttr = 0 self.moleculeTitleAttributeList = [] self.selectedMoleculeTitleAttrs = [] self.fragmentSmilesAttr = 0 self.imageSize = 200 self.numColumns = 4 self.commitOnChange = 0 ## GUI box = OWGUI.widgetBox(self.controlArea, "Info", addSpace=True) self.infoLabel = OWGUI.label(box, self, "Chemicals:") box = OWGUI.radioButtonsInBox(self.controlArea, self, "showFragments", ["Show molecules", "Show fragments"], "Show", callback=self.updateitems) self.showFragmentsRadioButton = box.buttons[-1] self.markFragmentsCheckBox = OWGUI.checkBox(box, self, "colorFragments", "Mark fragments", callback=self._update) box.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) OWGUI.separator(self.controlArea) self.moleculeSmilesCombo = OWGUI.comboBox(self.controlArea, self, "smiles_var", "Molecule SMILES Attribute", callback=self.updateitems) self.moleculeSmilesCombo.box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) self.smiles_var_model = VariableListModel(parent=self) self.moleculeSmilesCombo.setModel(self.smiles_var_model) OWGUI.separator(self.controlArea) box = OWGUI.widgetBox(self.controlArea, "Molecule Title Attributes", addSpace=True) self.title_var_view = QListView( selectionMode=QListView.ExtendedSelection) self.title_var_model = VariableListModel(parent=self) self.title_var_view.setModel(self.title_var_model) self.title_var_view.selectionModel().selectionChanged.connect( self._title_selection_changed) box.layout().addWidget(self.title_var_view) OWGUI.separator(self.controlArea) self.fragmentSmilesCombo = OWGUI.comboBox( self.controlArea, self, "fragmentSmilesAttr", "Fragment SMILES Attribute", callback=self.updateFragmentsListBox) self.fragmentSmilesCombo.setModel(VariableListModel(parent=self)) self.fragmentSmilesCombo.box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) OWGUI.separator(self.controlArea) box = OWGUI.spin(self.controlArea, self, "imageSize", 50, 500, 10, box="Image Size", callback=self._image_size_changed) box.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) OWGUI.separator(self.controlArea) box = OWGUI.widgetBox(self.controlArea, "Selection", addSpace=True) OWGUI.checkBox(box, self, "commitOnChange", "Commit on change") self.selectMarkedMoleculesButton = OWGUI.button( box, self, "Select &matched molecules", self.select_marked) OWGUI.button(box, self, "&Commit", callback=self.commit, default=True) OWGUI.separator(self.controlArea) OWGUI.rubber(self.controlArea) spliter = QSplitter(Qt.Vertical) self.scrollArea = ScrollArea(spliter) self.grid = GridWidget() self.grid.selectionChanged.connect(self._on_selection_changed) self.scrollArea.setWidget(self.grid) self.scrollArea.setWidgetResizable(True) self.mainArea.layout().addWidget(spliter) if pybel: self.listBox = QListWidget(spliter) else: self.listBox = QListWidget(None) self.listBox.setHidden(True) self.listBox.itemClicked.connect(self.fragmentSelection) self.fragmentSmilesCombo.box.setDisabled(not pybel) self.data = None self.data_subset = [] self.fragment_data = None self.resize(800, 600) self.listBox.setMaximumHeight(150) self.fragmentSmilesCombo.setDisabled(True) self.selectMarkedMoleculesButton.setDisabled(True) self.markFragmentsCheckBox.setDisabled(True) self.showFragmentsRadioButton.setDisabled(True) self.loadSettings() if not pybel: self.showFragments = 0 self.warning( 10, "Pybel module not installed. To view molecule fragments\n" "please install openbabel python extension.") self.__loop = None
def __init__(self, parent=None, signalManager=None, name=" GEO Data Sets"): OWWidget.__init__(self, parent, signalManager, name) self.selectionChanged = False self.filterString = "" self.datasetName = "" ## GUI box = gui.widgetBox(self.controlArea, "Info", addSpace=True) self.infoBox = gui.widgetLabel(box, "Initializing\n\n") box = gui.widgetBox(self.controlArea, "Output", addSpace=True) gui.radioButtonsInBox(box, self, "outputRows", ["Genes in rows", "Samples in rows"], "Rows", callback=self.commitIf) gui.checkBox(box, self, "mergeSpots", "Merge spots of same gene", callback=self.commitIf) gui.separator(box) self.nameEdit = gui.lineEdit( box, self, "datasetName", "Data set name", tooltip="Override the default output data set name", callback=self.onNameEdited) self.nameEdit.setPlaceholderText("") if sys.version_info < (3, ): box = gui.widgetBox(self.controlArea, "Commit", addSpace=True) self.commitButton = gui.button(box, self, "Commit", callback=self.commit) cb = gui.checkBox(box, self, "autoCommit", "Commit on any change") gui.setStopper(self, self.commitButton, cb, "selectionChanged", self.commit) else: gui.auto_commit(self.controlArea, self, "autoCommit", "Commit", box="Commit") self.commitIf = self.commit gui.rubber(self.controlArea) gui.widgetLabel(self.mainArea, "Filter") self.filterLineEdit = QLineEdit(textChanged=self.filter) self.completer = TokenListCompleter(self, caseSensitivity=Qt.CaseInsensitive) self.filterLineEdit.setCompleter(self.completer) self.mainArea.layout().addWidget(self.filterLineEdit) splitter = QSplitter(Qt.Vertical, self.mainArea) self.mainArea.layout().addWidget(splitter) self.treeWidget = QTreeView(splitter) self.treeWidget.setSelectionMode(QTreeView.SingleSelection) self.treeWidget.setRootIsDecorated(False) self.treeWidget.setSortingEnabled(True) self.treeWidget.setAlternatingRowColors(True) self.treeWidget.setUniformRowHeights(True) self.treeWidget.setEditTriggers(QTreeView.NoEditTriggers) linkdelegate = LinkStyledItemDelegate(self.treeWidget) self.treeWidget.setItemDelegateForColumn(1, linkdelegate) self.treeWidget.setItemDelegateForColumn(8, linkdelegate) self.treeWidget.setItemDelegateForColumn( 0, gui.IndicatorItemDelegate(self.treeWidget, role=Qt.DisplayRole)) proxyModel = MySortFilterProxyModel(self.treeWidget) self.treeWidget.setModel(proxyModel) self.treeWidget.selectionModel().selectionChanged.connect( self.updateSelection) self.treeWidget.viewport().setMouseTracking(True) splitterH = QSplitter(Qt.Horizontal, splitter) box = gui.widgetBox(splitterH, "Description") self.infoGDS = gui.widgetLabel(box, "") self.infoGDS.setWordWrap(True) gui.rubber(box) box = gui.widgetBox(splitterH, "Sample Annotations") self.annotationsTree = QTreeWidget(box) self.annotationsTree.setHeaderLabels( ["Type (Sample annotations)", "Sample count"]) self.annotationsTree.setRootIsDecorated(True) box.layout().addWidget(self.annotationsTree) self.annotationsTree.itemChanged.connect( self.annotationSelectionChanged) self._annotationsUpdating = False self.splitters = splitter, splitterH for sp, setting in zip(self.splitters, self.splitterSettings): sp.splitterMoved.connect(self.splitterMoved) sp.restoreState(setting) self.searchKeys = [ "dataset_id", "title", "platform_organism", "description" ] self.gds = [] self.gds_info = None self.resize(1000, 600) self.setBlocking(True) self.setEnabled(False) self.progressBarInit() self._executor = ThreadExecutor() func = partial(get_gds_model, methodinvoke(self, "_setProgress", (float, ))) self._inittask = Task(function=func) self._inittask.finished.connect(self._initializemodel) self._executor.submit(self._inittask) self._datatask = None
def __init__(self, parent=None, signalManager=None, title="Molecule visualizer"): super(OWMoleculeVisualizer, self).__init__(parent, signalManager, title) self.colorFragments = 1 self.showFragments = 0 self.selectedFragment = "" self.moleculeSmiles = [] self.fragmentSmiles = [] self.defFragmentSmiles = [] self.smiles_var = 0 self.moleculeTitleAttr = 0 self.moleculeTitleAttributeList = [] self.selectedMoleculeTitleAttrs = [] self.fragmentSmilesAttr = 0 self.imageSize = 200 self.numColumns = 4 self.commitOnChange = 0 ## GUI box = OWGUI.widgetBox(self.controlArea, "Info", addSpace=True) self.infoLabel = OWGUI.label(box, self, "Chemicals:") box = OWGUI.radioButtonsInBox( self.controlArea, self, "showFragments", ["Show molecules", "Show fragments"], "Show", callback=self.updateitems ) self.showFragmentsRadioButton = box.buttons[-1] self.markFragmentsCheckBox = OWGUI.checkBox( box, self, "colorFragments", "Mark fragments", callback=self._update ) box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) OWGUI.separator(self.controlArea) self.moleculeSmilesCombo = OWGUI.comboBox( self.controlArea, self, "smiles_var", "Molecule SMILES Attribute", callback=self.updateitems ) self.moleculeSmilesCombo.box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum) ) self.smiles_var_model = VariableListModel(parent=self) self.moleculeSmilesCombo.setModel(self.smiles_var_model) OWGUI.separator(self.controlArea) box = OWGUI.widgetBox(self.controlArea, "Molecule Title Attributes", addSpace=True) self.title_var_view = QListView( selectionMode=QListView.ExtendedSelection ) self.title_var_model = VariableListModel(parent=self) self.title_var_view.setModel(self.title_var_model) self.title_var_view.selectionModel().selectionChanged.connect( self._title_selection_changed ) box.layout().addWidget(self.title_var_view) OWGUI.separator(self.controlArea) self.fragmentSmilesCombo = OWGUI.comboBox( self.controlArea, self, "fragmentSmilesAttr", "Fragment SMILES Attribute", callback=self.updateFragmentsListBox ) self.fragmentSmilesCombo.setModel(VariableListModel(parent=self)) self.fragmentSmilesCombo.box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum) ) OWGUI.separator(self.controlArea) box = OWGUI.spin(self.controlArea, self, "imageSize", 50, 500, 10, box="Image Size", callback=self._image_size_changed) box.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)) OWGUI.separator(self.controlArea) box = OWGUI.widgetBox(self.controlArea, "Selection", addSpace=True) OWGUI.checkBox(box, self, "commitOnChange", "Commit on change") self.selectMarkedMoleculesButton = OWGUI.button( box, self, "Select &matched molecules", self.select_marked ) OWGUI.button(box, self, "&Commit", callback=self.commit, default=True) OWGUI.separator(self.controlArea) OWGUI.rubber(self.controlArea) spliter = QSplitter(Qt.Vertical) self.scrollArea = ScrollArea(spliter) self.grid = GridWidget() self.grid.selectionChanged.connect(self._on_selection_changed) self.scrollArea.setWidget(self.grid) self.scrollArea.setWidgetResizable(True) self.mainArea.layout().addWidget(spliter) if pybel: self.listBox = QListWidget(spliter) else: self.listBox = QListWidget(None) self.listBox.setHidden(True) self.listBox.itemClicked.connect(self.fragmentSelection) self.fragmentSmilesCombo.box.setDisabled(not pybel) self.data = None self.data_subset = [] self.fragment_data = None self.resize(800, 600) self.listBox.setMaximumHeight(150) self.fragmentSmilesCombo.setDisabled(True) self.selectMarkedMoleculesButton.setDisabled(True) self.markFragmentsCheckBox.setDisabled(True) self.showFragmentsRadioButton.setDisabled(True) self.loadSettings() if not pybel: self.showFragments = 0 self.warning(10, "Pybel module not installed. To view molecule fragments\n" "please install openbabel python extension.") self.__loop = None