From f5e8bcc431411c689352ca8039ce41b08b17ab3c Mon Sep 17 00:00:00 2001
From: AndiMajore <andi.majore@googlemail.com>
Date: Tue, 26 Jul 2022 11:52:42 +0200
Subject: [PATCH] show only primary id in result table

---
 .../analysis-panel.component.html             |  1 +
 .../analysis-panel.component.ts               |  1 -
 .../prot-table/prot-table.component.html      | 30 +++++++++++++++----
 .../prot-table/prot-table.component.ts        |  3 +-
 4 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/src/app/components/analysis-panel/analysis-panel.component.html b/src/app/components/analysis-panel/analysis-panel.component.html
index 31cbbf76..8665b3f3 100644
--- a/src/app/components/analysis-panel/analysis-panel.component.html
+++ b/src/app/components/analysis-panel/analysis-panel.component.html
@@ -313,6 +313,7 @@
             [tableProteinScoreTooltip]="tableDrugScoreTooltip"
             [tableProteinSelection]="tableProteinSelection"
             [tableSelectedProteins]="tableSelectedProteins"
+            [identifier]="myConfig.identifier"
           ></app-prot-table>
           </div>
         </div>
diff --git a/src/app/components/analysis-panel/analysis-panel.component.ts b/src/app/components/analysis-panel/analysis-panel.component.ts
index 68f41188..ab7d8b8e 100644
--- a/src/app/components/analysis-panel/analysis-panel.component.ts
+++ b/src/app/components/analysis-panel/analysis-panel.component.ts
@@ -445,7 +445,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
     })
     for (const nodeId of Object.keys(details)) {
       const nodeDetails = details[nodeId]
-      console.log(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
diff --git a/src/app/components/analysis-panel/prot-table/prot-table.component.html b/src/app/components/analysis-panel/prot-table/prot-table.component.html
index df7b8b9a..895eeaa8 100644
--- a/src/app/components/analysis-panel/prot-table/prot-table.component.html
+++ b/src/app/components/analysis-panel/prot-table/prot-table.component.html
@@ -6,13 +6,21 @@
       <th class="checkbox-col">
         <p-tableHeaderCheckbox class="drgstn"></p-tableHeaderCheckbox>
       </th>
-      <th [pSortableColumn]="'uniprotAc'">
+      <th *ngIf="identifier === 'symbol'"  [pSortableColumn]="'symbol'">
+        Symbol
+        <p-sortIcon [field]="'symbol'"></p-sortIcon>
+      </th>
+      <th *ngIf="identifier === 'uniprot'" [pSortableColumn]="'uniprotAc'">
         UniProt Code
         <p-sortIcon [field]="'uniprotAc'"></p-sortIcon>
       </th>
-      <th [pSortableColumn]="'symbol'">
-        Symbol
-        <p-sortIcon [field]="'symbol'"></p-sortIcon>
+      <th *ngIf="identifier === 'entrez'"  [pSortableColumn]="'entrez'">
+        Entrez
+        <p-sortIcon [field]="'entrez'"></p-sortIcon>
+      </th>
+       <th *ngIf="identifier === 'ensg'"  [pSortableColumn]="'ensg'">
+        Ensembl GeneID
+        <p-sortIcon [field]="'ensg'"></p-sortIcon>
       </th>
       <th [pSortableColumn]="'proteinName'">
         Name
@@ -37,8 +45,18 @@
       <td>
         <p-tableCheckbox [value]="e" class="drgstn"></p-tableCheckbox>
       </td>
-      <td><a href="https://www.uniprot.org/uniprot/{{ e.uniprotAc }}" target="_blank">{{ e.uniprotAc }}</a></td>
-      <td>{{e.symbol}}</td>
+       <td *ngIf="identifier === 'symbol'" >
+        <a *ngFor="let symbol of e.symbol; index as i"  href="https://www.genecards.org/cgi-bin/carddisp.pl?gene={{symbol }}" target="_blank">{{ symbol +(i == e.symbol.length -1 ? "":", ")}}</a>
+      </td>
+      <td *ngIf="identifier === 'uniprot'" >
+        <a *ngFor="let uniprot of e.uniprotAc; index as i"  href="https://www.uniprot.org/uniprot/{{uniprot }}" target="_blank">{{ uniprot +(i == e.uniprotAc.length -1 ? "":", ")}}</a>
+      </td>
+       <td *ngIf="identifier === 'entrez'" >
+        <a *ngFor="let entrez of e.entrez; index as i"  href="https://www.ncbi.nlm.nih.gov/gene/{{entrez }}" target="_blank">{{ entrez +(i == e.entrez.length -1 ? "":", ")}}</a>
+      </td>
+      <td *ngIf="identifier === 'ensg'" >
+        <a *ngFor="let ensg of e.ensg; index as i"  href="https://www.ensembl.org/Homo_sapiens/Gene/Summary?g={{ensg }}" target="_blank">{{ ensg +(i == e.ensg.length -1 ? "":", ")}}</a>
+      </td>
       <td>{{e.proteinName}}</td>
       <td *ngIf="tableHasScores">{{e.score | number}}</td>
       <td>
diff --git a/src/app/components/analysis-panel/prot-table/prot-table.component.ts b/src/app/components/analysis-panel/prot-table/prot-table.component.ts
index 6db2eec6..2affc7ac 100644
--- a/src/app/components/analysis-panel/prot-table/prot-table.component.ts
+++ b/src/app/components/analysis-panel/prot-table/prot-table.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
+import {Component, Input, OnInit} from '@angular/core';
 import { faTimes, faCheck } from '@fortawesome/free-solid-svg-icons';
 import {faQuestionCircle} from '@fortawesome/free-regular-svg-icons';
 @Component({
@@ -12,6 +12,7 @@ export class ProtTableComponent implements OnInit {
   @Input() public tableProteinScoreTooltip = "";
   @Input() public tableProteins = []
   @Input() public tableSelectedProteins
+  @Input() public identifier = "symbol"
   @Input() public tableProteinSelection : (args: any) => void
   public faTimes = faTimes;
   public faCheck = faCheck;
-- 
GitLab