From ef0186dc9a86bdf68758a67657317c644e8e249c Mon Sep 17 00:00:00 2001
From: AndiMajore <andi.majore@googlemail.com>
Date: Thu, 21 Jul 2022 20:52:00 +0200
Subject: [PATCH] fixed result_view for task results

---
 .../analysis-panel.component.ts               | 62 +++++++++-----
 .../components/network/network.component.ts   | 84 ++++++++++++-------
 .../launch-analysis.component.ts              |  6 +-
 src/app/main-network.ts                       | 17 ++--
 .../explorer-page/explorer-page.component.ts  | 23 +++--
 src/app/services/analysis/analysis.service.ts |  5 +-
 .../netex-controller.service.ts               | 40 ---------
 src/index.html                                | 17 ++--
 8 files changed, 139 insertions(+), 115 deletions(-)

diff --git a/src/app/components/analysis-panel/analysis-panel.component.ts b/src/app/components/analysis-panel/analysis-panel.component.ts
index fa726730..b8b551a5 100644
--- a/src/app/components/analysis-panel/analysis-panel.component.ts
+++ b/src/app/components/analysis-panel/analysis-panel.component.ts
@@ -31,10 +31,10 @@ import domtoimage from 'dom-to-image';
 import {NetworkSettings} from '../../network-settings';
 import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service';
 import {defaultConfig, IConfig} from 'src/app/config';
-import { mapCustomEdge, mapCustomNode } from 'src/app/main-network';
-import { downLoadFile, pieChartContextRenderer, removeDuplicateObjectsFromList } from 'src/app/utils';
-import { DrugstoneConfigService } from 'src/app/services/drugstone-config/drugstone-config.service';
-import { NetworkHandlerService } from 'src/app/services/network-handler/network-handler.service';
+import {mapCustomEdge, mapCustomNode} from 'src/app/main-network';
+import {downLoadFile, pieChartContextRenderer, removeDuplicateObjectsFromList} from 'src/app/utils';
+import {DrugstoneConfigService} from 'src/app/services/drugstone-config/drugstone-config.service';
+import {NetworkHandlerService} from 'src/app/services/network-handler/network-handler.service';
 
 
 declare var vis: any;
@@ -62,6 +62,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
 
   @ViewChild('networkWithLegend', {static: false}) networkWithLegendEl: ElementRef;
   @Input() token: string | null = null;
+
   @Input()
   public set config(config: IConfig | undefined) {
     if (typeof config === 'undefined') {
@@ -71,6 +72,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
       this.myConfig[key] = config[key];
     }
   }
+
   @Output() tokenChange = new EventEmitter<string | null>();
   @Output() showDetailsChange = new EventEmitter<Wrapper>();
   @Output() setInputNetwork = new EventEmitter<any>();
@@ -175,6 +177,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
 
       if (this.task && this.task.info.done) {
         this.result = await this.netex.getTaskResult(this.token);
+        console.log(this.result)
         const nodeAttributes = this.result.nodeAttributes || {};
 
         this.networkHandler.activeNetwork.seedMap = nodeAttributes.isSeed || {};
@@ -187,6 +190,8 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
 
         // Create
         const {nodes, edges} = this.createNetwork(this.result);
+        console.log(nodes)
+        console.log(edges)
         this.setInputNetwork.emit({nodes: nodes, edges: edges});
         this.nodeData.nodes = new vis.DataSet(nodes);
         this.nodeData.edges = new vis.DataSet(edges);
@@ -197,12 +202,12 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
 
         this.networkHandler.activeNetwork.networkInternal = new vis.Network(container, this.nodeData, options);
 
-        this.tableDrugs = nodes.filter( e => e.drugstoneId && e.drugstoneId.drugstoneType === 'drug');
+        this.tableDrugs = nodes.filter(e => e.drugstoneId && e.drugstoneId.drugstoneType === 'drug');
         this.tableDrugs.forEach((r) => {
           r.rawScore = r.score;
         });
 
-        this.tableProteins = nodes.filter( e => e.drugstoneId && e.drugstoneType === 'protein');
+        this.tableProteins = nodes.filter(e => e.drugstoneId && e.drugstoneType === 'protein');
         this.tableSelectedProteins = [];
         this.tableProteins.forEach((r) => {
           r.rawScore = r.score;
@@ -280,7 +285,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
                 isSeed,
                 selected,
                 gradient
-                )
+              )
               updatedNodes.push(nodeStyled);
             }
             this.nodeData.nodes.update(updatedNodes);
@@ -312,7 +317,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
                 isSeed,
                 selected,
                 gradient
-                )
+              )
               updatedNodes.push(nodeStyled);
             });
             this.nodeData.nodes.update(updatedNodes);
@@ -414,7 +419,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
     // add drugGroup and foundNodesGroup for added nodes
     // these groups can be overwritten by the user
     const nodes = [];
-    const edges = [];
 
     const attributes = result.nodeAttributes || {};
 
@@ -422,21 +426,34 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
     this.effects = [];
     const network = result.network;
 
-    const nodeTypes = attributes.nodeTypes || {};
-    const isSeed = attributes.isSeed || {};
-    const scores = attributes.scores || {};
+    // const nodeTypes = attributes.nodeTypes || {};
+    // const isSeed = attributes.isSeed || {};
+    // const scores = attributes.scores || {};
     const details = attributes.details || {};
-
-    for (const node of network.nodes) {
-      // convert id to netex Id if exists
-      const nodeDetails = details[node];
-
-      nodeDetails.id = nodeDetails.id ? nodeDetails.id :  (typeof nodeDetails.drugstoneId === 'string' ? nodeDetails.drugstoneId : nodeDetails.drugstoneId[0]);
+    const nodeIdMap = {}
+    // const reverseNodeIdMap = {}
+    // @ts-ignore
+    Object.entries(details).filter(e => e[1].drugstoneType === 'protein').forEach(e => {
+      // let id =
+      // @ts-ignore
+      e[1].drugstoneId.forEach(id=>{
+         nodeIdMap[id] = e[1][identifier][0]
+      })
+
+      // if (!nodeIdMap[id])
+      //   nodeIdMap[id] = [e[0]]
+      // else
+      //   nodeIdMap[id].push(e[0])
+    })
+    for (const nodeId of Object.keys(details)) {
+      const nodeDetails = details[nodeId]
+      nodeDetails.id = nodeDetails.id ? nodeDetails.id : (typeof nodeDetails.drugstoneId === 'string' ? nodeDetails.drugstoneId : nodeDetails.drugstoneId[0]);
       if (nodeDetails.drugstoneId && nodeDetails.drugstoneType === 'protein') {
         // node is protein from database, has been mapped on init to backend protein from backend
         // or was found during analysis
         nodeDetails.group = nodeDetails.group ? nodeDetails.group : 'foundNode';
         nodeDetails.label = nodeDetails.label ? nodeDetails.label : nodeDetails[identifier];
+        nodeDetails.id = nodeDetails[identifier][0] ? nodeDetails[identifier][0] : nodeDetails.id;
         this.proteins.push(nodeDetails);
       } else if (nodeDetails.drugstoneId && nodeDetails.drugstoneType === 'drug') {
         // node is drug, was found during analysis
@@ -451,9 +468,16 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
       // option to use scores[node] as gradient, but sccores are very small
       nodes.push(NetworkSettings.getNodeStyle(nodeDetails as Node, config, false, false, 1))
     }
+
+    const edges = [];
+
     for (const edge of network.edges) {
-      edges.push(mapCustomEdge(edge, this.myConfig));
+      const e = mapCustomEdge(edge, this.myConfig)
+      e.from = e.from[0] === 'p' ? nodeIdMap[e.from] : e.from
+      e.to = e.to[0] === 'p' ? nodeIdMap[e.to] : e.to
+      edges.push(e);
     }
+    console.log(edges)
     return {
       nodes,
       edges,
diff --git a/src/app/components/network/network.component.ts b/src/app/components/network/network.component.ts
index 66638f71..da03306c 100644
--- a/src/app/components/network/network.component.ts
+++ b/src/app/components/network/network.component.ts
@@ -118,20 +118,20 @@ export class NetworkComponent implements OnInit {
         const addedEdge = {}
         for (const interaction of response.edges) {
           const edge = mapCustomEdge({from: interaction.protein, to: interaction.disorder}, this.drugstoneConfig.config)
-
-          if (edge.from[0] === 'p')
-            edge.from = proteinMap[edge.from]
-          if (edge.to[0] === 'p')
-            edge.to = proteinMap[edge.to]
-          if (addedEdge[edge.to] && addedEdge[edge.to].indexOf(edge.from) !== -1)
-            continue
-          if (addedEdge[edge.from] && addedEdge[edge.from].indexOf(edge.to) !== -1)
-            continue
-          if (!addedEdge[edge.to])
-            addedEdge[edge.to] = [edge.from]
-          else
-            addedEdge[edge.to].push(edge.from)
-          this.adjacentProteinDisorderEdgesList.push(edge);
+          if (proteinMap[edge.from]) {
+            proteinMap[edge.from].forEach(from => {
+              if (addedEdge[from] && addedEdge[from].indexOf(edge.to) !== -1)
+                return
+              const e = JSON.parse(JSON.stringify(edge))
+              e.from = from
+              e.to = edge.to
+              this.adjacentProteinDisorderEdgesList.push(e);
+              if (!addedEdge[from])
+                addedEdge[from] = [edge.to]
+              else
+                addedEdge[from].push(edge.to)
+            })
+          }
         }
         for (const disorder of response.disorders) {
           disorder.group = 'defaultDisorder';
@@ -186,7 +186,19 @@ export class NetworkComponent implements OnInit {
     this.nodeData.nodes.get().forEach(n => {
       if (n.drugstoneType === 'protein') {
         n.drugstoneId.forEach(id => {
-          proteinMap[id] = n.id;
+          if (typeof id === 'string') {
+            if (proteinMap[id])
+              proteinMap[id].push(n.id)
+            else
+              proteinMap[id] = [n.id];
+          } else {
+            n.id.forEach(single_id => {
+              if (proteinMap[single_id])
+                proteinMap[single_id].push(n.id)
+              else
+                proteinMap[single_id] = [n.id];
+            })
+          }
         });
       }
     });
@@ -196,17 +208,27 @@ export class NetworkComponent implements OnInit {
   public updateAdjacentDrugs(bool: boolean) {
     this.adjacentDrugs = bool;
     if (this.adjacentDrugs) {
+      const addedEdge = {}
       const proteinMap = this.getProteinMap()
       this.netex.adjacentDrugs(this.drugstoneConfig.config.interactionDrugProtein, this.drugstoneConfig.config.licencedDatasets, this.nodeData.nodes.get()).subscribe(response => {
         const existingDrugIDs = this.nodeData.nodes.get().filter(n => n.drugstoneId && n.drugstoneType === 'drug').map(n => n.drugstoneId);
         for (const interaction of response.pdis) {
-          let edge = mapCustomEdge({from: interaction.protein, to: interaction.drug}, this.drugstoneConfig.config)
-          if (edge.from[0] === 'p')
-            edge.from = proteinMap[edge.from]
-          if (edge.to[0] === 'p')
-            edge.to = proteinMap[edge.to]
-
-          this.adjacentDrugEdgesList.push(edge);
+          const edge = mapCustomEdge({from: interaction.protein, to: interaction.drug}, this.drugstoneConfig.config)
+
+          if (proteinMap[edge.from]) {
+            proteinMap[edge.from].forEach(from => {
+              if (addedEdge[from] && addedEdge[from].indexOf(edge.to) !== -1)
+                return
+              const e = JSON.parse(JSON.stringify(edge))
+              e.from = from
+              e.to = edge.to
+              this.adjacentDrugEdgesList.push(e);
+              if (!addedEdge[from])
+                addedEdge[from] = [edge.to]
+              else
+                addedEdge[from].push(edge.to)
+            })
+          }
         }
         for (const drug of response.drugs) {
           drug.group = 'foundDrug';
@@ -349,22 +371,26 @@ export class NetworkComponent implements OnInit {
           this.expressionMap = response;
           const updatedNodes = [];
           // mapping from netex IDs to network IDs, TODO check if this step is necessary
-          const networkIdMappping = {}
+          const networkIdMapping = {}
           this.nodeData.nodes.get().forEach(element => {
             if (element.drugstoneType === 'protein') {
               element.drugstoneId.forEach(id => {
-                networkIdMappping[id] = element.id;
+                if (networkIdMapping[id])
+                  networkIdMapping[id].push(element.id);
+                else
+                  networkIdMapping[id] = [element.id]
               });
             }
           });
           const maxExpr = Math.max(...Object.values(this.expressionMap));
           const exprMap = {}
           for (const [drugstoneId, expressionlvl] of Object.entries(this.expressionMap)) {
-            const networkId = networkIdMappping[drugstoneId]
-            if (!exprMap[networkId])
-              exprMap[networkId] = [expressionlvl]
-            else
-              exprMap[networkId].push(expressionlvl)
+            networkIdMapping[drugstoneId].forEach(networkId => {
+              if (!exprMap[networkId])
+                exprMap[networkId] = [expressionlvl]
+              else
+                exprMap[networkId].push(expressionlvl)
+            })
           }
           this.expressionMap = {}
           Object.keys(exprMap).forEach(networkId => {
diff --git a/src/app/dialogs/launch-analysis/launch-analysis.component.ts b/src/app/dialogs/launch-analysis/launch-analysis.component.ts
index 6a735f05..7d1474f8 100644
--- a/src/app/dialogs/launch-analysis/launch-analysis.component.ts
+++ b/src/app/dialogs/launch-analysis/launch-analysis.component.ts
@@ -105,10 +105,8 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
 
   public async startTask() {
     // all nodes in selection have drugstoneId, hence exist in the backend
-    const seeds = this.analysis.getSelection().map((item) => item.data.drugstoneId)
-    const seedsFiltered = seeds.filter(function (el) {
-      return el != null;
-    });
+    const seeds = this.analysis.getSelection().map((item) => item.data.drugstoneId).flatMap(l => l)
+    const seedsFiltered = seeds.filter(el => el != null);
     const parameters: any = {
       seeds: seedsFiltered,
       config: this.config,
diff --git a/src/app/main-network.ts b/src/app/main-network.ts
index 1917d22a..a403e4fe 100644
--- a/src/app/main-network.ts
+++ b/src/app/main-network.ts
@@ -126,9 +126,16 @@ export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any
  * @returns
  */
 export function mapNetexEdge(customEdge: NetexInteraction, config: IConfig, node_map: object): any {
-  const edge = JSON.parse(JSON.stringify(config.edgeGroups.default));
-  edge['from'] = node_map[customEdge['proteinA']];
-  edge['to'] = node_map[customEdge['proteinB']];
-  edge['dataset'] = customEdge['dataset'];
-  return edge;
+  const edges = []
+  node_map[customEdge['proteinA']].forEach(from => {
+    node_map[customEdge['proteinB']].forEach(to => {
+      const edge = JSON.parse(JSON.stringify(config.edgeGroups.default));
+      edge['from'] = from;
+      edge['to'] = to;
+      edge['dataset'] = customEdge['dataset'];
+      edges.push(edge)
+    })
+  })
+
+  return edges;
 }
diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts
index f3ea4ff9..2b52f4c1 100644
--- a/src/app/pages/explorer-page/explorer-page.component.ts
+++ b/src/app/pages/explorer-page/explorer-page.component.ts
@@ -256,16 +256,23 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
     let {nodes, edges} = this.proteinData.mapDataToNetworkInput(this.drugstoneConfig.config);
     if (this.drugstoneConfig.config.autofillEdges && nodes.length) {
       let node_map = {};
-      nodes.filter(n => n[this.drugstoneConfig.config.identifier]).forEach(node => {
-        if (typeof node.drugstoneId === 'string')
-          node_map[node.drugstoneId] = node.id;
-        else
+      nodes.filter(n => n.drugstoneType === 'protein').forEach(node => {
+        if (typeof node.drugstoneId === 'string') {
+          if (node_map[node.drugstoneId])
+            node_map[node.drugstoneId].push(node.id);
+          else
+            node_map[node.drugstoneId] = [node.id];
+        } else {
           node.drugstoneId.forEach(n => {
-            node_map[n] = node.id;
+            if (node_map[n])
+              node_map[n].push(node.id);
+            else
+              node_map[n] = [node.id];
           })
+        }
       })
       const netexEdges = await this.netex.fetchEdges(nodes, this.drugstoneConfig.config.interactionProteinProtein, this.drugstoneConfig.config.licencedDatasets);
-      edges.push(...netexEdges.map(netexEdge => mapNetexEdge(netexEdge, this.drugstoneConfig.config, node_map)));
+      edges.push(...netexEdges.map(netexEdge => mapNetexEdge(netexEdge, this.drugstoneConfig.config, node_map)).flatMap(e => e));
     }
 
     const edge_map = {}
@@ -273,9 +280,9 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
     edges = edges.filter(edge => {
       if (edge_map[edge.to] && edge_map[edge.to].indexOf(edge.from) !== -1)
         return false
-      if (edge_map[edge.from] && edge_map[edge.from].indexOf(edge.to) !==-1)
+      if (edge_map[edge.from] && edge_map[edge.from].indexOf(edge.to) !== -1)
         return false
-      if(!edge_map[edge.from])
+      if (!edge_map[edge.from])
         edge_map[edge.from] = [edge.to]
       else
         edge_map[edge.from].push(edge.to)
diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts
index 8bd2fc31..14c7938e 100644
--- a/src/app/services/analysis/analysis.service.ts
+++ b/src/app/services/analysis/analysis.service.ts
@@ -67,6 +67,8 @@ export class AnalysisService {
 
   private launchingQuick = false;
 
+  private initialTasksLoaded = false
+
   private tissues: Tissue[] = [];
 
   constructor(private http: HttpClient, public netex: NetexControllerService) {
@@ -312,7 +314,8 @@ export class AnalysisService {
     const watch = async () => {
       const finished = JSON.parse(localStorage.getItem(this.tokensFinishedCookieKey));
       const unfinished = this.tokens.filter(t => finished.indexOf(t) === -1);
-      if (unfinished.length > 0) {
+      if (unfinished.length > 0 || ! this.initialTasksLoaded) {
+        this.initialTasksLoaded = true;
         const newtasks = await this.getTasks();
         if (newtasks.length === 0)
           return;
diff --git a/src/app/services/netex-controller/netex-controller.service.ts b/src/app/services/netex-controller/netex-controller.service.ts
index ffaae7af..75682490 100644
--- a/src/app/services/netex-controller/netex-controller.service.ts
+++ b/src/app/services/netex-controller/netex-controller.service.ts
@@ -14,13 +14,6 @@ export class NetexControllerService {
   constructor(private http: HttpClient) {
   }
 
-  // public async getTask(token): Promise<any> {
-  //   /**
-  //    * returns promise of task status
-  //    */
-  //   return this.http.get(`${environment.backend}task/?tokens=${token}`).toPromise();
-  // }
-
   public async getTasks(tokens): Promise<any> {
     /**
      * returns promise of tasks status
@@ -35,39 +28,6 @@ export class NetexControllerService {
     return this.http.get<any>(`${environment.backend}task_result/?token=${token}`).toPromise();
   }
 
-  // public async getTaskResultDrug(token): Promise<any> {
-  //   /**
-  //    * returns promise of drug view of task result of COMPLETED task
-  //    */
-  //   return this.http.get<any>(`${environment.backend}task_result/?token=${token}&view=drugs`).toPromise();
-  // }
-
-  // public async getTaskResultGene(token): Promise<any> {
-  //   /**
-  //    * returns promise of gene view of task result of COMPLETED task
-  //    */
-  //   return this.http.get<any>(`${environment.backend}task_result/?token=${token}&view=genes`).toPromise();
-  // }
-
-  // public async getTaskResultCancerNode(token): Promise<any> {
-  //   /**
-  //    * returns promise of cancer driver gene view of task result of COMPLETED task
-  //    */
-  //   return this.http.get<any>(`${environment.backend}task_result/?token=${token}&view=cancer_driver_genes`).toPromise();
-  // }
-
-  // public async postTask(algorithm: QuickAlgorithmType | AlgorithmType, target, parameters,) {
-  //   /**
-  //    * sends a task to task service
-  //    */
-  //
-  //   return this.http.post<any>(`${environment.backend}task/`, {
-  //     algorithm,
-  //     target,
-  //     parameters,
-  //   }).toPromise();
-  // }
-
   public async mapNodes(nodes, identifier): Promise<any> {
     /**
      * Tries to map every node to a node object in out database
diff --git a/src/index.html b/src/index.html
index 07791506..28222a51 100644
--- a/src/index.html
+++ b/src/index.html
@@ -92,17 +92,16 @@
 
   <drugst-one id="netexp1"
                     pluginId="2"
-                    config='{"licencedDatasets": false, "interactionDrugProtein":"NeDRex", "physicsOn":true, "showLeftSidebar": true, "showSimpleAnalysis":true, "nodeGroups":{"patient":{"type":"patient","color":"black","font":{"color":"#ffffff"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png"},"condition":{"type":"condition","color":"black","font":{"color":"black"},"groupName":"Condition","shape":"text"},"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#ffffff"},"groupName":"Gene","shape":"circle"},"foundDrug":{"type":"drug","color":{"border":"#F12590","background":"#F12590"},"font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"genotype":{"color":"black","groupName":"Relevant Gene"},"has-condition":{"color":"#ffffff","groupName":"Has Condition","dashes":[2,2]},"default":{"color":"#000000","groupName":"default edge"},"ggi":{"color":"#000000","groupName":"Interaction","dashes":[3,2]}},"identifier":"symbol","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'
-                    network='{"nodes":[{"id":"patient-1","group":"patient","x":592,"y":446},{"id":"patient-2","group":"patient","x":235,"y":87},{"id":"patient-3","group":"patient","x":105,"y":369},{"id":"ATM","label":"ATM","group":"gene","x":289,"y":242},{"id":"BARD1","label":"BARD1","group":"gene","x":44,"y":250},{"id":"BRCA1","label":"BRCA1","group":"gene","x":466,"y":576},{"id":"BRCA2","label":"BRCA2","group":"gene","x":507,"y":285},{"id":"BRIP1","label":"BRIP1","group":"gene","x":54,"y":474},{"id":"CHEK2","label":"CHEK2","group":"gene","x":216,"y":590},{"id":"CDH1","label":"CDH1","group":"gene","x":320,"y":-57},{"id":"NF1","label":"NF1","group":"gene","x":481,"y":111},{"id":"NBN","label":"NBN","group":"gene","x":-57,"y":314},{"id":"PALB2","label":"PALB2","group":"gene","x":450,"y":190},{"id":"PTEN","label":"PTEN","group":"important","x":305,"y":494},{"id":"RAD51C","label":"RAD51C","group":"gene","x":182,"y":-90},{"id":"RAD51D","label":"RAD51D","group":"gene","x":368,"y":73},{"id":"STK11","label":"STK11","group":"gene","x":686,"y":330},{"id":"TP53","label":"TP53","group":"important","x":333,"y":316},{"id":"subtype-1","label":"Subtype 1","group":"condition","x":556,"y":171},{"id":"subtype-2","label":"Subtype 2","group":"condition","x":-87,"y":221}],"edges":[{"from":"patient-1","to":"BRCA1","group":"genotype"},{"from":"patient-1","to":"TP53","group":"genotype"},{"from":"patient-1","to":"BRCA2","group":"genotype"},{"from":"patient-1","to":"PTEN","group":"genotype"},{"from":"patient-2","to":"TP53","group":"genotype"},{"from":"patient-2","to":"NF1","group":"genotype"},{"from":"patient-2","to":"BARD1","group":"genotype"},{"from":"patient-3","to":"TP53","group":"genotype"},{"from":"patient-3","to":"PTEN","group":"genotype"},{"from":"patient-3","to":"NBN","group":"genotype"},{"from":"patient-1","to":"subtype-1","group":"has-condition"},{"from":"patient-2","to":"subtype-1","group":"has-condition"},{"from":"patient-3","to":"subtype-2","group":"has-condition"}]}'>
+                    config='{"identifier":"symbol","licencedDatasets": false, "interactionDrugProtein":"NeDRex", "physicsOn":true, "showLeftSidebar": true, "showSimpleAnalysis":true, "nodeGroups":{"patient":{"type":"patient","color":"black","font":{"color":"#ffffff"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png"},"condition":{"type":"condition","color":"black","font":{"color":"black"},"groupName":"Condition","shape":"text"},"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#ffffff"},"groupName":"Gene","shape":"circle"},"foundDrug":{"type":"drug","color":{"border":"#F12590","background":"#F12590"},"font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"genotype":{"color":"black","groupName":"Relevant Gene"},"has-condition":{"color":"#ffffff","groupName":"Has Condition","dashes":[2,2]},"default":{"color":"#000000","groupName":"default edge"},"ggi":{"color":"#000000","groupName":"Interaction","dashes":[3,2]}},"title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'
+                    network='{"nodes":[{"id":"ATM","label":"ATM","group":"gene","x":289,"y":242},{"id":"BARD1","label":"BARD1","group":"gene","x":44,"y":250},{"id":"BRCA1","label":"BRCA1","group":"gene","x":466,"y":576},{"id":"BRCA2","label":"BRCA2","group":"gene","x":507,"y":285},{"id":"BRIP1","label":"BRIP1","group":"gene","x":54,"y":474},{"id":"CHEK2","label":"CHEK2","group":"gene","x":216,"y":590},{"id":"CDH1","label":"CDH1","group":"gene","x":320,"y":-57},{"id":"NF1","label":"NF1","group":"gene","x":481,"y":111},{"id":"NBN","label":"NBN","group":"gene","x":-57,"y":314},{"id":"PALB2","label":"PALB2","group":"gene","x":450,"y":190},{"id":"PTEN","label":"PTEN","group":"important","x":305,"y":494},{"id":"RAD51C","label":"RAD51C","group":"gene","x":182,"y":-90},{"id":"RAD51D","label":"RAD51D","group":"gene","x":368,"y":73},{"id":"STK11","label":"STK11","group":"gene","x":686,"y":330},{"id":"TP53","label":"TP53","group":"important","x":333,"y":316}],"edges":[]}'>
   </drugst-one>
-</div>
-
-<!--<div >-->
-
-<!--  <network-expander id="netexp2"-->
+<!--  ENSEMBL test-->
+<!--    <drugst-one id="netexp1"-->
 <!--                    pluginId="2"-->
-<!--                    config='{}' network='{"nodes":[], "edges":[]}'></network-expander>-->
-<!--</div>-->
+<!--                    config='{"identifier":"ensg","licencedDatasets": false, "interactionDrugProtein":"NeDRex", "physicsOn":true, "showLeftSidebar": true, "showSimpleAnalysis":true, "nodeGroups":{"patient":{"type":"patient","color":"black","font":{"color":"#ffffff"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png"},"condition":{"type":"condition","color":"black","font":{"color":"black"},"groupName":"Condition","shape":"text"},"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#ffffff"},"groupName":"Gene","shape":"circle"},"foundDrug":{"type":"drug","color":{"border":"#F12590","background":"#F12590"},"font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"genotype":{"color":"black","groupName":"Relevant Gene"},"has-condition":{"color":"#ffffff","groupName":"Has Condition","dashes":[2,2]},"default":{"color":"#000000","groupName":"default edge"},"ggi":{"color":"#000000","groupName":"Interaction","dashes":[3,2]}},"title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'-->
+<!--                    network='{"nodes":[{"id":"ENSG00000185379","group":"gene","label":"ENSG00000185379"},{"id":"ENSG00000108384","group":"gene","label":"ENSG00000108384"},{"id":"ENSG00000138376","group":"gene","label":"ENSG00000138376"},{"id":"ENSG00000284792","group":"gene","label":"ENSG00000284792"},{"id":"ENSG00000171862","group":"gene","label":"ENSG00000171862"},{"id":"ENSG00000141510","group":"gene","label":"ENSG00000141510"}],"edges":[]}'>-->
+<!--  </drugst-one>-->
+</div>
 
 <br>
 <br>
-- 
GitLab