Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export default class ngbCytoscapePathwayController {
const savedState = JSON.parse(localStorage.getItem(this.storageName) || '{}');
const savedLayout = savedState.layout ? savedState.layout[this.elements.id] : undefined;
let elements;
this.elements.nodes = this.saveDefaultPositions(this.elements.nodes, this.isCollage());
if (savedLayout) {
elements = {
nodes: this.wrapNodes(
Expand All @@ -246,7 +247,6 @@ export default class ngbCytoscapePathwayController {
edges: savedLayout.edges
};
} else {
this.elements.nodes = this.saveDefaultPositions(this.elements.nodes, this.isCollage());
elements = {
nodes: this.wrapNodes(
this.getPlainNodes(this.positionedNodes(this.elements.nodes)),
Expand Down Expand Up @@ -307,14 +307,14 @@ export default class ngbCytoscapePathwayController {
zoomIn() {
const zoom = this.zoom() + this.ZOOM_STEP;
viewerContext.viewer.zoom(zoom);
// viewerContext.centerCytoscape();
viewerContext.centerCytoscape();
this.canZoomIn = zoom < viewerContext.viewer.maxZoom();
this.canZoomOut = zoom > viewerContext.viewer.minZoom();
},
zoomOut() {
const zoom = this.zoom() - this.ZOOM_STEP;
viewerContext.viewer.zoom(zoom);
// viewerContext.centerCytoscape();
viewerContext.centerCytoscape();
this.canZoomIn = zoom < viewerContext.viewer.maxZoom();
this.canZoomOut = zoom > viewerContext.viewer.minZoom();
},
Expand All @@ -327,6 +327,8 @@ export default class ngbCytoscapePathwayController {
viewerContext.viewer.layout(this.settings.loadedLayout).run();
});
viewerContext.saveLayout();
this.actionsManager.canZoomIn = this.actionsManager.zoom() < viewerContext.viewer.maxZoom();
this.actionsManager.canZoomOut = this.actionsManager.zoom() > viewerContext.viewer.minZoom();
},
canZoomIn: true,
canZoomOut: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export default class ngbInternalPathwaysResultController extends baseController
if (this.ngbPathwaysService.currentInternalPathway) {
this.annotationList = this.ngbPathwaysAnnotationService.getPathwayAnnotationList(this.ngbPathwaysService.currentInternalPathway.id);
this.applyAnnotations();
if (this.annotationList && this.annotationList.length !== 0) {
this.annotationsPanelVisible = true;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ export default class ngbPathwaysAnnotationController {
};
if (isHeatmapChange || !this.colorScheme) {
const colorSchemeParams = {colorFormat: ColorFormats.hex};
colorSchemeParams.minimum = this.annotation.config.minCellValue;
colorSchemeParams.maximum = this.annotation.config.maxCellValue;
if (this.annotation.config.minCellValue) {
colorSchemeParams.minimum = this.annotation.config.minCellValue;
}
if (this.annotation.config.maxCellValue) {
colorSchemeParams.maximum = this.annotation.config.maxCellValue;
}
this.colorScheme = options.colorScheme.copy(colorSchemeParams);
}
this.annotation.config.minCellValue = this.colorScheme.minimum;
this.annotation.config.maxCellValue = this.colorScheme.maximum;
});
options.data.options = {id, projectId};
this.annotation.name = this.annotation.name || this.heatmap.prettyName || this.heatmap.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ function parseConfigHeatmap(config, header) {
return {
labels,
values: config.values,
heatmapId: config.heatmapId
heatmapId: config.heatmapId,
minCellValue: config.minCellValue,
maxCellValue: config.maxCellValue
};
}

Expand Down Expand Up @@ -191,7 +193,9 @@ export default class ngbPathwaysAnnotationService {
for (const annotation of rawAnnotationList) {
if (annotation.serializedColorScheme) {
annotation.colorScheme = ColorScheme.parse(annotation.serializedColorScheme).copy({
colorFormat: ColorFormats.hex
colorFormat: ColorFormats.hex,
minimum: annotation.value.minCellValue,
maximum: annotation.value.maxCellValue
});
delete annotation.serializedColorScheme;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<md-input-container class="add-annotation-dlb-input">
<md-checkbox aria-label="select heatmap" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.HEATMAP}}">
Select heatmap file
Expand Down Expand Up @@ -63,7 +63,7 @@
<md-input-container class="add-annotation-dlb-input add-annotation-dlb-file-checkbox">
<md-checkbox aria-label="upload TSV\CSV" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.CSV}}">
Upload TSV/CSV
Expand Down Expand Up @@ -108,7 +108,7 @@
<md-input-container class="add-annotation-dlb-input">
<md-checkbox aria-label="manual colors config" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.MANUAL}}">
Manual colors config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export default class ngbPathwaysAnnotationAddDlgController {
this.annotation = {
...annotation
};
this.colorScheme = this.annotation.colorScheme.copy();
if (this.annotation.type === this.ngbPathwaysAnnotationService.annotationTypeList.HEATMAP
|| this.annotation.type === this.ngbPathwaysAnnotationService.annotationTypeList.CSV) {
this.colorScheme = this.annotation.colorScheme.copy();
}
} else {
this.annotation = {
name: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ export default class ngbTrackEvents {
: undefined,
});
}
if (data.feature.feature
&& data.feature.feature.toLowerCase() === 'gene'
&& data.feature.name) {
if (data.feature.feature && data.feature.name) {
const layoutChange = this.appLayout.Panels.pathways;
layoutChange.displayed = true;
menuData.push({
Expand All @@ -235,8 +233,8 @@ export default class ngbTrackEvents {
name: 'read:show:pathways'
}],
title: 'Show pathways',
disabled: (data.feature.feature || '').toLowerCase() !== 'gene' || !data.feature.name,
warning: (data.feature.feature || '').toLowerCase() !== 'gene' || !data.feature.name
disabled: !data.feature.name,
warning: !data.feature.name
? 'Feature type is not Gene or Name is missing'
: undefined,
});
Expand Down