From 06c9b1b8988051936ad01c2fc6a80d58b74a0659 Mon Sep 17 00:00:00 2001
From: Maiykol <hartung.michael@outlook.com>
Date: Thu, 17 Jun 2021 11:05:37 +0200
Subject: [PATCH] user input for different PDI and PPI datasets

---
 src/app/config.ts                                        | 9 ++++++++-
 .../dialogs/launch-analysis/launch-analysis.component.ts | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/app/config.ts b/src/app/config.ts
index 82737376..9c07b45a 100644
--- a/src/app/config.ts
+++ b/src/app/config.ts
@@ -19,8 +19,11 @@ export interface EdgeGroup {
   color: string;
 }
 
-export type Identifier = 'hugo'|'uniprot';
+export type Identifier = 'hugo'|'uniprot'|'ensg';
+export type InteractionDrugProteinDB = 'DrugBank'|'Chembl'|'DGIdb';
+export type InteractionProteinProteinDB = 'STRING'|'BioGRID'|'APID';
 
+// TODO: should this be external or integrated in the backend?
 export type InteractionDatabase = 'omnipath';
 
 export interface IConfig {
@@ -43,6 +46,8 @@ export interface IConfig {
   showLegendEdges: boolean;
   nodeGroups: { [key: string]: NodeGroup };
   edgeGroups: { [key: string]: EdgeGroup };
+  interactionDrugProtein: InteractionDrugProteinDB;
+  interactionProteinProtein: InteractionProteinProteinDB;
   interactions?: InteractionDatabase;
   identifier?: Identifier;
 }
@@ -66,6 +71,8 @@ export const defaultConfig: IConfig = {
   showFooter: true,
   showLegend: true,
   identifier: 'hugo',
+  interactionDrugProtein: 'DrugBank',
+  interactionProteinProtein: 'STRING',
   nodeGroups: {
     default: {
       name: 'Default Group',
diff --git a/src/app/dialogs/launch-analysis/launch-analysis.component.ts b/src/app/dialogs/launch-analysis/launch-analysis.component.ts
index 9493b61e..154cae08 100644
--- a/src/app/dialogs/launch-analysis/launch-analysis.component.ts
+++ b/src/app/dialogs/launch-analysis/launch-analysis.component.ts
@@ -1,5 +1,4 @@
 import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
-import { NetexControllerService } from 'src/app/services/netex-controller/netex-controller.service';
 import {
   Algorithm,
   AlgorithmType,
@@ -10,7 +9,6 @@ import {
   QuickAlgorithmType,
   TRUSTRANK
 } from '../../services/analysis/analysis.service';
-import {Wrapper} from '../../interfaces';
 import { IConfig } from 'src/app/config';
 
 @Component({
@@ -110,6 +108,8 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
       input_network: this.inputNetwork
     };
 
+    parameters.ppi_dataset = this.config.interactionProteinProtein;
+    parameters.pdi_dataset = this.config.interactionDrugProtein;
     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
-- 
GitLab