Skip to content
Snippets Groups Projects
Commit e9eea220 authored by Michael Hartung's avatar Michael Hartung
Browse files

query node in analysis network

parent ffaa7083
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { ...@@ -79,7 +79,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig)); public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig));
private network: any; public network: any;
private nodeData: { nodes: any, edges: any } = {nodes: null, edges: null}; private nodeData: { nodes: any, edges: any } = {nodes: null, edges: null};
private drugNodes: any[] = []; private drugNodes: any[] = [];
private drugEdges: any[] = []; private drugEdges: any[] = [];
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<span class="icon"> <span class="icon">
<i class="fas fa-search" aria-hidden="true"></i> <i class="fas fa-search" aria-hidden="true"></i>
</span> </span>
Query Protein/Gene Query Node
</p> </p>
<a <a
(click)="collapseQuery = !collapseQuery" (click)="collapseQuery = !collapseQuery"
......
...@@ -28,6 +28,7 @@ import {defaultConfig, EdgeGroup, IConfig, InteractionDatabase, NodeGroup} from ...@@ -28,6 +28,7 @@ import {defaultConfig, EdgeGroup, IConfig, InteractionDatabase, NodeGroup} from
import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service'; import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service';
import {removeDuplicateObjectsFromList} from '../../utils' import {removeDuplicateObjectsFromList} from '../../utils'
import * as merge from 'lodash/fp/merge'; import * as merge from 'lodash/fp/merge';
import { AnalysisPanelComponent } from 'src/app/components/analysis-panel/analysis-panel.component';
// import * as 'vis' from 'vis-network'; // import * as 'vis' from 'vis-network';
// import {DataSet} from 'vis-data'; // import {DataSet} from 'vis-data';
...@@ -180,6 +181,9 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -180,6 +181,9 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
@ViewChild('network', {static: false}) networkEl: ElementRef; @ViewChild('network', {static: false}) networkEl: ElementRef;
@ViewChild('networkWithLegend', {static: false}) networkWithLegendEl: ElementRef; @ViewChild('networkWithLegend', {static: false}) networkWithLegendEl: ElementRef;
@ViewChild(AnalysisPanelComponent, { static: false })
private analysisPanel: AnalysisPanelComponent;
constructor( constructor(
public omnipath: OmnipathControllerService, public omnipath: OmnipathControllerService,
public analysis: AnalysisService, public analysis: AnalysisService,
...@@ -315,8 +319,11 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -315,8 +319,11 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
} }
private zoomToNode(id: string) { private zoomToNode(id: string) {
// get network object, depending on whether analysis is open or not
const network = this.selectedAnalysisToken ? this.analysisPanel.network : this.networkInternal;
this.nodeData.nodes.getIds(); this.nodeData.nodes.getIds();
const coords = this.networkInternal.getPositions(id)[id]; const coords = network.getPositions(id)[id];
if (!coords) { if (!coords) {
return; return;
} }
...@@ -326,7 +333,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -326,7 +333,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
} else { } else {
zoomScale = 3.0; zoomScale = 3.0;
} }
this.networkInternal.moveTo({ network.moveTo({
position: {x: coords.x, y: coords.y}, position: {x: coords.x, y: coords.y},
scale: zoomScale, scale: zoomScale,
animation: true, animation: true,
...@@ -399,18 +406,15 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -399,18 +406,15 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.closeSummary(); this.closeSummary();
}); });
// // this might be not necessary, positions get saved right before reloding network
// this.networkInternal.on('stabilizationIterationsDone', () => {
// this.networkPositions = this.networkInternal.getPositions();
// });
// this.networkInternal.stabilize();
if (this.selectedWrapper) { if (this.selectedWrapper) {
this.zoomToNode(this.selectedWrapper.id); this.zoomToNode(this.selectedWrapper.id);
} }
this.currentViewNodes = this.nodeData.nodes;
this.currentViewEdges = this.nodeData.edges;
this.queryItems = []; this.queryItems = [];
this.fillQueryItems(this.proteins); this.fillQueryItems(this.currentViewNodes);
if (this.selectedWrapper) { if (this.selectedWrapper) {
this.networkInternal.selectNodes([this.selectedWrapper.id]); this.networkInternal.selectNodes([this.selectedWrapper.id]);
} }
...@@ -422,8 +426,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -422,8 +426,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.queryItems.push(getWrapperFromNode(protein)); this.queryItems.push(getWrapperFromNode(protein));
}); });
this.currentViewNodes = this.nodeData.nodes;
this.currentViewEdges = this.nodeData.edges;
this.currentViewProteins = this.proteins; this.currentViewProteins = this.proteins;
} }
...@@ -587,6 +590,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -587,6 +590,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.currentViewProteins = this.proteins; this.currentViewProteins = this.proteins;
this.currentViewSelectedTissue = this.selectedTissue; this.currentViewSelectedTissue = this.selectedTissue;
} }
this.fillQueryItems(this.currentViewNodes);
} }
gProfilerLink(): string { gProfilerLink(): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment