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

create analysis tables directly from analysis results without additional server requests

parent 708e75d6
No related branches found
No related tags found
No related merge requests found
......@@ -187,28 +187,22 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
this.network = new vis.Network(container, this.nodeData, options);
const promises: Promise<any>[] = [];
promises.push(this.http.get<any>(`${environment.backend}task_result/?token=${this.token}&view=drugs`).toPromise()
.then((table) => {
this.tableDrugs = table;
this.tableDrugs.forEach((r) => {
r.rawScore = r.score;
});
}));
promises.push(this.http.get<any>(`${environment.backend}task_result/?token=${this.token}&view=proteins`).toPromise()
.then((table) => {
this.tableProteins = table;
this.tableSelectedProteins = [];
this.tableProteins.forEach((r) => {
r.rawScore = r.score;
r.isSeed = this.seedMap[r.id];
const wrapper = getWrapperFromNode(r);
if (this.analysis.inSelection(wrapper)) {
this.tableSelectedProteins.push(r);
}
});
}));
await Promise.all(promises);
this.tableDrugs = nodes.filter( e => e.netexId && e.netexId.startsWith('d'));;
this.tableDrugs.forEach((r) => {
r.rawScore = r.score;
});
this.tableProteins = nodes.filter( e => e.netexId && e.netexId.startsWith('p'));
this.tableSelectedProteins = [];
this.tableProteins.forEach((r) => {
r.rawScore = r.score;
r.isSeed = this.seedMap[r.id];
const wrapper = getWrapperFromNode(r);
if (this.analysis.inSelection(wrapper)) {
this.tableSelectedProteins.push(r);
}
});
this.tableHasScores = ['trustrank', 'closeness', 'degree', 'proximity', 'betweenness', 'quick', 'super']
.indexOf(this.task.info.algorithm) !== -1;
......@@ -496,6 +490,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
nodeDetails.group = nodeDetails.group ? nodeDetails.group : 'default';
nodeDetails.label = nodeDetails.label ? nodeDetails.label : nodeDetails[identifier]
}
console.log(nodeDetails)
// IMPORTANT we set seeds to "selected" and not to seeds. The user should be inspired to run
// further analysis and the button function can be used to highlight seeds
// option to use scores[node] as gradient, but sccores are very small
......@@ -626,6 +621,8 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
this.tableSelectedProteins = e;
const addItems = [];
const removeItems = [];
console.log(e)
for (const i of this.tableSelectedProteins) {
const wrapper = getWrapperFromNode(i);
if (oldSelection.indexOf(i) === -1) {
......
......@@ -365,7 +365,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.proteinData.linkNodes();
const {nodes, edges} = this.proteinData.mapDataToNetworkInput(this.myConfig);
console.log('first item nodes', nodes[0])
this.nodeData.nodes = new vis.DataSet(nodes);
this.nodeData.edges = new vis.DataSet(edges);
......
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