Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui issue 731 pathways #768

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/client/app/app.layout.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ export default {
title: 'Lineage',
name: 'layout>strainLineage'
},
pathways: {
displayed: false,
icon: 'device_hub',
iconColor: 'grey-500',
panel: 'ngbPathwaysPanel',
position: 'right',
title: 'Pathways',
name: 'layout>pathways'
},
homologs: {
isHidden: true,
displayed: false,
Expand Down
4 changes: 3 additions & 1 deletion client/client/app/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ngbHomologsPanel from './ngbHomologsPanel';
import ngbLogModule from './ngbLog';
import ngbMolecularViewer from './ngbMolecularViewer';
import ngbOrganizeTracks from './ngbOrganizeTracks';
import ngbPathways from './ngbPathways';
import ngbProjectInfoPanel from './ngbProjectInfoPanel';
import ngbSashimiPlot from './ngbSashimiPlot';
import ngbStrainLineage from './ngbStrainLineage';
Expand Down Expand Up @@ -40,5 +41,6 @@ export default angular.module('NGB_Panels', [
ngbGenesTablePanel,
ngbHomologsPanel,
ngbHeatmapPanel,
ngbStrainLineage
ngbStrainLineage,
ngbPathways
]).name;
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export default class ngbBookmarksTableController extends baseController {
$mdDialog,
trackNamingService,
appLayout,
ngbStrainLineageService
ngbStrainLineageService,
ngbPathwaysService
) {
super();
Object.assign(
Expand All @@ -81,7 +82,8 @@ export default class ngbBookmarksTableController extends baseController {
trackNamingService,
miewContext,
appLayout,
ngbStrainLineageService
ngbStrainLineageService,
ngbPathwaysService
});
this.displayBookmarksFilter = this.ngbBookmarksTableService.displayBookmarksFilter;
if (this.projectContext.references.length) {
Expand Down Expand Up @@ -170,6 +172,7 @@ export default class ngbBookmarksTableController extends baseController {
this.miewContext.routeInfo = entity.miew;
this.heatmapContext.routeInfo = entity.heatmap;
this.ngbStrainLineageService.recoverLocalState(entity.lineage);
this.ngbPathwaysService.recoverLocalState(entity.pathways);
this.projectContext.changeState({
chromosome: chromosomeName ? {name: chromosomeName} : undefined,
viewport: position,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,20 @@ export default class NgbGenesTableContextMenuController extends BaseController {
this.dispatcher.emitSimpleEvent('read:show:homologs', data);
event.stopImmediatePropagation();
}

pathwaysSearch() {
this.close();
const layoutChange = this.appLayout.Panels.pathways;
layoutChange.displayed = true;
this.dispatcher.emitSimpleEvent('layout:item:change', {layoutChange});
const readInfo = {
search: this.entity[`${this.ngbGenesTableService.defaultPrefix}featureName`]
};
const data = {
...readInfo,
source: 'gene'
};
this.dispatcher.emitSimpleEvent('read:show:pathways', data);
event.stopImmediatePropagation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,15 @@
</span>
</md-button>
</md-menu-item>
<md-menu-item>
<md-button ng-click="ctrl.isGene && ctrl.pathwaysSearch($event)"
ng-disabled="!ctrl.isGene">
<span>Show pathways</span>
<span class="ngb-context-menu-warning" ng-if="!ctrl.isGene">
<ng-md-icon class="ngb-context-menu-warning-icon" icon="warning" size="15"></ng-md-icon>
Feature type is not Gene or Name is missing
</span>
</md-button>
</md-menu-item>
</md-menu-content>
</div>
32 changes: 32 additions & 0 deletions client/client/app/components/ngbPathways/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import angular from 'angular';
import cytoscapePathwayComponent from './ngbCytoscapePathway';

// Import components
import ngbInternalPathwaysResult from './ngbInternalPathwaysResult';
import ngbInternalPathwaysTable from './ngbInternalPathwaysTable';
import service from './ngbPathways.service';
import ngbPathwaysAnnotation from './ngbPathwaysAnnotation';
import ngbPathwaysColorSchemePreference from './ngbPathwaysColorSchemePreference';

// Import internal modules
import ngbPathwaysPanel from './ngbPathwaysPanel.component';
import controller from './ngbPathwaysPanel.controller';

// Import Style
import './ngbPathwaysPanel.scss';
import ngbPathwaysPanelPaginate from './ngbPathwaysPanelPaginate';

// Import external modules
export default angular
.module('ngbPathwaysPanel', [
cytoscapePathwayComponent,
ngbInternalPathwaysTable,
ngbInternalPathwaysResult,
ngbPathwaysPanelPaginate,
ngbPathwaysColorSchemePreference,
ngbPathwaysAnnotation
])
.service('ngbPathwaysService', service.instance)
.component('ngbPathwaysPanel', ngbPathwaysPanel)
.controller(controller.UID, controller)
.name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Import Style
import angular from 'angular';

// Import internal modules
import cytoscapeComponent from './ngbCytoscapePathway.component';
import cytoscapeController from './ngbCytoscapePathway.controller';
import './ngbCytoscapePathway.scss';
import cytoscapeSettings from './ngbCytoscapePathway.settings';

export default angular.module('ngbCytoscapePathway', [])
.constant('cytoscapePathwaySettings', cytoscapeSettings)
.controller(cytoscapeController.UID, cytoscapeController)
.component('ngbCytoscapePathway', cytoscapeComponent)
.name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ngbCytoscapePathwayController from './ngbCytoscapePathway.controller';

export default {
template: require('./ngbCytoscapePathway.tpl.html'),
bindings: {
elements: '<',
tag: '@',
onElementClick: '&',
storageName: '@',
searchParams: '<'
},
controller: ngbCytoscapePathwayController
};
Loading