コード例 #1
0
    def __init__(self, **kwargs):
        super(PathwayMiningApp, self).__init__(**kwargs)

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

        self.config.set_defaults({
            '/Data/MiningActive': False,
            '/Data/MiningDepth': 5,
            '/Data/MiningType': 'c',
            '/Data/MiningRelative': False,
            '/Data/MiningShared': True,
        })
        #t = self.getCreatedToolbar('Pathway mining', 'pathway_mining')
        #miningSetup = QAction( QIcon( os.path.join( self.plugin.path, 'icon-16.png' ) ), 'Set up pathway mining \u2026', self.m)
        #miningSetup.setStatusTip('Set parameters for pathway mining')
        #miningSetup.triggered.connect(self.onMiningSettings)
        #t.addAction(miningSetup)

        self.data.add_input('input_1')  # Add input slot
        self.data.add_input('input_2')  # Add input slot
        self.data.add_input('input_3')  # Add input slot
        self.data.add_input('input_4')  # Add input slot
        self.data.add_output('output')

        self.table = TableView()
        self.table.setModel(self.data.o['output'].as_table)
        self.views.addView(self.table, 'Table', unfocus_on_refresh=True)

        # Setup data consumer options
        self.data.consumer_defs.extend([
            DataDefinition('input_1', {
                'entities_t': (None, ['Compound', 'Gene', 'Protein']),
            },
                           title='Source compound, gene or protein data'),
            DataDefinition('input_2', {
                'entities_t': (None, ['Compound', 'Gene', 'Protein']),
            },
                           title='Source compound, gene or protein data'),
            DataDefinition('input_3', {
                'entities_t': (None, ['Compound', 'Gene', 'Protein']),
            },
                           title='Source compound, gene or protein data'),
            DataDefinition('input_4', {
                'entities_t': (None, ['Compound', 'Gene', 'Protein']),
            },
                           title='Source compound, gene or protein data'),
        ])

        self.addConfigPanel(PathwayMiningConfigPanel, 'Pathway Mining')

        self.finalise()
コード例 #2
0
    def __init__(self, **kwargs):
        super(MapEntityApp, self).__init__(**kwargs)
        # Define automatic mapping (settings will determine the route; allow manual tweaks later)

        self.addDataToolBar()
        self.addFigureToolBar()
        self.data.add_input('input')  # Add input slot
        self.data.add_output('output')

        self.table = TableView()
        self.table.setItemDelegate(EntityItemDelegate())
        self.data.o['output'].register_interface('as_entity_table',
                                                 EntityTableInterface)
        self.views.addView(self.table, 'Table', unfocus_on_refresh=True)
        self.table.setModel(self.data.o['output'].as_entity_table)
        # Deprecate as too slow for large mappings
        #self.views.addTab(WheezyView(self), 'Entities')

        t = self.getCreatedToolbar('Entity mapping', 'external-data')

        import_dataAction = QAction(
            QIcon(os.path.join(utils.scriptdir, 'icons', 'disk--arrow.png')),
            'Load annotations from file\\u2026', self.m)
        import_dataAction.setStatusTip('Load annotations from .csv. file')
        import_dataAction.triggered.connect(self.onImportEntities)
        t.addAction(import_dataAction)

        self.addExternalDataToolbar()  # Add standard source data options

        self.config.set_defaults({
            'map_object_type': MAP_ENTITY_ALL,
        })

        self._entity_mapping_table = {}

        # Setup data consumer options
        self.data.consumer_defs.append(
            DataDefinition('input', {
                'labels_n': (None, '>0'),
                'entities_t': (None, None),
            }))

        self.addConfigPanel(MapEntityConfigPanel, 'Mapping')

        self.finalise()