Source code for ccpn.AnalysisScreen.AnalysisScreen

"""
Module Documentation here
"""
#=========================================================================================
# Licence, Reference and Credits
#=========================================================================================
__copyright__ = "Copyright (C) CCPN project (http://www.ccpn.ac.uk) 2014 - 2022"
__credits__ = ("Ed Brooksbank, Joanna Fox, Victoria A Higman, Luca Mureddu, Eliza Płoskoń",
               "Timothy J Ragan, Brian O Smith, Gary S Thompson & Geerten W Vuister")
__licence__ = ("CCPN licence. See http://www.ccpn.ac.uk/v3-software/downloads/license")
__reference__ = ("Skinner, S.P., Fogh, R.H., Boucher, W., Ragan, T.J., Mureddu, L.G., & Vuister, G.W.",
                 "CcpNmr AnalysisAssign: a flexible platform for integrated NMR analysis",
                 "J.Biomol.Nmr (2016), 66, 111-124, http://doi.org/10.1007/s10858-016-0060-y")
#=========================================================================================
# Last code modification
#=========================================================================================
__modifiedBy__ = "$modifiedBy: Geerten Vuister $"
__dateModified__ = "$dateModified: 2022-02-02 10:17:25 +0000 (Wed, February 02, 2022) $"
__version__ = "$Revision: 3.0.4 $"
#=========================================================================================
# Created
#=========================================================================================
__author__ = "$Author: Luca Mureddu $"
__date__ = "$Date: 2018-12-20 15:44:34 +0000 (Thu, December 20, 2018) $"
#=========================================================================================
# Start of code
#=========================================================================================

from ccpn.framework.Version import applicationVersion
from ccpn.framework.Application import ANALYSIS_SCREEN

from ccpn.pipes import loadedPipes
from ccpn.AnalysisScreen.pipes import _loadScreenPipes
from ccpn.AnalysisScreen.gui.popups.MixtureGenerationPopup import MixtureGenerationPopup
from ccpn.AnalysisScreen.gui.modules.HitAnalyisGuiModule import HitsAnalysisGuiModule
from ccpn.AnalysisScreen.gui.modules.MixtureAnalysis import MixtureAnalysis
from ccpn.ui.gui.widgets import MessageDialog
from ccpn.ui.gui.modules.PipelineModule import GuiPipeline
from ccpn.ui.gui.popups.PickPeaks1DPopup import PickPeak1DPopup
from ccpn.AnalysisAssign.AnalysisAssign import Assign
from ccpn.util.decorators import logCommand


_loadScreenPipes()  # load screen specific pipes


[docs]class Screen(Assign): """Root class for Screen application """ applicationName = ANALYSIS_SCREEN applicationVersion = applicationVersion def __init__(self, commandLineArguments): Assign.__init__(self, commandLineArguments) ######################################### Start setup Menu ############################################# def _setupMenus(self): super()._setupMenus() menuSpec = ('Screen', [ ("Generate Mixtures...", self.showMixtureGenerationPopup, [('shortcut', 'gm')]), ("Mixtures Analysis", self.showMixtureAnalysis, [('shortcut', 'mi')]), ("Screening Pipeline", self.showScreeningPipeline, [('shortcut', 'pi')]), ("Hit Analysis", self.showHitAnalysisModule, [('shortcut', 'ha')]), ("Compare Screens", self.showCompareScreensModule, [('shortcut', 'dc')]), (), ("Decomposition (PCA)", self.showDecompositionModule, [('shortcut', 'de')]), ] ) self._addApplicationMenuSpec(menuSpec)
[docs] def showMixtureGenerationPopup(self): """Show the Sample creation popup """ popup = MixtureGenerationPopup(parent=self.ui.mainWindow, mainWindow=self.ui.mainWindow) popup.exec_()
[docs] @logCommand('application.') def showMixtureAnalysis(self, position='bottom', relativeTo=None): """Display the Mixtures Analysis Module """ showSa = MixtureAnalysis(mainWindow=self.ui.mainWindow) self.ui.mainWindow.moduleArea.addModule(showSa, position=position, relativeTo=relativeTo) return showSa
[docs] @logCommand('application.') def showScreeningPipeline(self, position='bottom', relativeTo=None): """Display the Screening pipeLine Module """ guiPipeline = GuiPipeline(mainWindow=self.ui.mainWindow, pipes=loadedPipes, templates=None) self.ui.mainWindow.moduleArea.addModule(guiPipeline, position='bottom') return guiPipeline
[docs] @logCommand('application.') def showHitAnalysisModule(self, position='top', relativeTo=None): """Display the Hit Analysis Module """ self.showScreeningHits = HitsAnalysisGuiModule(mainWindow=self.ui.mainWindow) self.ui.mainWindow.moduleArea.addModule(self.showScreeningHits, position, None) return self.showScreeningHits
[docs] @logCommand('application.') def showCompareScreensModule(self, position='top', relativeTo=None): """Display the CompareScreeningDataset Module """ from ccpn.AnalysisScreen.gui.modules.CompareScreens import CompareScreens self.showCompareScreens = CompareScreens(mainWindow=self.ui.mainWindow) self.ui.mainWindow.moduleArea.addModule(self.showCompareScreens, position, None) return self.showCompareScreens
[docs] @logCommand('application.') def showDecompositionModule(self): """Display the Decomposition Module """ try: from ccpn.AnalysisMetabolomics.ui.gui.modules.PcaModule import PcaModule pcaModule = PcaModule(mainWindow=self.ui.mainWindow) self.ui.mainWindow.moduleArea.addModule(pcaModule, position='bottom') return pcaModule except ImportError as ir: MessageDialog.showError("PCA Not Available", "The Metabolomics package is required for this module.")
######################################### End setup Menus #############################################