本文整理汇总了Python中Orange.OrangeWidgets.OWGUI.widgetBox方法的典型用法代码示例。如果您正苦于以下问题:Python OWGUI.widgetBox方法的具体用法?Python OWGUI.widgetBox怎么用?Python OWGUI.widgetBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.OrangeWidgets.OWGUI
的用法示例。
在下文中一共展示了OWGUI.widgetBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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())
示例2: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
示例3: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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])
示例4: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
示例5: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
示例6: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
示例7: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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 = []
示例8: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
#.........这里部分代码省略.........
示例9: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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 = None # p-values: 2D Numeric.array of shape (3, numExamples)
self.selectorName = "" # for Example Selection output: (self.selectorName, [0,1,0,...])
# Settings
self.anovaType = 0 # 0: single-sample t-test, 1: one-way (A), 2: one-way (B), 3: two-way (A,B), 4: ful factorial (A, B, A*B)
self.compareToValue = 0 # single sample t-test, value to compare to
self._interaction = 0 # 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 = self.controlArea
# info
box = OWGUI.widgetBox(ca, "Info")
#gl.addWidget(box,0,0)
self.infoa = OWGUI.label(box, self, 'No data on input.')
self.infob = OWGUI.label(box, self, "")
self.infoc = OWGUI.label(box, self, "")
# ANOVA type
# group selection
anovaTypes = ["Single sample t-test",
"Single-factor (A, variables)",
"Single-factor (B, data sets)",
"Two-factor",
"Two-factor with interaction effect"]
self.boxAnovaType = OWGUI.widgetBox(ca, "Anova Type")
self.anovaTypeS = OWGUI.radioButtonsInBox(self.boxAnovaType, self, "anovaType", btnLabels=anovaTypes)
self.boxAnovaType.setDisabled(1)
self.boxCompareTo = OWGUI.widgetBox(self.boxAnovaType)
OWGUI.lineEdit(self.boxCompareTo, self, "compareToValue", callback=self.onCompareToChange, label="compare to")
# selection of examples
self.boxSelection = OWGUI.widgetBox(ca, "Example Selection")
self.lblNumGenes = [] # list of labels
# selector A
self.boxSelectorA = OWGUI.widgetBox(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 = OWGUI.widgetBox(self.boxSelectorA)
leA = OWGUI.lineEdit(frmA, self, "alphaA", orientation="horizontal", callback=lambda x=0: self.onAlphaChange(x), label= "p <= ")
self.lblNumGenes.append(OWGUI.label(frmA, self, ""))
# selector B
self.boxSelectorB = OWGUI.widgetBox(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 = OWGUI.widgetBox(self.boxSelectorB)
leB = OWGUI.lineEdit(frmB, self, "alphaB", orientation="horizontal", callback=lambda x=1: self.onAlphaChange(x), label= "p <= ")
self.lblNumGenes.append(OWGUI.label(frmB, self, ""))
# selector I
self.boxSelectorI = OWGUI.widgetBox(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 = OWGUI.widgetBox(self.boxSelectorI)
leI = OWGUI.lineEdit(frmI, self, "alphaI", orientation="horizontal", callback=lambda x=2: self.onAlphaChange(x), label= "p <= ")
self.lblNumGenes.append(OWGUI.label(frmI, self, ""))
# output
box = OWGUI.widgetBox(ca, "Output")
self.leSelectorName = OWGUI.lineEdit(box, self, 'selectorName', label='Selector Name: ')
self.leSelectorName.setReadOnly(self.autoUpdateSelName)
OWGUI.checkBox(box, self, 'autoUpdateSelName', 'Automatically update selector name', callback=self.onAutoUpdateSelNameChange)
OWGUI.checkBox(box, self, 'sendNotSelectedData', 'Send not selected data', callback=self.onSendNotSelectedChange)
OWGUI.checkBox(box, self, 'sendProbabilities', 'Show p-values', callback=self.onSendProbabilitiesChange)
OWGUI.checkBox(box, self, 'commitOnChange', 'Commit data on selection change', callback=lambda: self.onCommit(self.commitOnChange))
self.btnCommit = OWGUI.button(box, self, "Commit", callback=self.onCommit)
# enable/disable anova type box, example selection box, commit button, update the number of examples for individual selectors
self.updateAnovaTypeBox()
self.updateSelectorBox()
#.........这里部分代码省略.........
示例10: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
#.........这里部分代码省略.........
示例11: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
def __init__(self, parent=None, signalManager=None, name="Vulcano Plot"):
OWWidget.__init__(self, parent, signalManager, name, wantGraph=True)
self.inputs = [("Examples", ExampleTable, self.setData)]
self.outputs = [("Examples with selected attributes", ExampleTable)]
self.genes_in_columns = False
self.showXTitle = True
self.showYTitle = True
self.auto_commit = False
self.selection_changed_flag = False
self.target_group = None, []
self.label_selections = []
self.graph = VulcanoGraph(self)
self.connect(self.graph, SIGNAL("selectionChanged()"),
self.on_selection_changed)
self.mainArea.layout().addWidget(self.graph)
self.loadSettings()
## GUI
box = OWGUI.widgetBox(self.controlArea, "Info")
self.infoLabel = OWGUI.label(box, self, "")
self.infoLabel.setText("No data on input")
self.infoLabel2 = OWGUI.label(box, self, "")
self.infoLabel2.setText("0 selected genes")
box = OWGUI.widgetBox(self.controlArea, "Target Labels")
self.target_widget = LabelSelectionWidget(self)
self.connect(self.target_widget,
SIGNAL("selection_changed(PyQt_PyObject, PyQt_PyObject)"),
self.on_target_changed)
self.connect(self.target_widget,
SIGNAL("label_activated(int)"),
self.on_label_activated)
box.layout().addWidget(self.target_widget)
self.genesInColumnsCheck = OWGUI.checkBox(box, self, "genes_in_columns",
"Genes in columns",
callback=[self.init_from_data, self.plot])
box = OWGUI.widgetBox(self.controlArea, "Settings")
OWGUI.hSlider(box, self, "graph.symbolSize", label="Symbol size: ", minValue=2, maxValue=20, step=1, callback = self.graph.updateSymbolSize)
OWGUI.checkBox(box, self, "showXTitle", "X axis title", callback=self.setAxesTitles)
OWGUI.checkBox(box, self, "showYTitle", "Y axis title", callback=self.setAxesTitles)
toolbar = ZoomSelectToolbar(self, self.controlArea, self.graph, buttons=[ZoomSelectToolbar.IconSelect, ZoomSelectToolbar.IconZoom, ZoomSelectToolbar.IconPan])
top_layout = toolbar.layout()
top_layout.setDirection(QBoxLayout.TopToBottom)
button_layotu = QHBoxLayout()
top_layout.insertLayout(0, button_layotu)
for i in range(1, top_layout.count()):
item = top_layout.itemAt(1)
top_layout.removeItem(item)
button_layotu.addItem(item)
OWGUI.checkBox(toolbar, self, "graph.symetricSelections", "Symetric selection", callback=self.graph.reselect)
box = OWGUI.widgetBox(self.controlArea, "Commit")
b = OWGUI.button(box, self, "Commit", callback=self.commit, default=True)
cb = OWGUI.checkBox(box, self, "auto_commit", "Commit automatically")
OWGUI.setStopper(self, b, cb, "selection_changed_flag", self.commit_if)
self.connect(self.graphButton, SIGNAL("clicked()"), self.graph.saveToFile)
OWGUI.rubber(self.controlArea)
self.data = None
self.target_group = None, []
self.current_selection = []
self.graph.reselect(True)
self.resize(800, 600)
示例12: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
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)
示例13: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
def __init__(self, parent=None, signalManager=None, title="Gene Atlas Tissue Expression"):
OWWidget.__init__(self, parent, signalManager, title)
self.inputs = [("Example Table", Orange.data.Table, self.set_data)]
self.outputs = [("Selected Genes", Orange.data.Table)]
self.selected_organism = "Homo sapiens"
self.selected_gene_attr = 0
self.genes_in_columns = False
self.selected_ef = 0
self.selected_ef_value = 0
self.loadSettings()
#####
# GUI
#####
box = OWGUI.widgetBox(self.controlArea, "Info", addSpace=True)
self.info_label = OWGUI.widgetLabel(box, "No data on input.\n")
box = OWGUI.widgetBox(self.controlArea, "Organism", addSpace=True)
cb = OWGUI.comboBox(box, self, "selected_organism",
items=self.ORGANISMS,
tooltip="Organism name",
callback=self.on_organism_change,
sendSelectedValue=True,
valueType=str
)
cb.setMaximumWidth(250)
box = OWGUI.widgetBox(self.controlArea, "Gene Attribute", addSpace=True)
self.gene_attr_cb = OWGUI.comboBox(box, self, "selected_gene_attr",
tooltip="Attribute (column) containing the gene names.",
callback=self.on_gene_attr_change,
)
self.gene_attr_cb.setMaximumWidth(250)
cb = OWGUI.checkBox(box, self, "genes_in_columns", "Use attribute names",
tooltip="Gene names in columns.",
callback=self.on_genes_change,)
cb.disables.append((-1, self.gene_attr_cb))
cb.makeConsistent()
box = OWGUI.widgetBox(self.controlArea, "Tissues", addSpace=True)
self.categories_cb = OWGUI.comboBox(box, self, "selected_ef",
box="Categories",
items=self.FACTORS,
tooltip="Experimental factor.",
callback=self.on_ef_change,
)
self.categories_cb.box.setFlat(True)
self.values_cb = OWGUI.comboBox(box, self, "selected_ef_value",
box="Values",
tooltip="Experimental factor value.",
callback=self.on_ef_value_change
)
self.values_cb.setMaximumWidth(250)
self.values_cb.box.setFlat(True)
box = OWGUI.widgetBox(self.controlArea, "Cache", addSpace=True)
OWGUI.button(box, self, "Clear cache",
callback=self.on_cache_clear,
tooltip="Clear Gene Atlas cache.")
OWGUI.rubber(self.controlArea)
OWGUI.button(self.controlArea, self, label="Commit",
callback=self.commit,
tooltip="Send selected genes")
self.report_view = QTreeView(self.mainArea)
self.report_view.setSelectionMode(QTreeView.ExtendedSelection)
self.report_view.setSortingEnabled(True)
self.report_view.setRootIsDecorated(False)
self.report_view.setAlternatingRowColors(True)
self.report_view.setEditTriggers(QTreeView.NoEditTriggers)
self.mainArea.layout().addWidget(self.report_view)
self.report_header = ["Gene symbol", "Up", "Down"]
model = QStandardItemModel()
model.setHorizontalHeaderLabels(self.report_header)
self.report_view.setModel(model)
self.data = None
self.candidate_vars = []
self.candidate_var_names = []
self.results = {}, {}, {}
self.ensembl_info = None
self.gene_matcher = obiGene.GMDirect()
self.loaded_matcher_taxid = None
self.unknown_genes = []
self.query_genes = []
# self.set_organism(self.selected_organism, update_results=False)
self.get_atlas_summary = obiGeneAtlas.get_atlas_summary
#Cached construct_matcher
#.........这里部分代码省略.........
示例14: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
def __init__(self, parent=None, signalManager=None, title="Gene Network"):
super(OWGeneNetwork, self).__init__(
parent, signalManager, title, wantMainArea=False,
resizingEnabled=False
)
self.taxid = "9606"
self.gene_var_index = -1
self.use_attr_names = False
self.network_source = 1
self.include_neighborhood = True
self.autocommit = False
self.min_score = 0.9
self.loadSettings()
self.taxids = taxonomy.common_taxids()
self.current_taxid_index = self.taxids.index(self.taxid)
self.data = None
self.geneinfo = None
self.nettask = None
self._invalidated = False
box = OWGUI.widgetBox(self.controlArea, "Info")
self.info = OWGUI.widgetLabel(box, "No data on input\n")
box = OWGUI.widgetBox(self.controlArea, "Organism")
self.organism_cb = OWGUI.comboBox(
box, self, "current_taxid_index",
items=map(taxonomy.name, self.taxids),
callback=self._update_organism
)
box = OWGUI.widgetBox(self.controlArea, "Genes")
self.genes_cb = OWGUI.comboBox(
box, self, "gene_var_index", callback=self._update_query_genes
)
self.varmodel = OWItemModels.VariableListModel()
self.genes_cb.setModel(self.varmodel)
OWGUI.checkBox(
box, self, "use_attr_names",
"Use attribute names",
callback=self._update_query_genes
)
box = OWGUI.widgetBox(self.controlArea, "Network")
OWGUI.comboBox(
box, self, "network_source",
items=[s.name for s in SOURCES],
callback=self._on_source_db_changed
)
OWGUI.checkBox(
box, self, "include_neighborhood",
"Include immediate gene neighbors",
callback=self.invalidate
)
self.score_spin = OWGUI.doubleSpin(
box, self, "min_score", 0.0, 1.0, step=0.001,
label="Minimal edge score",
callback=self.invalidate
)
self.score_spin.setEnabled(SOURCES[self.network_source].score_filter)
box = OWGUI.widgetBox(self.controlArea, "Commit")
OWGUI.button(box, self, "Commit", callback=self.commit, default=True)
self.executor = ThreadExecutor()
示例15: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import widgetBox [as 别名]
def __init__(self, parent=None, signalManager=None):
OWWidget.__init__(self, parent, signalManager, "Parallel Coordinates", True)
#add a graph widget
self.graph = OWParallelGraph(self, self.mainArea)
self.mainArea.layout().addWidget(self.graph)
self.showAllAttributes = 0
self.inputs = [("Data", ExampleTable, self.setData, Default),
("Data Subset", ExampleTable, self.setSubsetData),
("Features", AttributeList, self.setShownAttributes)]
self.outputs = [("Selected Data", ExampleTable),
("Other Data", ExampleTable),
("Features", AttributeList)]
#set default settings
self.data = None
self.subsetData = None
self.autoSendSelection = 1
self.attrDiscOrder = "Unordered"
self.attrContOrder = "Unordered"
self.projections = None
self.correlationDict = {}
self.middleLabels = "Correlations"
self.attributeSelectionList = None
self.toolbarSelection = 0
self.colorSettings = None
self.selectedSchemaIndex = 0
self.graph.jitterSize = 10
self.graph.showDistributions = 1
self.graph.showStatistics = 0
self.graph.showAttrValues = 1
self.graph.useSplines = 0
self.graph.enabledLegend = 1
#load settings
self.loadSettings()
#GUI
self.tabs = OWGUI.tabWidget(self.controlArea)
self.GeneralTab = OWGUI.createTabPage(self.tabs, "Main")
self.SettingsTab = OWGUI.createTabPage(self.tabs, "Settings")
self.createShowHiddenLists(self.GeneralTab, callback=self.updateGraph)
self.connect(self.shownAttribsLB, SIGNAL('itemDoubleClicked(QListWidgetItem*)'), self.flipAttribute)
self.optimizationDlg = ParallelOptimization(self, signalManager=self.signalManager)
self.optimizationDlgButton = OWGUI.button(self.GeneralTab, self, "Optimization Dialog",
callback=self.optimizationDlg.reshow, debuggingEnabled=0)
self.zoomSelectToolbar = OWToolbars.ZoomSelectToolbar(self, self.GeneralTab, self.graph, self.autoSendSelection,
buttons=(1, 2, 0, 7, 8))
self.connect(self.zoomSelectToolbar.buttonSendSelections, SIGNAL("clicked()"), self.sendSelections)
#connect controls to appropriate functions
self.connect(self.graphButton, SIGNAL("clicked()"), self.graph.saveToFile)
# ####################################
# SETTINGS functionality
box = OWGUI.widgetBox(self.SettingsTab, "Transparency")
OWGUI.hSlider(box, self, 'graph.alphaValue', label="Examples: ", minValue=0, maxValue=255, step=10,
callback=self.updateGraph, tooltip="Alpha value used for drawing example lines")
OWGUI.hSlider(box, self, 'graph.alphaValue2', label="Rest: ", minValue=0, maxValue=255, step=10,
callback=self.updateGraph, tooltip="Alpha value used to draw statistics, example subsets, ...")
box = OWGUI.widgetBox(self.SettingsTab, "Jittering Options")
OWGUI.comboBox(box, self, "graph.jitterSize", label='Jittering size (% of size): ', orientation='horizontal',
callback=self.setJitteringSize, items=self.jitterSizeNums, sendSelectedValue=1, valueType=float)
# visual settings
box = OWGUI.widgetBox(self.SettingsTab, "Visual Settings")
OWGUI.checkBox(box, self, 'graph.showAttrValues', 'Show attribute values', callback=self.updateGraph)
OWGUI.checkBox(box, self, 'graph.useAntialiasing', 'Use antialiasing', callback=self.updateGraph)
OWGUI.checkBox(box, self, 'graph.useSplines', 'Show splines', callback=self.updateGraph,
tooltip="Show lines using splines")
OWGUI.checkBox(box, self, 'graph.enabledLegend', 'Show legend', callback=self.updateGraph)
box = OWGUI.widgetBox(self.SettingsTab, "Axis Distance")
resizeColsBox = OWGUI.widgetBox(box, 0, "horizontal", 0)
OWGUI.label(resizeColsBox, self, "Increase/decrease distance: ")
OWGUI.toolButton(resizeColsBox, self, "+", callback=self.increaseAxesDistance,
tooltip="Increase the distance between the axes", width=30, height=20)
OWGUI.toolButton(resizeColsBox, self, "-", callback=self.decreaseAxesDistance,
tooltip="Decrease the distance between the axes", width=30, height=20)
OWGUI.rubber(resizeColsBox)
OWGUI.checkBox(box, self, "graph.autoUpdateAxes", "Auto scale X axis",
tooltip="Auto scale X axis to show all visualized attributes", callback=self.updateGraph)
box = OWGUI.widgetBox(self.SettingsTab, "Statistical Information")
OWGUI.comboBox(box, self, "graph.showStatistics", label="Statistics: ", orientation="horizontal", labelWidth=90,
items=["No statistics", "Means, deviations", "Median, quartiles"], callback=self.updateGraph,
sendSelectedValue=0, valueType=int)
OWGUI.comboBox(box, self, "middleLabels", label="Middle labels: ", orientation="horizontal", labelWidth=90,
items=["No labels", "Correlations", "VizRank"], callback=self.updateGraph,
tooltip="The information do you wish to view on top in the middle of coordinate axes",
sendSelectedValue=1, valueType=str)
OWGUI.checkBox(box, self, 'graph.showDistributions', 'Show distributions', callback=self.updateGraph,
#.........这里部分代码省略.........