Example #1
0
    def __init__(self, **kwargs):
        super(PLSDAApp, self).__init__(**kwargs)

        # Define automatic mapping (settings will determine the route; allow manual tweaks later)

        self.addDataToolBar()
        self.addExperimentToolBar()
        self.addFigureToolBar()

        self.views.addView(MplScatterView(self), 'Scores')

        self.views.addView(MplSpectraView(self), 'LV1')
        self.views.addView(MplSpectraView(self), 'LV2')

        self.data.add_output('scores')
        self.data.add_output('weights')

        self.data.add_input('input')  # Add input slot

        self.config.set_defaults({
            'number_of_components': 2,
            'autoscale': False,
            'algorithm': 'NIPALS',
        })

        self.addConfigPanel(PLSDAConfigPanel, 'PLSDA')

        # Setup data consumer options
        self.data.consumer_defs.append(DataDefinition('input', {}))

        self.finalise()
Example #2
0
    def __init__(self, **kwargs):
        super(PCAApp, self).__init__(**kwargs)

        # Define automatic mapping (settings will determine the route; allow manual tweaks later)

        self.views.addView(MplScatterView(self), 'Scores')
        self.views.addView(MplSpectraView(self), 'PC1')
        self.views.addView(MplSpectraView(self), 'PC2')
        self.views.addView(MplSpectraView(self), 'PC3')
        self.views.addView(MplSpectraView(self), 'PC4')
        self.views.addView(MplSpectraView(self), 'PC5')

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot

        self.data.add_output('scores')
        self.data.add_output('weights')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input',
                {
                    #            'labels_n':   (None,['Pathway']),
                }))

        self.config.set_defaults({
            'number_of_components': 2,
        })

        self.addConfigPanel(PCAConfigPanel, 'PCA')

        self.finalise()
Example #3
0
    def __init__(self, **kwargs):
        super(IcoshiftApp, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'Spectra')
        self.views.addView(MplDifferenceView(self), 'Shift')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        self.config.set_defaults({
            'target': 'average',
            'alignment_mode': 'whole',
            'maximum_shift': 'f',
        })

        self.addConfigPanel(IcoshiftConfigPanel, 'Settings')

        self.finalise()
Example #4
0
    def __init__(self, **kwargs):
        super(NMRLabMetabolabTool, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addTab(MplSpectraView(self), 'View')

        # Start matlab interface
        self.matlab = mlabwrap.init()
        #code = "addpath('%s')" % os.path.abspath( self.plugin.path )
        #r = self.matlab.run_code(code)
        #print r,"!!!!"

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        self.config.set_defaults({
            'bin_size': 0.01,
            'bin_offset': 0,
        })
Example #5
0
    def __init__(self, **kwargs):
        super(NMRPeakPickingApp, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'View')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        self.config.set_defaults({
            'peak_threshold': 0.05,
            'peak_separation': 0.5,
            'peak_algorithm': 'Threshold',
        })

        self.addConfigPanel(PeakPickConfigPanel, 'Settings')

        self.finalise()
Example #6
0
    def __init__(self, **kwargs):
        super(MATLABTool, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addTab(MplSpectraView(self), 'View')

        # Start matlab interface
        self.matlab = mlabwrap.init()

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        self.config.set_defaults({
            'bin_size': 0.01,
            'bin_offset': 0,
        })
Example #7
0
    def __init__(self, **kwargs):
        super(MetaboHunterApp, self).__init__(**kwargs)
        #Define automatic mapping (settings will determine the route; allow manual tweaks later)

        self.addDataToolBar(default_pause_analysis=True)
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'View')

        self.config.set_defaults({
            'Metabotype': 'All',
            'Database Source': 'HMDB',
            'Sample pH': 'ph7',
            'Solvent': 'water',
            'Frequency': 'all',
            'Method': 'HighestNumberNeighbourhood',
            'Noise Threshold': 0.0,
            'Confidence Threshold': 0.4,
            'Tolerance': 0.1,
        })

        self.addConfigPanel(MetaboHunterConfigPanel, 'MetaboHunter')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition('input', {
                'scales_t': (None, ['float']),
                'entities_t': (None, None),
            }))

        self.finalise()
Example #8
0
    def __init__(self, **kwargs):
        super(NMRPeakAdjApp, self).__init__(**kwargs)
        
        self.addDataToolBar()
        self.addFigureToolBar()
        
        self.data.add_input('input') # Add input slot        
        self.data.add_output('output')
        self.data.add_output('region')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'View')
        self.views.addView(MplSpectraView(self), 'Region')
    
        
        # Setup data consumer options
        self.data.consumer_defs.append( 
            DataDefinition('input', {
            'labels_n':     ('>1', None),
            'entities_t':   (None, None), 
            'scales_t': (None, ['float']),
            })
        )
        
        # Define default settings for pathway rendering
        self.config.set_defaults({
            # Peak target
            'peak_target': 'TMSP',
            'peak_target_ppm': 0.0,
            'peak_target_ppm_tolerance': 0.5,
            # Shifting
            'shifting_enabled': True,
            
            # Scaling
            'scaling_enabled': True,
        })        
        

        self.region_dso = None
        self._automated_update_config = False

        self.addConfigPanel( PeakAdjConfigPanel, 'Settings')

        self.finalise()
Example #9
0
    def __init__(self, **kwargs):
        super(TransformApp, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')  # Add output slot
        self.table.setModel(self.data.o['output'].as_table)

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input',
                {  # Accept anything!
                }))

        self.views.addView(MplSpectraView(self), 'View')

        self.finalise()
Example #10
0
    def __init__(self, **kwargs):
        super(SpectraTool, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot

        self.views.addTab(MplSpectraView(self), 'View')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        self.finalise()
    def __init__(self, **kwargs):
        super(BaselineCorrectionTool, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'View')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        # Define default settings for pathway rendering
        self.config.set_defaults({
            # Peak target
            'algorithm': 'median',
            # Baseline settings
            'med_mw': 24,
            'med_sf': 16,
            'med_sigma': 5.0,
            # cbf settings
            'cbf_last_pc': 10,
            # cbf_explicit settings
            'cbf_explicit_start': 0,
            'cbf_explicit_end': 100,
            # base settings
            'base_nl': [],
            'base_nw': 0,
        })

        self.addConfigPanel(BaselineCorrectionConfigPanel, 'Settings')
        self.finalise()
Example #12
0
    def __init__(self, **kwargs):
        super(SpectraNormApp, self).__init__(**kwargs)

        self.addDataToolBar()
        self.addFigureToolBar()

        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')
        self.table.setModel(self.data.o['output'].as_table)

        self.views.addView(MplSpectraView(self), 'View')
        self.views.addView(MplDifferenceView(self), 'Difference')

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition(
                'input', {
                    'labels_n': ('>1', None),
                    'entities_t': (None, None),
                    'scales_t': (None, ['float']),
                }))

        th = self.addToolBar('Spectra normalisation')

        self.algorithms = {
            'PQN': self.pqn,
            'TSA': self.tsa,
        }

        self.config.set_defaults({
            'algorithm': 'PQN',
        })

        self.addConfigPanel(SpectraNormConfigPanel, 'Settings')

        self.finalise()