def move_to_data_processing(mainWindow): if mainWindow.controller.verbose == True: print "moving to data processing" if mainWindow.controller.homeDir == None: mainWindow.display_info('To begin either load an existing project or create a new one') return False if mainWindow.dockWidget != None: mainWindow.remove_left_dock() ## prepare variables mainWindow.log.log['currentState'] = "Data Processing" allGeneLists = get_gene_list_names(mainWindow.controller.homeDir) mainWindow.mainWidget = QtGui.QWidget(mainWindow) currentAction = mainWindow.log.log['dataProcessingAction'] #if mainWindow.log.log['checksArray'] == None: # mainWindow.log.log['checksArray'] = np.zeros([len(fileList),len(masterChannelList)],) #checksArray = mainWindow.log.log['checksArray'] #if mainWindow.mainWidget: # mainWindow.mainWidget.destroy() ## ready a DataProcessingCenter class if len(allGeneLists) == 0: mainWindow.dpc = BlankPage(parent=mainWindow.mainWidget) mainWindow.dpc.change_label("To get started load a gene list") else: mainWindow.dpc = DataProcessingCenter(allGeneLists,controller=mainWindow.controller,parent=mainWindow.mainWidget) hbl = QtGui.QHBoxLayout(mainWindow.mainWidget) hbl.setAlignment(QtCore.Qt.AlignTop) hbl.addWidget(mainWindow.dpc) mainWindow.refresh_main_widget() ## set main widget size widgetWidth = 0.70 * mainWindow.screenWidth mainWindow.mainWidget.setMaximumWidth(widgetWidth) mainWindow.mainWidget.setMinimumWidth(widgetWidth) mainWindow.add_left_dock() mainWindow.track_highest_state() mainWindow.controller.save() if mainWindow.pDock != None: mainWindow.pDock.set_btn_highlight('data processing') return True
def testGetAllGeneLists(self): allGeneLists = get_gene_list_names(self.homeDir) self.assertEqual(len(allGeneLists), 1)
def add_left_dock(mainWindow): if mainWindow.dockWidget != None: remove_left_dock(mainWindow) if mainWindow.controller.homeDir == None: noProject = True mainWindow.mainDockWidget = QtGui.QDockWidget("no project loaded", mainWindow) else: noProject = False allGeneLists = get_gene_list_names(mainWindow.controller.homeDir) mainWindow.mainDockWidget = QtGui.QDockWidget(mainWindow.controller.projectID, mainWindow) mainWindow.mainDockWidget.setObjectName("MainDockWidget") mainWindow.mainDockWidget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea) mainWindow.dockWidget = QtGui.QWidget(mainWindow) palette = mainWindow.dockWidget.palette() role = mainWindow.dockWidget.backgroundRole() palette.setColor(role, QtGui.QColor("black")) mainWindow.dockWidget.setPalette(palette) mainWindow.dockWidget.setAutoFillBackground(True) # setup alignments masterBox = QtGui.QVBoxLayout(mainWindow.dockWidget) vbox1 = QtGui.QVBoxLayout() vbox1.setAlignment(QtCore.Qt.AlignTop) hbox1 = QtGui.QHBoxLayout() hbox1.setAlignment(QtCore.Qt.AlignCenter) vbox2 = QtGui.QVBoxLayout() vbox2.setAlignment(QtCore.Qt.AlignBottom) hbox2 = QtGui.QHBoxLayout() hbox2.setAlignment(QtCore.Qt.AlignCenter) widgetWidth = 0.15 * mainWindow.screenWidth mainWindow.dockWidget.setMaximumWidth(widgetWidth) mainWindow.dockWidget.setMinimumWidth(widgetWidth) if mainWindow.log.log["currentState"] == "initial": mainWindow.dock1 = InitialDock1( contBtnFn=False, addBtnFn=False, speciesFn=False, message="To begin select 'file' \nand create/load a project", ) mainWindow.dock1.setAutoFillBackground(True) hbox1.addWidget(mainWindow.dock1) elif mainWindow.log.log["currentState"] == "Data Processing": mainWindow.dock1 = InitialDock1(contBtnFn=False, addBtnFn=mainWindow.add_files_to_project) mainWindow.dock1.setAutoFillBackground(True) hbox1.addWidget(mainWindow.dock1) ## add the pipeline dock add_pipeline_dock(mainWindow) hbox2.addWidget(mainWindow.pDock) ## finalize alignments vbox1.addLayout(hbox1) vbox2.addLayout(hbox2) masterBox.addLayout(vbox1) masterBox.addLayout(vbox2) # vbox.addLayout(vbl3) mainWindow.mainDockWidget.setWidget(mainWindow.dockWidget) mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, mainWindow.mainDockWidget) ## file selector """