diff --git a/src/app/analysis.service.ts b/src/app/analysis.service.ts index a1a2b97dbe0328636e028324ddd19cf155aefd6c..780307fdced4f8c610a95acc253f7656aa13922c 100644 --- a/src/app/analysis.service.ts +++ b/src/app/analysis.service.ts @@ -1,4 +1,4 @@ -import {Wrapper, Task, getWrapperFromProtein, getWrapperFromViralProtein, Protein, ViralProtein, Dataset, Tissue} from './interfaces'; +import {Wrapper, Task, getWrapperFromProtein, Protein, Dataset, Tissue} from './interfaces'; import {Subject} from 'rxjs'; import {HttpClient} from '@angular/common/http'; import {environment} from '../environments/environment'; @@ -203,21 +203,6 @@ export class AnalysisService { return items.length; } - public addVisibleViralProteins(nodes, viralProteins: ViralProtein[]): number { - const items: Wrapper[] = []; - const visibleIds = new Set<string>(nodes.getIds()); - for (const viralProtein of viralProteins) { - const wrapper = getWrapperFromViralProtein(viralProtein); - const found = visibleIds.has(wrapper.nodeId); - if (found && !this.inSelection(wrapper)) { - items.push(wrapper); - this.selectedItems.set(wrapper.nodeId, wrapper); - } - } - this.selectListSubject.next({items, selected: true}); - return items.length; - } - public removeAllHostProteins() { const items: Wrapper[] = Array.from(this.selectedItems.values()).filter(p => p.type === 'host'); for (const wrapper of items) { @@ -251,10 +236,6 @@ export class AnalysisService { return this.inSelection(getWrapperFromProtein(protein)); } - viralProteinInSelection(viralProtein: ViralProtein): boolean { - return this.inSelection(getWrapperFromViralProtein(viralProtein)); - } - getSelection(): Wrapper[] { return Array.from(this.selectedItems.values()); } diff --git a/src/app/components/analysis-panel/analysis-panel.component.html b/src/app/components/analysis-panel/analysis-panel.component.html index 81afb3e1bb484ee3ac9f57fcf76bb4d4806ebdb1..e5dd42fb96387cfe095cf42914a9da1c97105367 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.html +++ b/src/app/components/analysis-panel/analysis-panel.component.html @@ -416,63 +416,6 @@ </tr> </ng-template> </p-table> - - <div *ngIf="tableViralProteins.length > 0" class="table-header"> - <h4 class="is-4"> - <span class="icon"><i class="fa fa-virus"></i></span> - <span>Viral Proteins</span> - </h4> - <a [href]="downloadLink('viral_proteins')" class="button is-primary is-outlined is-pulled-right is-small"> - <span class="icon"><i class="fa fa-download"></i></span> - <span>Download</span> - </a> - </div> - <p-table *ngIf="tableViralProteins.length > 0" selectionMode="multiple" - [value]="tableViralProteins" [selection]="tableSelectedViralProteins" dataKey="effectId" - (selectionChange)="tableViralProteinSelection($event)"> - <ng-template pTemplate="header"> - <tr> - <th class="checkbox-col"> - <p-tableHeaderCheckbox></p-tableHeaderCheckbox> - </th> - <th [pSortableColumn]="'effectName'"> - Name - <p-sortIcon [field]="'effectName'"></p-sortIcon> - </th> - <th [pSortableColumn]="'virusName'"> - Virus Strain - <p-sortIcon [field]="'virusName'"></p-sortIcon> - </th> - <th *ngIf="tableHasScores" [pSortableColumn]="'score'"> - Score - <p-sortIcon [field]="'score'"></p-sortIcon> - </th> - <th [pSortableColumn]="'isSeed'"> - Seed - <p-sortIcon [field]="'isSeed'"></p-sortIcon> - </th> - </tr> - </ng-template> - <ng-template pTemplate="body" let-e> - <tr> - <td> - <p-tableCheckbox [value]="e"></p-tableCheckbox> - </td> - <td>{{e.effectName}}</td> - <td>{{e.virusName}}</td> - <td *ngIf="tableHasScores">{{e.score | number}}</td> - <td> - <span *ngIf="e.isSeed"> - <i class="fa fa-asterisk has-text-primary"></i> - Seed - </span> - <span *ngIf="!e.isSeed"> - <i class="fa fa-times"></i> - </span> - </td> - </tr> - </ng-template> - </p-table> </div> </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 34df030f21fc11ddbcc2020c670db34091738c76..db25357172167037310a3b4d0ce5255ec855e1a5 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.ts +++ b/src/app/components/analysis-panel/analysis-panel.component.ts @@ -15,16 +15,13 @@ import {AnalysisService, algorithmNames} from '../../analysis.service'; import { Protein, Task, - ViralProtein, Drug, Wrapper, WrapperType, getWrapperFromProtein, getWrapperFromDrug, - getWrapperFromViralProtein, getNodeIdsFromPDI, getNodeIdsFromPPI, - getViralProteinNodeId, getProteinNodeId, Tissue } from '../../interfaces'; import html2canvas from 'html2canvas'; @@ -60,7 +57,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { @Output() tokenChange = new EventEmitter<string | null>(); @Output() showDetailsChange = new EventEmitter<Wrapper>(); - @Output() visibleItems = new EventEmitter<[any[], [Protein[], ViralProtein[], Tissue]]>(); + @Output() visibleItems = new EventEmitter<[any[], [Protein[], Tissue]]>(); public task: Task | null = null; @@ -78,8 +75,8 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { public tableDrugs: Array<Drug & Scored & Baited> = []; public tableProteins: Array<Protein & Scored & Seeded & Baited> = []; public tableSelectedProteins: Array<Protein & Scored & Seeded & Baited> = []; - public tableViralProteins: Array<ViralProtein & Scored & Seeded> = []; - public tableSelectedViralProteins: Array<ViralProtein & Scored & Seeded> = []; + public tableViralProteins: Array<Scored & Seeded> = []; + public tableSelectedViralProteins: Array<Scored & Seeded> = []; public tableNormalize = false; public tableHasScores = false; @@ -181,14 +178,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { } }); })); - promises.push(this.http.get<any>(`${environment.backend}task_result/?token=${this.token}&view=viral_proteins`).toPromise() - .then((table) => { - this.tableViralProteins = table; - this.tableViralProteins.forEach((r) => { - r.rawScore = r.score; - r.isSeed = isSeed[r.effectId]; - }); - })); await Promise.all(promises); this.tableHasScores = ['trustrank', 'closeness', 'degree', 'proximity', 'betweenness', 'quick', 'super'] @@ -276,16 +265,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { if (!selected && found !== -1 && tableItem) { proteinSelection.splice(found, 1); } - } else if (item.type === 'virus') { - // TODO: Refactor! - const found = viralProteinSelection.findIndex((i) => getViralProteinNodeId(i) === item.nodeId); - const tableItem = this.tableViralProteins.find((i) => getViralProteinNodeId(i) === item.nodeId); - if (selected && found === -1 && tableItem) { - viralProteinSelection.push(tableItem); - } - if (!selected && found !== -1 && tableItem) { - viralProteinSelection.splice(found, 1); - } } } this.tableSelectedProteins = [...proteinSelection]; @@ -319,11 +298,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { if (tableItem) { proteinSelection.push(tableItem); } - } else if (item.type === 'virus') { - const tableItem = this.tableViralProteins.find((i) => getViralProteinNodeId(i) === item.nodeId); - if (tableItem) { - viralProteinSelection.push(tableItem); - } } } this.tableSelectedProteins = [...proteinSelection]; @@ -337,7 +311,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { public emitVisibleItems(on: boolean) { if (on) { - this.visibleItems.emit([this.nodeData.nodes, [this.proteins, this.effects, this.selectedTissue]]); + this.visibleItems.emit([this.nodeData.nodes, [this.proteins, this.selectedTissue]]); } else { this.visibleItems.emit(null); } @@ -422,9 +396,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { if (nodeTypes[node] === 'host') { this.proteins.push(details[node]); wrappers[node] = getWrapperFromProtein(details[node]); - } else if (nodeTypes[node] === 'virus') { - this.effects.push(details[node]); - wrappers[node] = getWrapperFromViralProtein(details[node]); } else if (nodeTypes[node] === 'drug') { wrappers[node] = getWrapperFromDrug(details[node]); } @@ -441,7 +412,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { }; } - private mapNode(nodeType: WrapperType, details: Protein | ViralProtein | Drug, isSeed?: boolean, score?: number): any { + private mapNode(nodeType: WrapperType, details: Protein | Drug, isSeed?: boolean, score?: number): any { let nodeLabel; let wrapper: Wrapper; let drugType; @@ -463,10 +434,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { } else { nodeLabel = drug.drugId; } - } else if (nodeType === 'virus') { - const viralProtein = details as ViralProtein; - wrapper = getWrapperFromViralProtein(viralProtein); - nodeLabel = viralProtein.effectName; } const node = NetworkSettings.getNodeStyle(nodeType, isSeed, this.analysis.inSelection(wrapper), drugType, drugInTrial); @@ -599,27 +566,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { this.analysis.removeItems(removeItems); } - public tableViralProteinSelection(e) { - const oldSelection = [...this.tableSelectedViralProteins]; - this.tableSelectedViralProteins = e; - const addItems = []; - const removeItems = []; - for (const i of this.tableSelectedViralProteins) { - const wrapper = getWrapperFromViralProtein(i); - if (oldSelection.indexOf(i) === -1) { - addItems.push(wrapper); - } - } - for (const i of oldSelection) { - const wrapper = getWrapperFromViralProtein(i); - if (this.tableSelectedViralProteins.indexOf(i) === -1) { - removeItems.push(wrapper); - } - } - this.analysis.addItems(addItems); - this.analysis.removeItems(removeItems); - } - public previewStringArray(arr: string[], count: number): string { if (arr.length < count) { return arr.join(', '); diff --git a/src/app/components/query-tile/query-tile.component.ts b/src/app/components/query-tile/query-tile.component.ts index 62f952f34ba3046a2290c91975575a63627b5480..63997a24984901c9a0c6757117be5c612be0996d 100644 --- a/src/app/components/query-tile/query-tile.component.ts +++ b/src/app/components/query-tile/query-tile.component.ts @@ -1,5 +1,5 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; -import {Protein, Wrapper, ViralProtein} from '../../interfaces'; +import {Protein, Wrapper} from '../../interfaces'; @Component({ selector: 'app-query-tile-component', diff --git a/src/app/interfaces.ts b/src/app/interfaces.ts index bcd16bfa72345c336977a9d0a8359b81d21b3803..3e5bcc41c8cf6792d983f324d79456e72fb995f2 100644 --- a/src/app/interfaces.ts +++ b/src/app/interfaces.ts @@ -4,7 +4,7 @@ export interface Protein { name: string; proteinAc: string; proteinName: string; - effects?: ViralProtein[]; + interactions?: Protein[]; x?: number; y?: number; expressionLevel?: number; @@ -15,21 +15,9 @@ export interface Tissue { name: string; } -export interface ViralProtein { - effectId: string; - effectName: string; - virusName: string; - datasetName: string; - proteins?: Protein[]; - x?: number; - y?: number; -} - -export interface ProteinViralInteraction { - effectName: string; - virusName: string; - datasetName: string; - proteinAc: string; +export interface ProteinProteinInteraction { + from: string; + to: string; } export interface NetworkEdge { @@ -71,14 +59,10 @@ export function getProteinBackendId(protein: Protein) { return protein.proteinAc; } -export function getViralProteinNodeId(viralProtein: ViralProtein) { - return `v_${viralProtein.effectName}_${viralProtein.virusName}`; -} - -export function getNodeIdsFromPVI(pvi: ProteinViralInteraction) { +export function getNodeIdsFromI(pvi: ProteinProteinInteraction) { return { - from: `p_${pvi.proteinAc}`, - to: `v_${pvi.effectName}_${pvi.virusName}`, + from: `p_${pvi.from}`, + to: `p_${pvi.to}`, }; } @@ -96,10 +80,6 @@ export function getNodeIdsFromPDI(edge: NetworkEdge) { }; } -export function getViralProteinBackendId(viralProtein: ViralProtein) { - return viralProtein.effectId; -} - export function getDrugNodeId(drug: Drug) { return `d_${drug.drugId}`; } @@ -117,15 +97,6 @@ export function getWrapperFromProtein(protein: Protein): Wrapper { }; } -export function getWrapperFromViralProtein(viralProtein: ViralProtein): Wrapper { - return { - backendId: getViralProteinBackendId(viralProtein), - nodeId: getViralProteinNodeId(viralProtein), - type: 'virus', - data: viralProtein, - }; -} - export function getWrapperFromDrug(drug: Drug): Wrapper { return { backendId: getDrugBackendId(drug), diff --git a/src/app/main-network.ts b/src/app/main-network.ts index 76acc1f64ba083e928eab5caff8e6f5b82c5e2de..2217f357dedd41e734e5ab41af434aa4d2a55298 100644 --- a/src/app/main-network.ts +++ b/src/app/main-network.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {ProteinViralInteraction, ViralProtein, Protein, getProteinNodeId, getViralProteinNodeId} from './interfaces'; +import {ProteinProteinInteraction, Protein, getProteinNodeId} from './interfaces'; export function getDatasetFilename(dataset: Array<[string, string]>): string { return `network-${JSON.stringify(dataset).replace(/[\[\]\",]/g, '')}.json`; @@ -7,7 +7,7 @@ export function getDatasetFilename(dataset: Array<[string, string]>): string { export class ProteinNetwork { - constructor(public proteins: Protein[], public effects: ViralProtein[], public edges: ProteinViralInteraction[]) { + constructor(public proteins: Protein[], public edges: ProteinProteinInteraction[]) { } public async loadPositions(http: HttpClient, dataset: Array<[string, string]>) { @@ -19,36 +19,22 @@ export class ProteinNetwork { node.y = nodePosition.y; } }); - this.effects.forEach((node) => { - const nodePosition = nodePositions[getViralProteinNodeId(node)]; - if (nodePosition) { - node.x = nodePosition.x; - node.y = nodePosition.y; - } - }); } public getProtein(ac: string): Protein | undefined { return this.proteins.find((p) => p.proteinAc === ac); } - public getEffect(name: string, virus: string, dataset: string): ViralProtein | undefined { - return this.effects.find((eff) => eff.effectName === name && eff.virusName === virus && eff.datasetName === dataset); - } - public linkNodes() { this.proteins.forEach((pg) => { - pg.effects = []; - }); - this.effects.forEach((eff) => { - eff.proteins = []; + pg.interactions = []; }); this.edges.forEach((edge) => { - const proteinGroup = this.getProtein(edge.proteinAc); - const effect = this.getEffect(edge.effectName, edge.virusName, edge.datasetName); - if (proteinGroup && effect) { - proteinGroup.effects.push(effect); - effect.proteins.push(proteinGroup); + const protein1 = this.getProtein(edge.from); + const protein2 = this.getProtein(edge.to); + if (protein1 && protein2) { + protein1.interactions.push(protein2); + protein2.interactions.push(protein1); } }); } diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index 659a682fde6fbd92400da1764e5672c3d2a1a2dd..7dd2fdc8f8cbe4f4a1f42fc5174869b481d2af97 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -88,44 +88,6 @@ </div> </div> </div> - - <div *ngIf="myConfig.showFilter" class="card bar-large"> - <header class="card-header"> - <p class="card-header-title"> - <span class="icon"> - <i class="fas fa-filter" aria-hidden="true"></i> - </span> Filter Proteins - </p> - <a (click)="collapseBaitFilter = !collapseBaitFilter" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> - <span class="icon"> - <i *ngIf="collapseBaitFilter" class="fas fa-angle-down" aria-hidden="true"></i> - <i *ngIf="!collapseBaitFilter" class="fas fa-angle-left" aria-hidden="true"></i> - </span> - </a> - </header> - <div *ngIf="collapseBaitFilter"> - <div class="card-content overflow"> - <div *ngFor="let bait of viralProteinCheckboxes"> - <label class="checkbox"> - <input type="checkbox" class="checkbox" [ngModel]="bait.checked" - (ngModelChange)="bait.checked = $event; filterNodes()"> - {{ bait.data["effectName"] }} - </label> - </div> - </div> - <footer class="card-footer"> - <a (click)="reset($event);" class="card-footer-item has-text-danger" data-tooltip="Remove filter and show all proteins."> - <span class="icon"> - <i class="fa fa-broom"></i> - </span> - <span> - Reset - </span> - </a> - </footer> - </div> - </div> </div> <div class="covex network"> @@ -487,27 +449,6 @@ </a> </footer> - <footer class="card-footer"> - <a (click)="analysis.addVisibleViralProteins(currentViewNodes, currentViewViralProteins)" - class="card-footer-item has-text-success" data-tooltip="Add all visible viral proteins."> - <span class="icon"> - <i class="fa fa-plus"></i> - </span> - <span> - Add viral proteins - </span> - </a> - <a (click)="analysis.removeAllViralProteins()" - class="card-footer-item has-text-danger" data-tooltip="Remove all viral proteins."> - <span class="icon"> - <i class="fa fa-minus"></i> - </span> - <span> - Remove viral proteins - </span> - </a> - </footer> - <footer class="card-footer" *ngIf="selectedAnalysisToken"> <a (click)="analysis.addSeeds(currentViewNodes)" class="card-footer-item has-text-success" data-tooltip="Add all visible seeds."> diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index 1d41f1c30d7e6b0a67f279912538e9ace5b84422..d42cf73363857a219f66f76adcddd40d255a11fe 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -6,25 +6,18 @@ import { ViewChild } from '@angular/core'; import { - ProteinViralInteraction, - ViralProtein, + ProteinProteinInteraction, Protein, Wrapper, - getWrapperFromViralProtein, getWrapperFromProtein, - getNodeIdsFromPVI, - getViralProteinNodeId, - getProteinNodeId, - Dataset, - Tissue + Tissue, getNodeIdsFromI } from '../../interfaces'; -import {ProteinNetwork, getDatasetFilename} from '../../main-network'; -import {HttpClient, HttpParams} from '@angular/common/http'; +import {ProteinNetwork} from '../../main-network'; +import {HttpClient} from '@angular/common/http'; import {AnalysisService} from '../../analysis.service'; import html2canvas from 'html2canvas'; -import {environment} from '../../../environments/environment'; import {NetworkSettings} from '../../network-settings'; -import {defaultConfig, IConfig} from "../../config"; +import {defaultConfig, IConfig} from '../../config'; declare var vis: any; @@ -83,12 +76,9 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { public collapseData = true; public collapseOverview = true; - public viralProteinCheckboxes: Array<{ checked: boolean; data: ViralProtein }> = []; - public proteinData: ProteinNetwork; public proteins: any; - public effects: any; public edges: any; private networkInternal: any; @@ -109,7 +99,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { public currentDataset = []; public currentViewProteins: Protein[]; - public currentViewViralProteins: ViralProtein[]; public currentViewSelectedTissue: Tissue | null = null; public currentViewNodes: any[]; @@ -188,16 +177,9 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { const network = JSON.parse(this.networkJSON); this.proteins = network.nodes; - this.effects = []; this.edges = network.edges; } - public reset(event) { - const checked = event.target.checked; - this.viralProteinCheckboxes.forEach(item => item.checked = checked); - this.filterNodes(); - } - private zoomToNode(id: string) { this.nodeData.nodes.getIds(); const coords = this.networkInternal.getPositions(id)[id]; @@ -234,25 +216,11 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { this.analysis.resetSelection(); this.selectedWrapper = null; this.getNetwork(); - this.proteinData = new ProteinNetwork(this.proteins, this.effects, this.edges); + this.proteinData = new ProteinNetwork(this.proteins, this.edges); this.proteinData.linkNodes(); // Populate baits const effectNames = []; - this.proteinData.effects.sort((a, b) => { - return a.effectName.localeCompare(b.effectName); - }); - this.viralProteinCheckboxes = []; - this.proteinData.effects.forEach((effect) => { - const effectName = effect.effectName; - if (effectNames.indexOf(effectName) === -1) { - effectNames.push(effectName); - this.viralProteinCheckboxes.push({ - checked: false, - data: effect, - }); - } - }); const {nodes, edges} = this.mapDataToNodes(this.proteinData); this.nodeData.nodes = new vis.DataSet(nodes); @@ -295,83 +263,20 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { } this.queryItems = []; - this.fillQueryItems(this.proteins, this.effects); + this.fillQueryItems(this.proteins); if (this.selectedWrapper) { this.networkInternal.selectNodes([this.selectedWrapper.nodeId]); } } - fillQueryItems(hostProteins: Protein[], viralProteins: ViralProtein[]) { + fillQueryItems(hostProteins: Protein[]) { this.queryItems = []; hostProteins.forEach((protein) => { this.queryItems.push(getWrapperFromProtein(protein)); }); - viralProteins.forEach((viralProtein) => { - this.queryItems.push(getWrapperFromViralProtein(viralProtein)); - }); - this.currentViewNodes = this.nodeData.nodes; this.currentViewProteins = this.proteins; - this.currentViewViralProteins = this.effects; - } - - public async filterNodes() { - const visibleIds = new Set<string>(this.nodeData.nodes.getIds()); - - const removeIds = new Set<string>(); - const addNodes = new Map<string, Node>(); - - const showAll = !this.viralProteinCheckboxes.find((eff) => eff.checked); - const connectedProteinAcs = new Set<string>(); - - const filteredViralProteins = []; - this.viralProteinCheckboxes.forEach((cb) => { - const viralProteins: Array<ViralProtein> = []; - this.proteinData.effects.forEach((effect) => { - if (effect.effectName === cb.data.effectName) { - viralProteins.push(effect); - } - }); - viralProteins.forEach((effect) => { - const nodeId = getViralProteinNodeId(effect); - const found = visibleIds.has(nodeId); - if ((cb.checked || showAll) && !found) { - const node = this.mapViralProteinToNode(effect); - // this.nodeData.nodes.add(node); - addNodes.set(node.id, node); - } else if ((!showAll && !cb.checked) && found) { - // this.nodeData.nodes.remove(nodeId); - removeIds.add(nodeId); - } - if (cb.checked || showAll) { - filteredViralProteins.push(effect); - effect.proteins.forEach((pg) => { - connectedProteinAcs.add(pg.proteinAc); - }); - } - }); - }); - const filteredProteins = []; - for (const protein of this.proteinData.proteins) { - const nodeId = getProteinNodeId(protein); - const contains = connectedProteinAcs.has(protein.proteinAc); - const found = visibleIds.has(nodeId); - if (contains) { - filteredProteins.push(protein); - - if (!found) { - const node = this.mapHostProteinToNode(protein); - addNodes.set(node.id, node); - } - } else if (found) { - removeIds.add(nodeId); - } - } - - this.nodeData.nodes.remove(Array.from(removeIds.values())); - this.nodeData.nodes.add(Array.from(addNodes.values())); - this.fillQueryItems(filteredProteins, filteredViralProteins); } public queryAction(item: any) { @@ -407,20 +312,8 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { return node; } - private mapViralProteinToNode(viralProtein: ViralProtein): any { - const wrapper = getWrapperFromViralProtein(viralProtein); - const node = NetworkSettings.getNodeStyle('virus', true, this.analysis.inSelection(wrapper)); - node.id = wrapper.nodeId; - node.label = viralProtein.effectName; - node.id = wrapper.nodeId; - node.x = viralProtein.x; - node.y = viralProtein.y; - node.wrapper = wrapper; - return node; - } - - private mapEdge(edge: ProteinViralInteraction): any { - const {from, to} = getNodeIdsFromPVI(edge); + private mapEdge(edge: ProteinProteinInteraction): any { + const {from, to} = getNodeIdsFromI(edge); return { from, to, color: { @@ -438,10 +331,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { nodes.push(this.mapHostProteinToNode(protein)); } - for (const effect of data.effects) { - nodes.push(this.mapViralProteinToNode(effect)); - } - for (const edge of data.edges) { edges.push(this.mapEdge(edge)); } @@ -462,16 +351,14 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { }); } - analysisWindowChanged($event: [any[], [Protein[], ViralProtein[], Tissue]]) { + analysisWindowChanged($event: [any[], [Protein[], Tissue]]) { if ($event) { this.currentViewNodes = $event[0]; this.currentViewProteins = $event[1][0]; - this.currentViewViralProteins = $event[1][1]; - this.currentViewSelectedTissue = $event[1][2]; + this.currentViewSelectedTissue = $event[1][1]; } else { this.currentViewNodes = this.nodeData.nodes; this.currentViewProteins = this.proteins; - this.currentViewViralProteins = this.effects; this.currentViewSelectedTissue = this.selectedTissue; } } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index c46256ea57bccaf21afe4c8ba5a5a08296574489..2dec8afe762c3bba69754df1325f56ba1b89d934 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ export const environment = { production: true, - backend: 'https://exbio.wzw.tum.de/covex/api/', + backend: 'https://exbio.wzw.tum.de/drugstone/api/', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index bb4892770cb650bf8f867689a7ed6f886098e911..2516ae63c61a0bc2ac8839acdd8fcddd073ff3c6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - backend: 'https://exbio.wzw.tum.de/netex_dev/api/', + backend: 'https://exbio.wzw.tum.de/drugstone/api/', }; /* diff --git a/src/index.html b/src/index.html index d2831825101c723d2ef1b42c0c3b12dcb16b2e4e..2083606c17722e21deac36498c00ca99750a9e2e 100644 --- a/src/index.html +++ b/src/index.html @@ -82,7 +82,16 @@ proteinName: "Ras GTPase-activating protein-binding protein 2" } ], - edges: [] + edges: [ + { + from: 'Q9NXA8', + to: 'Q9Y3U8', + }, + { + from: 'Q9Y3U8', + to: 'Q9UN86', + } + ] })); } </script>