Skip to content
Snippets Groups Projects
Commit 124d48d3 authored by AndiMajore's avatar AndiMajore
Browse files

fixed display of drug table on non drug tasks; fixed normalization

parent ff52bf63
No related branches found
No related tags found
No related merge requests found
...@@ -68,92 +68,92 @@ ...@@ -68,92 +68,92 @@
<div class="column"> <div class="column">
<table class="table is-narrow"> <table class="table is-narrow">
<tbody> <tbody>
<tr <tr
*ngIf=" *ngIf="
result && result.geneInteractionDataset !== undefined result && result.geneInteractionDataset !== undefined
" "
> >
<td>Protein-Protein Interaction Dataset</td> <td>Protein-Protein Interaction Dataset</td>
<td> <td>
{{ result.geneInteractionDataset.name }} (Version {{ result.geneInteractionDataset.name }} (Version
{{ result.geneInteractionDataset.version }}) {{ result.geneInteractionDataset.version }})
</td> </td>
</tr> </tr>
<tr <tr
*ngIf=" *ngIf="
result && result.drugInteractionDataset !== undefined result && result.drugInteractionDataset !== undefined
" "
> >
<td>Protein-Drug Interaction Dataset</td> <td>Protein-Drug Interaction Dataset</td>
<td> <td>
{{ result.drugInteractionDataset.name }} (Version {{ result.drugInteractionDataset.name }} (Version
{{ result.drugInteractionDataset.version }}) {{ result.drugInteractionDataset.version }})
</td> </td>
</tr> </tr>
<tr *ngIf="task.info.parameters.resultSize !== undefined"> <tr *ngIf="task.info.parameters.resultSize !== undefined">
<td>Result Size</td> <td>Result Size</td>
<td>{{ task.info.parameters.resultSize }}</td> <td>{{ task.info.parameters.resultSize }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.k !== undefined"> <tr *ngIf="task.info.parameters.k !== undefined">
<td>K</td> <td>K</td>
<td>{{ task.info.parameters.k }}</td> <td>{{ task.info.parameters.k }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.numTrees !== undefined"> <tr *ngIf="task.info.parameters.numTrees !== undefined">
<td>Number of trees</td> <td>Number of trees</td>
<td>{{ task.info.parameters.numTrees }}</td> <td>{{ task.info.parameters.numTrees }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.tolerance !== undefined"> <tr *ngIf="task.info.parameters.tolerance !== undefined">
<td>Tolerance</td> <td>Tolerance</td>
<td>{{ task.info.parameters.tolerance }}</td> <td>{{ task.info.parameters.tolerance }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.dampingFactor !== undefined"> <tr *ngIf="task.info.parameters.dampingFactor !== undefined">
<td>Damping Factor</td> <td>Damping Factor</td>
<td>{{ task.info.parameters.dampingFactor }}</td> <td>{{ task.info.parameters.dampingFactor }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.maxDeg !== undefined"> <tr *ngIf="task.info.parameters.maxDeg !== undefined">
<td>Maximum Degree</td> <td>Maximum Degree</td>
<td>{{ task.info.parameters.maxDeg }}</td> <td>{{ task.info.parameters.maxDeg }}</td>
</tr> </tr>
<tr *ngIf="task.info.parameters.hubPenalty !== undefined"> <tr *ngIf="task.info.parameters.hubPenalty !== undefined">
<td>Hub Penality</td> <td>Hub Penality</td>
<td>{{ task.info.parameters.hubPenalty }}</td> <td>{{ task.info.parameters.hubPenalty }}</td>
</tr> </tr>
<tr <tr
*ngIf=" *ngIf="
task.info.parameters.includeIndirectDrugs !== undefined && task.info.parameters.includeIndirectDrugs !== undefined &&
task.info.target === 'drug' task.info.target === 'drug'
" "
> >
<td>Include indirect drugs</td> <td>Include indirect drugs</td>
<td> <td>
<i <i
*ngIf="task.info.parameters.includeIndirectDrugs" *ngIf="task.info.parameters.includeIndirectDrugs"
class="fa fa-check" class="fa fa-check"
></i> ></i>
<i <i
*ngIf="!task.info.parameters.includeIndirectDrugs" *ngIf="!task.info.parameters.includeIndirectDrugs"
class="fa fa-times" class="fa fa-times"
></i> ></i>
</td> </td>
</tr> </tr>
<tr <tr
*ngIf=" *ngIf="
task.info.parameters.includeNonApprovedDrugs !== task.info.parameters.includeNonApprovedDrugs !==
undefined && task.info.target === 'drug' undefined && task.info.target === 'drug'
" "
> >
<td>Include non-approved drugs</td> <td>Include non-approved drugs</td>
<td> <td>
<i <i
*ngIf="task.info.parameters.includeNonApprovedDrugs" *ngIf="task.info.parameters.includeNonApprovedDrugs"
class="fa fa-check" class="fa fa-check"
></i> ></i>
<i <i
*ngIf="!task.info.parameters.includeNonApprovedDrugs" *ngIf="!task.info.parameters.includeNonApprovedDrugs"
class="fa fa-times" class="fa fa-times"
></i> ></i>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -168,18 +168,18 @@ ...@@ -168,18 +168,18 @@
</p> </p>
<table class="table is-narrow"> <table class="table is-narrow">
<tbody> <tbody>
<tr> <tr>
<td>Number of Trees</td> <td>Number of Trees</td>
<td>1</td> <td>1</td>
</tr> </tr>
<tr> <tr>
<td>Tolerance</td> <td>Tolerance</td>
<td>0</td> <td>0</td>
</tr> </tr>
<tr> <tr>
<td>Hub Penality</td> <td>Hub Penality</td>
<td>1</td> <td>1</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p> <p>
...@@ -187,26 +187,26 @@ ...@@ -187,26 +187,26 @@
</p> </p>
<table class="table is-narrow"> <table class="table is-narrow">
<tbody> <tbody>
<tr> <tr>
<td>Include indirect drugs</td> <td>Include indirect drugs</td>
<td> <td>
<i class="fa fa-times"></i> <i class="fa fa-times"></i>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Include non-approved drugs</td> <td>Include non-approved drugs</td>
<td> <td>
<i class="fa fa-check"></i> <i class="fa fa-check"></i>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Hub Penality</td> <td>Hub Penality</td>
<td>1</td> <td>1</td>
</tr> </tr>
<tr> <tr>
<td>Result Size</td> <td>Result Size</td>
<td>10</td> <td>10</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -227,82 +227,83 @@ ...@@ -227,82 +227,83 @@
*ngIf="task && task.info.done" *ngIf="task && task.info.done"
[class.is-visible]="tab === 'table'" [class.is-visible]="tab === 'table'"
> >
<div class="columns m-1"> <div *ngIf="task.info.target === 'drug'">
<!-- column normalization for drugs button START --> <div class="columns m-1">
<div class="column"> <!-- column normalization for drugs button START -->
<h4 class="is-4"> <div class="column">
<span class="icon"><i class="fa fa-capsules"></i></span> <h4 class="is-4">
<span>Drugs</span> <span class="icon"><i class="fa fa-capsules"></i></span>
</h4> <span>Drugs</span>
</div> </h4>
<div class="column">
<div class="field has-addons is-pulled-right m-1">
<a
[href]="downloadLink('drugs')"
class="button is-primary control is-outlined is-rounded is-pulled-right is-small"
>
<span class="icon"><i class="fa fa-download"></i></span>
<span>Download</span>
</a>
</div> </div>
<div class="column">
<div class="field has-addons is-pulled-right m-1">
<a
[href]="downloadLink('drugs')"
class="button is-primary control is-outlined is-rounded is-pulled-right is-small"
>
<span class="icon"><i class="fa fa-download"></i></span>
<span>Download</span>
</a>
</div>
<div <div
class="field has-addons is-pulled-right m-1" class="field has-addons is-pulled-right m-1"
*ngIf="tableHasScores && task.info.algorithm !== 'proximity'" *ngIf="tableHasScores && task.info.algorithm !== 'proximity'"
> >
<p class="control"> <p class="control">
<button <button
class="button is-rounded has-tooltip is-small" class="button is-rounded has-tooltip is-small"
pTooltip="Normalize the scores" pTooltip="Normalize the scores"
[tooltipStyleClass]=" [tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top' 'drgstn drgstn-tooltip drgstn-tooltip-top'
" "
tooltipPosition="top" tooltipPosition="top"
[class.is-primary]="tableNormalize" [class.is-primary]="tableNormalize"
(click)="toggleNormalization(true)" (click)="toggleNormalization(true)"
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }" [ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
> >
<span class="icon is-small"> <span class="icon is-small">
<i class="fa fa-ruler-vertical"></i> <i class="fa fa-ruler-vertical"></i>
</span> </span>
<span>Normalization On</span> <span>Normalization On</span>
</button> </button>
</p> </p>
<p class="control"> <p class="control">
<button <button
class="button is-rounded has-tooltip is-small" class="button is-rounded has-tooltip is-small"
pTooltip="Disable normalization of the scores." pTooltip="Disable normalization of the scores."
[tooltipStyleClass]=" [tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top' 'drgstn drgstn-tooltip drgstn-tooltip-top'
" "
tooltipPosition="top" tooltipPosition="top"
[class.is-primary]="!tableNormalize" [class.is-primary]="!tableNormalize"
(click)="toggleNormalization(false)" (click)="toggleNormalization(false)"
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }" [ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
> >
<span>Off</span> <span>Off</span>
</button> </button>
</p> </p>
</div>
</div> </div>
<!-- column normalization for drugs button START -->
</div> </div>
<!-- column normalization for drugs button START -->
</div>
<div class="columns m-1"> <div class="columns m-1">
<!-- drug table or placeholder if no drugs found START --> <!-- drug table or placeholder if no drugs found START -->
<div class="column"> <div class="column">
<div *ngIf="tableDrugs.length === 0 && task.info.target === 'drug'"> <div *ngIf="tableDrugs.length === 0">
<i>No drugs have been found.</i> <i>No drugs have been found.</i>
</div>
<app-drug-table
[tableDrugs]="tableDrugs"
[tableDrugScoreTooltip]="tableDrugScoreTooltip"
[tableHasScores]="tableHasScores"
></app-drug-table>
</div> </div>
<app-drug-table <!-- drug table or placeholder if no drugs found END -->
[tableDrugs]="tableDrugs"
[tableDrugScoreTooltip]="tableDrugScoreTooltip"
[tableHasScores]="tableHasScores"
></app-drug-table>
</div> </div>
<!-- drug table or placeholder if no drugs found END -->
</div> </div>
<div *ngIf="tableProteins.length > 0" class="table-header"> <div *ngIf="tableProteins.length > 0" class="table-header">
<div class="columns m-1"> <div class="columns m-1">
<div class="column"> <div class="column">
...@@ -311,6 +312,7 @@ ...@@ -311,6 +312,7 @@
<span>Proteins</span> <span>Proteins</span>
</h4> </h4>
</div> </div>
<div class="column"> <div class="column">
<div class="field has-addons is-pulled-right m-1 control"> <div class="field has-addons is-pulled-right m-1 control">
<a <a
...@@ -321,6 +323,44 @@ ...@@ -321,6 +323,44 @@
<span>Download</span> <span>Download</span>
</a> </a>
</div> </div>
<div
class="field has-addons is-pulled-right m-1"
*ngIf="tableHasScores && task.info.target !== 'drug'"
>
<p class="control">
<button
class="button is-rounded has-tooltip is-small"
pTooltip="Normalize the scores"
[tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top'
"
tooltipPosition="top"
[class.is-primary]="tableNormalize"
(click)="toggleNormalization(true)"
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
>
<span class="icon is-small">
<i class="fa fa-ruler-vertical"></i>
</span>
<span>Normalization On</span>
</button>
</p>
<p class="control">
<button
class="button is-rounded has-tooltip is-small"
pTooltip="Disable normalization of the scores."
[tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top'
"
tooltipPosition="top"
[class.is-primary]="!tableNormalize"
(click)="toggleNormalization(false)"
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
>
<span>Off</span>
</button>
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -328,13 +368,13 @@ ...@@ -328,13 +368,13 @@
<div class="columns m-1"> <div class="columns m-1">
<div class="column"> <div class="column">
<app-prot-table <app-prot-table
[tableHasScores]="tableHasScores" [tableHasScores]="tableHasScores"
[tableProteins]="tableProteins" [tableProteins]="tableProteins"
[tableProteinScoreTooltip]="tableDrugScoreTooltip" [tableProteinScoreTooltip]="tableDrugScoreTooltip"
[tableProteinSelection]="tableProteinSelection" [tableProteinSelection]="tableProteinSelection"
[tableSelectedProteins]="tableSelectedProteins" [tableSelectedProteins]="tableSelectedProteins"
[identifier]="myConfig.identifier" [identifier]="myConfig.identifier"
></app-prot-table> ></app-prot-table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -10,9 +10,9 @@ import { ...@@ -10,9 +10,9 @@ import {
SimpleChanges, SimpleChanges,
ViewChild, ViewChild,
} from '@angular/core'; } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { environment } from '../../../environments/environment'; import {environment} from '../../../environments/environment';
import { algorithmNames, AnalysisService } from '../../services/analysis/analysis.service'; import {algorithmNames, AnalysisService} from '../../services/analysis/analysis.service';
import { import {
Drug, Drug,
EdgeType, EdgeType,
...@@ -28,13 +28,13 @@ import { ...@@ -28,13 +28,13 @@ import {
NodeInteraction, NodeInteraction,
} from '../../interfaces'; } from '../../interfaces';
import domtoimage from 'dom-to-image'; import domtoimage from 'dom-to-image';
import { NetworkSettings } from '../../network-settings'; import {NetworkSettings} from '../../network-settings';
import { NetexControllerService } from 'src/app/services/netex-controller/netex-controller.service'; import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service';
import { defaultConfig, IConfig } from 'src/app/config'; import {defaultConfig, IConfig} from 'src/app/config';
import { mapCustomEdge, mapCustomNode } from 'src/app/main-network'; import {mapCustomEdge, mapCustomNode} from 'src/app/main-network';
import { downLoadFile, pieChartContextRenderer, removeDuplicateObjectsFromList } from 'src/app/utils'; import {downLoadFile, pieChartContextRenderer, removeDuplicateObjectsFromList} from 'src/app/utils';
import { DrugstoneConfigService } from 'src/app/services/drugstone-config/drugstone-config.service'; import {DrugstoneConfigService} from 'src/app/services/drugstone-config/drugstone-config.service';
import { NetworkHandlerService } from 'src/app/services/network-handler/network-handler.service'; import {NetworkHandlerService} from 'src/app/services/network-handler/network-handler.service';
declare var vis: any; declare var vis: any;
...@@ -48,10 +48,9 @@ interface Seeded { ...@@ -48,10 +48,9 @@ interface Seeded {
isSeed: boolean; isSeed: boolean;
} }
interface Baited { // interface Baited {
closestViralProteins: string[]; // closestDistance: number;
closestDistance: number; // }
}
@Component({ @Component({
selector: 'app-analysis-panel', selector: 'app-analysis-panel',
...@@ -60,8 +59,9 @@ interface Baited { ...@@ -60,8 +59,9 @@ interface Baited {
}) })
export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit { export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit {
@ViewChild('networkWithLegend', { static: false }) networkWithLegendEl: ElementRef; @ViewChild('networkWithLegend', {static: false}) networkWithLegendEl: ElementRef;
@Input() token: string | null = null; @Input() token: string | null = null;
@Input() @Input()
public set config(config: IConfig | undefined) { public set config(config: IConfig | undefined) {
if (typeof config === 'undefined') { if (typeof config === 'undefined') {
...@@ -71,6 +71,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -71,6 +71,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
this.myConfig[key] = config[key]; this.myConfig[key] = config[key];
} }
} }
@Output() tokenChange = new EventEmitter<string | null>(); @Output() tokenChange = new EventEmitter<string | null>();
@Output() showDetailsChange = new EventEmitter<Wrapper>(); @Output() showDetailsChange = new EventEmitter<Wrapper>();
@Output() setInputNetwork = new EventEmitter<any>(); @Output() setInputNetwork = new EventEmitter<any>();
...@@ -80,33 +81,31 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -80,33 +81,31 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig)); public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig));
public network: any; 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 drugNodes: any[] = [];
private drugEdges: any[] = []; // private drugEdges: any[] = [];
public showDrugs = false; public showDrugs = false;
public tab: 'meta' | 'network' | 'table' = 'table'; public tab: 'meta' | 'network' | 'table' = 'table';
public adjacentDrugs = false; // public adjacentDrugs = false;
public adjacentDrugList: Node[] = []; // public adjacentDrugList: Node[] = [];
public adjacentDrugEdgesList: Node[] = []; // public adjacentDrugEdgesList: Node[] = [];
//
public adjacentDisordersProtein = false; // public adjacentDisordersProtein = false;
public adjacentDisordersDrug = false; // public adjacentDisordersDrug = false;
//
public adjacentProteinDisorderList: Node[] = []; // public adjacentProteinDisorderList: Node[] = [];
public adjacentProteinDisorderEdgesList: Node[] = []; // public adjacentProteinDisorderEdgesList: Node[] = [];
//
public adjacentDrugDisorderList: Node[] = []; // public adjacentDrugDisorderList: Node[] = [];
public adjacentDrugDisorderEdgesList: Node[] = []; // public adjacentDrugDisorderEdgesList: Node[] = [];
private proteins: any; private proteins: any;
public effects: any; public effects: any;
public tableDrugs: Array<Drug & Scored & Baited> = []; public tableDrugs: Array<Drug & Scored> = [];
public tableProteins: Array<Node & Scored & Seeded & Baited> = []; public tableProteins: Array<Node & Scored & Seeded> = [];
public tableSelectedProteins: Array<Node & Scored & Seeded & Baited> = []; public tableSelectedProteins: Array<Node & Scored & Seeded> = [];
public tableViralProteins: Array<Scored & Seeded> = [];
public tableSelectedViralProteins: Array<Scored & Seeded> = [];
public tableNormalize = false; public tableNormalize = false;
public tableHasScores = false; public tableHasScores = false;
...@@ -180,14 +179,14 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -180,14 +179,14 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
this.networkHandler.activeNetwork.seedMap = nodeAttributes.isSeed || {}; this.networkHandler.activeNetwork.seedMap = nodeAttributes.isSeed || {};
// Reset // Reset
this.nodeData = { nodes: null, edges: null }; this.nodeData = {nodes: null, edges: null};
this.networkHandler.activeNetwork.networkEl.nativeElement.innerHTML = ''; this.networkHandler.activeNetwork.networkEl.nativeElement.innerHTML = '';
this.networkHandler.activeNetwork.networkInternal = null; this.networkHandler.activeNetwork.networkInternal = null;
this.showDrugs = false; this.showDrugs = false;
// Create // Create
const { nodes, edges } = this.createNetwork(this.result); const {nodes, edges} = this.createNetwork(this.result);
this.analysis.inputNetwork = { nodes: nodes, edges: edges }; this.analysis.inputNetwork = {nodes: nodes, edges: edges};
this.nodeData.nodes = new vis.DataSet(nodes); this.nodeData.nodes = new vis.DataSet(nodes);
this.nodeData.edges = new vis.DataSet(edges); this.nodeData.edges = new vis.DataSet(edges);
const container = this.networkHandler.activeNetwork.networkEl.nativeElement; const container = this.networkHandler.activeNetwork.networkEl.nativeElement;
...@@ -218,14 +217,10 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -218,14 +217,10 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
}); });
this.tableHasScores = ['trustrank', 'closeness', 'degree', 'proximity', 'betweenness', 'quick', 'super'] this.tableHasScores = ['trustrank', 'closeness', 'degree', 'betweenness', 'quick', 'super']
.indexOf(this.task.info.algorithm) !== -1; .indexOf(this.task.info.algorithm) !== -1;
if (this.tableHasScores) { if (this.tableHasScores) {
if (this.task.info.algorithm !== 'proximity') { this.toggleNormalization(true);
this.toggleNormalization(true);
} else {
this.toggleNormalization(false);
}
} }
this.networkHandler.activeNetwork.networkInternal.on('deselectNode', (properties) => { this.networkHandler.activeNetwork.networkInternal.on('deselectNode', (properties) => {
...@@ -290,7 +285,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -290,7 +285,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
this.nodeData.nodes.update(updatedNodes); this.nodeData.nodes.update(updatedNodes);
const proteinSelection = this.tableSelectedProteins; const proteinSelection = this.tableSelectedProteins;
const viralProteinSelection = this.tableSelectedViralProteins;
for (const item of items) { for (const item of items) {
// TODO: Refactor! // TODO: Refactor!
const found = proteinSelection.findIndex((i) => getProteinNodeId(i) === item.id); const found = proteinSelection.findIndex((i) => getProteinNodeId(i) === item.id);
...@@ -303,7 +297,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -303,7 +297,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
} }
} }
this.tableSelectedProteins = [...proteinSelection]; this.tableSelectedProteins = [...proteinSelection];
this.tableSelectedViralProteins = [...viralProteinSelection];
} else { } else {
// else: selected is null // else: selected is null
const updatedNodes = []; const updatedNodes = [];
...@@ -322,7 +315,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -322,7 +315,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
this.nodeData.nodes.update(updatedNodes); this.nodeData.nodes.update(updatedNodes);
const proteinSelection = []; const proteinSelection = [];
const viralProteinSelection = [];
for (const item of items) { for (const item of items) {
const tableItem = this.tableProteins.find((i) => getProteinNodeId(i) === item.id); const tableItem = this.tableProteins.find((i) => getProteinNodeId(i) === item.id);
if (tableItem) { if (tableItem) {
...@@ -330,7 +322,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -330,7 +322,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
} }
} }
this.tableSelectedProteins = [...proteinSelection]; this.tableSelectedProteins = [...proteinSelection];
this.tableSelectedViralProteins = [...viralProteinSelection];
} }
}); });
} }
...@@ -388,13 +379,13 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -388,13 +379,13 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
}; };
if (normalize) { if (normalize) {
normalizeFn(this.tableDrugs);
normalizeFn(this.tableProteins); normalizeFn(this.tableProteins);
normalizeFn(this.tableViralProteins); if (this.task.info.target === 'drug')
normalizeFn(this.tableDrugs)
} else { } else {
unnormalizeFn(this.tableDrugs);
unnormalizeFn(this.tableProteins); unnormalizeFn(this.tableProteins);
unnormalizeFn(this.tableViralProteins); if (this.task.info.target === 'drug')
unnormalizeFn(this.tableDrugs)
} }
} }
...@@ -482,15 +473,15 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit ...@@ -482,15 +473,15 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit
}; };
} }
getResultNodes(){ getResultNodes() {
if(this.nodeData && this.nodeData['nodes']) if (this.nodeData && this.nodeData['nodes'])
return this.nodeData['nodes'].get() return this.nodeData['nodes'].get()
return [] return []
} }
getResultEdges(){ getResultEdges() {
if(this.nodeData && this.nodeData['edges']) if (this.nodeData && this.nodeData['edges'])
return this.nodeData['edges'].get().filter(e=> !e.id || !e.groupName || (typeof e.from === 'string' && typeof e.to === 'string')) return this.nodeData['edges'].get().filter(e => !e.id || !e.groupName || (typeof e.from === 'string' && typeof e.to === 'string'))
return [] return []
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<fa-icon [icon]="faTimes" [classes]="['icon']"></fa-icon> <fa-icon [icon]="faTimes" [classes]="['icon']"></fa-icon>
</span> </span>
</td> </td>
<td *ngIf="tableHasScores">{{e.score | number}}</td> <td *ngIf="tableHasScores">{{e.score.toString() | number}}</td>
</tr> </tr>
</ng-template> </ng-template>
</p-table> </p-table>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<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> <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>
<td>{{e.proteinName}}</td> <td>{{e.proteinName}}</td>
<td *ngIf="tableHasScores">{{e.score | number}}</td> <td *ngIf="tableHasScores">{{e.score.toString() | number}}</td>
<td> <td>
<span *ngIf="e.isSeed"> <span *ngIf="e.isSeed">
<fa-icon [icon]="faCheck" [classes]="['icon']"></fa-icon> <fa-icon [icon]="faCheck" [classes]="['icon']"></fa-icon>
......
...@@ -20,7 +20,48 @@ ...@@ -20,7 +20,48 @@
</p> </p>
<p *ngIf="wrapper.data.symbol" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"> <p *ngIf="wrapper.data.symbol" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Symbol:</span></b> <b><span>Symbol:</span></b>
<span class="is-capitalized"> {{ wrapper.data.symbol }}</span> <a class="is-capitalized" href="https://www.genecards.org/cgi-bin/carddisp.pl?gene={{wrapper.data.symbol }}" target="_blank"> {{ wrapper.data.symbol }}</a>
</p>
<p *ngIf="wrapper.data.uniprotAc" [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 }}"
target="_blank"
>
<span class="is-capitalized"> {{ uniprotAc }}</span>
</a>
</p>
<p *ngIf="wrapper.data.ensg" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Ensembl:</span></b>
<a
*ngFor="let ensg of wrapper.data.ensg"
href="https://www.ensembl.org/Homo_sapiens/Gene/Summary?g={{ ensg }}"
target="_blank"
>
<span class="is-capitalized"> {{ ensg }}</span>
</a>
</p>
<p *ngIf="wrapper.data.entrez" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Entrez:</span></b>
<a
*ngFor="let entrez of wrapper.data.entrez"
href="https://www.ncbi.nlm.nih.gov/gene/{{ entrez }}"
target="_blank"
>
<span class="is-capitalized"> {{ entrez }}</span>
</a>
</p>
<p *ngIf="wrapper.expression" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Expression:</span></b>
<span class="is-capitalized"> {{ wrapper.expression | number }}</span>
<span
class="icon has-text-info"
pTooltip="Tissue expression data is provided by the GTEx project. Unit is transcript per million."
[tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'"
tooltipPosition="left"
><i class="fas fa-info-circle"></i
></span>
</p> </p>
<p <p
*ngIf="wrapper.data.drugId || wrapper.data.disorderId" *ngIf="wrapper.data.drugId || wrapper.data.disorderId"
...@@ -68,47 +109,7 @@ ...@@ -68,47 +109,7 @@
<b><span>Group:</span></b> <b><span>Group:</span></b>
<span class="is-capitalized"> {{ wrapper.data.groupName }}</span> <span class="is-capitalized"> {{ wrapper.data.groupName }}</span>
</p> </p>
<p *ngIf="wrapper.data.uniprotAc" [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 }}"
target="_blank"
>
<span class="is-capitalized"> {{ uniprotAc }}</span>
</a>
</p>
<p *ngIf="wrapper.data.ensg" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Ensembl:</span></b>
<a
*ngFor="let ensg of wrapper.data.ensg"
href="https://www.ensembl.org/Homo_sapiens/Gene/Summary?g={{ ensg }}"
target="_blank"
>
<span class="is-capitalized"> {{ ensg }}</span>
</a>
</p>
<p *ngIf="wrapper.data.entrez" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Entrez:</span></b>
<a
*ngFor="let entrez of wrapper.data.entrez"
href="https://www.ncbi.nlm.nih.gov/gene/{{ entrez }}"
target="_blank"
>
<span class="is-capitalized"> {{ entrez }}</span>
</a>
</p>
<p *ngIf="wrapper.expression" [ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Expression:</span></b>
<span class="is-capitalized"> {{ wrapper.expression | number }}</span>
<span
class="icon has-text-info"
pTooltip="Tissue expression data is provided by the GTEx project. Unit is transcript per million."
[tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'"
tooltipPosition="left"
><i class="fas fa-info-circle"></i
></span>
</p>
</div> </div>
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
<input type="checkbox" onclick=changeConfigStr('{"showOverview":'+this.checked+'}') checked /> Show overview<br> <input type="checkbox" onclick=changeConfigStr('{"showOverview":'+this.checked+'}') checked /> Show overview<br>
<input type="checkbox" onclick=changeConfigStr('{"showQuery":'+this.checked+'}') /> Show query<br> <input type="checkbox" onclick=changeConfigStr('{"showQuery":'+this.checked+'}') /> Show query<br>
<!-- <input type="checkbox" onclick=changeConfigStr('{"showSidebar":'+this.checked+'}') checked /> Show sidebar<br> -->
<input type="checkbox" onclick=changeConfigStr('{"showItemSelector":'+this.checked+'}') checked /> Show ItemSelector<br> <input type="checkbox" onclick=changeConfigStr('{"showItemSelector":'+this.checked+'}') checked /> Show ItemSelector<br>
<input type="checkbox" onclick=changeConfigStr('{"showConnectGenes":'+this.checked+'}') /> Show Connect Genes<br> <input type="checkbox" onclick=changeConfigStr('{"showConnectGenes":'+this.checked+'}') /> Show Connect Genes<br>
<input type="checkbox" onclick=changeConfigStr('{"showSimpleAnalysis":'+this.checked+'}') /> Show Simple Analysis<br> <input type="checkbox" onclick=changeConfigStr('{"showSimpleAnalysis":'+this.checked+'}') checked /> Show Simple Analysis<br>
<input type="checkbox" onclick=changeConfigStr('{"showAdvAnalysis":'+this.checked+'}') checked /> Show Advanced Analysis<br> <input type="checkbox" onclick=changeConfigStr('{"showAdvAnalysis":'+this.checked+'}') checked /> Show Advanced Analysis<br>
<input type="checkbox" onclick=changeConfigStr('{"showTasks":'+this.checked+'}') checked /> Show Tasks<br> <input type="checkbox" onclick=changeConfigStr('{"showTasks":'+this.checked+'}') checked /> Show Tasks<br>
<input type="checkbox" onclick=changeConfigStr('{"showSelection":'+this.checked+'}') checked /> Show Selection<br> <input type="checkbox" onclick=changeConfigStr('{"showSelection":'+this.checked+'}') checked /> Show Selection<br>
...@@ -94,7 +93,7 @@ ...@@ -94,7 +93,7 @@
<drugst-one id="netexp1" <drugst-one id="netexp1"
pluginId="2" pluginId="2"
groups='{"nodeGroups":{"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Gene","shape":"circle"}}}' groups='{"nodeGroups":{"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"star"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Gene","shape":"circle"}}}'
config='{"licensedDatasets": false, "physicsOn":false,"identifier":"symbol","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}' config='{"showSimpleAnalysis": true, "licensedDatasets": false, "physicsOn":false,"identifier":"symbol","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'
network='{"nodes":[{"id":"FOXP3","label":"FOXP3","group":"gene"},{"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}]}' network='{"nodes":[{"id":"FOXP3","label":"FOXP3","group":"gene"},{"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}]}'
> >
</drugst-one> </drugst-one>
...@@ -104,7 +103,7 @@ ...@@ -104,7 +103,7 @@
<!-- <drugst-one id="netexp1"--> <!-- <drugst-one id="netexp1"-->
<!-- pluginId="2"--> <!-- 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"}}}'--> <!-- 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='{"selfReferences": false, "licensedDatasets": false,"physicsOn":false,"identifier":"ensg","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"showLegend":true}'--> <!-- config='{"showSimpleAnalysis": true, "selfReferences": false, "licensedDatasets": false,"physicsOn":false,"identifier":"ensg","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":[]}'--> <!-- 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>-->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment