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

Merge branch 'master' of gitlab.lrz.de:netex/frontend

parents 19f904d2 50a25149
No related branches found
No related tags found
No related merge requests found
......@@ -196,8 +196,8 @@
"browserTarget": "netex:build:remote"
},
"production": {
"browserTarget": "netex:build:uhh-production"
},
"browserTarget": "netex:build:dock1-production"
}
}
},
"extract-i18n": {
......
......@@ -72,6 +72,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
}
@Output() tokenChange = new EventEmitter<string | null>();
@Output() showDetailsChange = new EventEmitter<Wrapper>();
@Output() setInputNetwork = new EventEmitter<any>();
@Output() visibleItems = new EventEmitter<[any[], [Node[], Tissue], NodeInteraction[]]>();
public task: Task | null = null;
public result: any = null;
......@@ -184,9 +185,9 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
// Create
const {nodes, edges} = this.createNetwork(this.result);
this.setInputNetwork.emit({nodes: nodes, edges: edges});
this.nodeData.nodes = new vis.DataSet(nodes);
this.nodeData.edges = new vis.DataSet(edges);
const container = this.networkEl.nativeElement;
const isBig = nodes.length > 100 || edges.length > 100;
const options = NetworkSettings.getOptions(isBig ? 'analysis-big' : 'analysis');
......@@ -194,7 +195,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
this.network = new vis.Network(container, this.nodeData, options);
this.tableDrugs = nodes.filter( e => e.netexId && e.netexId.startsWith('d'));;
this.tableDrugs = nodes.filter( e => e.netexId && e.netexId.startsWith('d'));
this.tableDrugs.forEach((r) => {
r.rawScore = r.score;
});
......@@ -361,6 +362,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
this.analysis.switchSelection('main');
this.token = null;
this.tokenChange.emit(this.token);
this.setInputNetwork.emit(undefined);
this.emitVisibleItems(false);
}
......
......@@ -120,9 +120,9 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
parameters.target = this.target === 'drug' ? 'drug' : 'drug-target';
// pass network data to reconstruct network in analysis result to connect non-proteins to results
// drop interactions in nodes beforehand to no cause cyclic error, information is contained in edges
this.inputNetwork.nodes.forEach(node => {
delete node.interactions
});
// this.inputNetwork.nodes.forEach(node => {
// delete node.interactions
// });
if (this.algorithm === 'trustrank') {
parameters.damping_factor = this.trustrankDampingFactor;
......
......@@ -7,7 +7,7 @@
[(show)]="showAnalysisDialog"
[target]="analysisDialogTarget"
[config]="myConfig"
[inputNetwork]="{ nodes: proteins, edges: edges }"
[inputNetwork]="inputNetwork"
(taskEvent)="emitTaskEvent($event)"
>
</app-launch-analysis>
......@@ -140,6 +140,7 @@
[(token)]="selectedAnalysisToken"
(showDetailsChange)="selectedWrapper = $event"
(visibleItems)="analysisWindowChanged($event)"
(setInputNetwork)="setInputNetwork($event)"
[config]="myConfig"
[smallStyle]="smallStyle"
></app-analysis-panel>
......
......@@ -174,6 +174,8 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
public selectedAnalysisToken: string | null = null;
@Input() inputNetwork = { };
@Input() set taskId(token: string | null) {
if (token == null || token.length === 0)
this.selectedAnalysisToken = null
......@@ -335,7 +337,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
});
// remove edges without endpoints
network.edges = edges;
this.inputNetwork = network;
this.proteins = network.nodes;
this.edges = network.edges;
}
......@@ -830,4 +832,11 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
return false;
return this.nodeData.nodes.get().filter((node: Node) => node.drugId && node.netexId.startsWith('dr')).length > 0;
}
setInputNetwork(network: any) {
if(network == null)
this.inputNetwork={nodes: this.proteins, edges : this.edges}
else
this.inputNetwork = network;
}
}
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