From 909a896d047c44783faa4bcaf9d7e2ba810f14e0 Mon Sep 17 00:00:00 2001 From: AndiMajore <andi.majore@googlemail.com> Date: Mon, 16 Jan 2023 21:35:35 +0100 Subject: [PATCH] fixed uniprot_ac issue by renaming to uniprot --- .../analysis-panel.component.ts | 28 +++++++++---------- .../prot-table/prot-table.component.html | 10 +++---- .../info-tile/info-tile.component.html | 8 +++--- .../query-tile/query-tile.component.ts | 6 ++-- src/app/interfaces.ts | 4 +-- .../explorer-page.component.html | 6 ++-- src/index.html | 17 +++++++---- 7 files changed, 42 insertions(+), 37 deletions(-) diff --git a/src/app/components/analysis-panel/analysis-panel.component.ts b/src/app/components/analysis-panel/analysis-panel.component.ts index 5ef84d3e..dad3e9f8 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.ts +++ b/src/app/components/analysis-panel/analysis-panel.component.ts @@ -10,8 +10,8 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { algorithmNames, AnalysisService } from '../../services/analysis/analysis.service'; +import {HttpClient} from '@angular/common/http'; +import {algorithmNames, AnalysisService} from '../../services/analysis/analysis.service'; import { Drug, NodeAttributeMap, @@ -24,13 +24,13 @@ import { Wrapper, NodeInteraction, } from '../../interfaces'; -import { NetworkSettings } from '../../network-settings'; -import { NetexControllerService } from 'src/app/services/netex-controller/netex-controller.service'; -import { mapCustomEdge } from 'src/app/main-network'; -import { DrugstoneConfigService } from 'src/app/services/drugstone-config/drugstone-config.service'; -import { NetworkHandlerService } from 'src/app/services/network-handler/network-handler.service'; -import { LegendService } from 'src/app/services/legend-service/legend-service.service'; -import { LoadingScreenService } from 'src/app/services/loading-screen/loading-screen.service'; +import {NetworkSettings} from '../../network-settings'; +import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service'; +import {mapCustomEdge} from 'src/app/main-network'; +import {DrugstoneConfigService} from 'src/app/services/drugstone-config/drugstone-config.service'; +import {NetworkHandlerService} from 'src/app/services/network-handler/network-handler.service'; +import {LegendService} from 'src/app/services/legend-service/legend-service.service'; +import {LoadingScreenService} from 'src/app/services/loading-screen/loading-screen.service'; declare var vis: any; @@ -51,7 +51,7 @@ interface Seeded { }) export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit { - @ViewChild('networkWithLegend', { static: false }) networkWithLegendEl: ElementRef; + @ViewChild('networkWithLegend', {static: false}) networkWithLegendEl: ElementRef; @Input() token: string | null = null; @@ -65,7 +65,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit public fullscreen = false; public network: any; - public nodeData: { nodes: any, edges: any } = { nodes: null, edges: null }; + public nodeData: { nodes: any, edges: any } = {nodes: null, edges: null}; // private drugNodes: any[] = []; // private drugEdges: any[] = []; public tab: 'meta' | 'network' | 'table' = 'table'; @@ -171,7 +171,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit this.networkHandler.activeNetwork.seedMap = nodeAttributes.isSeed || {}; // Reset - this.nodeData = { nodes: null, edges: null }; + this.nodeData = {nodes: null, edges: null}; this.networkHandler.activeNetwork.networkEl.nativeElement.innerHTML = ''; this.networkHandler.activeNetwork.networkInternal = null; // Create @@ -182,7 +182,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit const nodes = nw.nodes; const edges = nw.edges; - this.networkHandler.activeNetwork.inputNetwork = { nodes: nodes, edges: edges }; + this.networkHandler.activeNetwork.inputNetwork = {nodes: nodes, edges: edges}; this.nodeData.nodes = new vis.DataSet(nodes); this.nodeData.edges = new vis.DataSet(edges); const container = this.networkHandler.activeNetwork.networkEl.nativeElement; @@ -231,7 +231,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit if (this.tableHasScores) { this.toggleNormalization(true); } - this.networkHandler.activeNetwork.networkInternal.setData({ nodes: undefined, edge: undefined }); + this.networkHandler.activeNetwork.networkInternal.setData({nodes: undefined, edge: undefined}); setTimeout(() => { this.networkHandler.activeNetwork.networkInternal.setData(this.nodeData); }, 1000); 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 1517daff..7c117079 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 @@ -3,7 +3,7 @@ selectionMode="multiple" [value]="tableProteins" [selection]="tableSelectedProteins" - dataKey="uniprotAc" + dataKey="uniprot" (selectionChange)="tableProteinSelection($event)" styleClass="table is-hoverable is-narrow drgstn" > @@ -16,9 +16,9 @@ Symbol <p-sortIcon [field]="'symbol'"></p-sortIcon> </th> - <th *ngIf="identifier === 'uniprot'" [pSortableColumn]="'uniprotAc'"> + <th *ngIf="identifier === 'uniprot'" [pSortableColumn]="'uniprot'"> UniProt Code - <p-sortIcon [field]="'uniprotAc'"></p-sortIcon> + <p-sortIcon [field]="'uniprot'"></p-sortIcon> </th> <th *ngIf="identifier === 'entrez'" [pSortableColumn]="'entrez'"> Entrez @@ -68,10 +68,10 @@ </td> <td *ngIf="identifier === 'uniprot'"> <a - *ngFor="let uniprot of e.uniprotAc; index as i" + *ngFor="let uniprot of e.uniprot; index as i" href="https://www.uniprot.org/uniprot/{{ uniprot }}" target="_blank" - >{{ uniprot + (i == e.uniprotAc.length - 1 ? "" : ", ") }}</a + >{{ uniprot + (i == e.uniprot.length - 1 ? "" : ", ") }}</a > </td> <td *ngIf="identifier === 'entrez'"> diff --git a/src/app/components/info-tile/info-tile.component.html b/src/app/components/info-tile/info-tile.component.html index 6f23eb28..fa82534b 100644 --- a/src/app/components/info-tile/info-tile.component.html +++ b/src/app/components/info-tile/info-tile.component.html @@ -31,16 +31,16 @@ <p - *ngIf="wrapper.data.uniprotAc" + *ngIf="wrapper.data.uniprot" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }" > <b><span>Uniprot:</span></b> <a - *ngFor="let uniprotAc of wrapper.data.uniprotAc" - href="https://www.uniprot.org/uniprot/{{ uniprotAc }}" + *ngFor="let uniprot of wrapper.data.uniprot" + href="https://www.uniprot.org/uniprot/{{ uniprot }}" target="_blank" > - <span class="is-capitalized"> {{ uniprotAc }}</span> + <span class="is-capitalized"> {{ uniprot }}</span> </a> </p> <p diff --git a/src/app/components/query-tile/query-tile.component.ts b/src/app/components/query-tile/query-tile.component.ts index 70485c9f..694fec34 100644 --- a/src/app/components/query-tile/query-tile.component.ts +++ b/src/app/components/query-tile/query-tile.component.ts @@ -51,14 +51,14 @@ export class QueryTileComponent implements OnInit { if (data.proteinName === undefined) { data.proteinName = [] } - if (data.uniprotAc === undefined) { - data.uniprotAc = [] + if (data.uniprot === undefined) { + data.uniprot = [] } if (data.drugId === undefined) { data.drugId = '' } const query = term.toLowerCase(); - return this.entryInList(data.symbol, query) || this.entryInList(data.uniprotAc, query) || + return this.entryInList(data.symbol, query) || this.entryInList(data.uniprot, query) || data.label.toLowerCase().indexOf(term) > -1 || this.entryInList(data.ensg, query) || data.id.toLowerCase().indexOf(term) > -1 || this.entryInList(data.proteinName, query) || data.type.toLowerCase().indexOf(term) > -1 || data.groupName.toLowerCase().indexOf(term) > -1 || data.drugId.toLowerCase().indexOf(term) > -1; diff --git a/src/app/interfaces.ts b/src/app/interfaces.ts index e96d2597..a6a621fd 100644 --- a/src/app/interfaces.ts +++ b/src/app/interfaces.ts @@ -7,7 +7,7 @@ export interface Node { drugstoneId?: Array<string> | string; drugstoneType: NodeType; drugId?: string; - uniprotAc?: Array<string>; + uniprot?: Array<string>; ensg?: Array<string>; entrez?: Array<string>; group?: string; @@ -207,7 +207,7 @@ export interface Wrapper { _group?: string; groupName?: string; proteinName?: Array<string>; - uniprotAc?: Array<string>; + uniprot?: Array<string>; expressionLevel?: number; gradient?: number; x?: number; diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index b12426e2..ddd01a8a 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -43,7 +43,7 @@ <app-network-overview *ngIf="drugstoneConfig.config.showOverview"></app-network-overview> - + <div *ngIf="drugstoneConfig.config.showQuery" @@ -391,9 +391,9 @@ <td *ngIf="drugstoneConfig.currentConfig().identifier !== 'uniprot'" class="uniprot" - title="{{ p.data.uniprotAc }}" + title="{{ p.data.uniprot }}" > - <p>{{ p.data.uniprotAc }}</p> + <p>{{ p.data.uniprot }}</p> </td> <td style="text-align: center"> <button diff --git a/src/index.html b/src/index.html index afc9a9c6..daf75485 100644 --- a/src/index.html +++ b/src/index.html @@ -127,12 +127,17 @@ menu<br> <!--ENSEMBL test--> - <drugst-one id="netexp1" - pluginId="2" - groups='{"nodeGroups":{"node":{"type":"Gene","color":"#0000FF","font":{"color":"#ffffff"},"groupName":"Node","shape":"ellipse"}, "gene":{"type":"Gene","color":"#CD5C5C","font":{"color":"#000000"},"groupName":"Gene","shape":"ellipse"}}}' - config='{"showSimpleAnalysis": true, "selfReferences": false, "licensedDatasets": false,"physicsOn":false,"identifier":"ensembl","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}' - network='{"nodes":[{"id":"ENSG00000049768", "group": "gene", "label":"ENSG00000049768"},{"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 id="netexp1"--> +<!-- pluginId="2"--> +<!-- groups='{"nodeGroups":{"node":{"type":"Gene","color":"#0000FF","font":{"color":"#ffffff"},"groupName":"Node","shape":"ellipse"}, "gene":{"type":"Gene","color":"#CD5C5C","font":{"color":"#000000"},"groupName":"Gene","shape":"ellipse"}}}'--> +<!-- config='{"showSimpleAnalysis": true, "selfReferences": false, "licensedDatasets": false,"physicsOn":false,"identifier":"ensembl","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'--> +<!-- network='{"nodes":[{"id":"ENSG00000049768", "group": "gene", "label":"ENSG00000049768"},{"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>--> + <drugst-one id="netexp1" + pluginId="2" + groups='{"nodeGroups":{"node":{"type":"Gene","color":"#0000FF","font":{"color":"#ffffff"},"groupName":"Node","shape":"ellipse"}, "gene":{"type":"Gene","color":"#CD5C5C","font":{"color":"#000000"},"groupName":"Gene","shape":"ellipse"}}}' + config='{"showSimpleAnalysis": true, "selfReferences": false, "licensedDatasets": false,"physicsOn":false,"identifier":"uniprot","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}' + network='{"nodes":[{"id":"P01137", "group": "gene", "label":"P01137"},{"id":"Q13873","group":"gene","label":"Q13873"},{"id":"P37023","group":"gene","label":"P37023"},{"id":"J9PH39","group":"gene","label":"J9PH39"},{"id":"P51168","group":"gene","label":"P51168"},{"id":"P27037","group":"gene","label":"P27037"},{"id":"P17813","group":"gene","label":"P17813"}],"edges":[]}'> </drugst-one> </div> <br> -- GitLab