diff --git a/src/app/components/analysis-panel/analysis-panel.component.html b/src/app/components/analysis-panel/analysis-panel.component.html index a4a979d91cc79c5ef16818e95e8e147a1741e957..7d433bfbd9e5661cf4b83edf08aa5ea5498af11a 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.html +++ b/src/app/components/analysis-panel/analysis-panel.component.html @@ -1,5 +1,5 @@ <div *ngIf="token"> - <div class="card analysis"> + <div class="card analysis" [ngClass]="{'fullscreen': fullscreen}"> <header class="card-header"> <p class="card-header-title"> <span class="icon"> @@ -12,17 +12,50 @@ (click)="analysis.removeTask(token); close()" class="card-header-icon" aria-label="delete" + pTooltip="Delete analysis" + [tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'" + tooltipPosition="left" > <span class="icon has-text-danger" title="Delete analysis"> <i class="fas fa-trash" aria-hidden="true"></i> </span> </a> - <a (click)="close()" class="card-header-icon" aria-label="close"> + <a + (click)="close()" + class="card-header-icon" + aria-label="close" + pTooltip="Close analysis" + [tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'" + tooltipPosition="left" + > <span class="icon" title="Close analysis"> <i class="fas fa-times color-danger" aria-hidden="true"></i> </span> </a> + + <a + pTooltip="Open in fullscreen" + [tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'" + tooltipPosition="left" + *ngIf="!fullscreen" + (click)="toggleFullscreen()" + class="card-header-icon" + > + <span class="icon is-small"> + <i class="fas fa-expand"></i> + </span> + </a> + <a + title="close fullscreen" + *ngIf="fullscreen" + (click)="toggleFullscreen()" + class="card-header-icon" + > + <span class="icon is-small"> + <i class="fas fa-compress"></i> + </span> + </a> </header> <div class="card-content tab-header-small" @@ -49,13 +82,17 @@ <div *ngIf="task"> <div class="columns m-1"> <div class="column content"> - <h4 - class="is-4 has-text-weight-bold" - > - <span class="icon"> - <i class="fas fa-wrench" aria-hidden="true"></i> - </span> - {{(['quick', 'super', 'connect', 'connectSelected'].indexOf(task.info.algorithm) === -1) ? 'Algorithm:' : 'Method:' }} + <h4 class="is-4 has-text-weight-bold"> + <span class="icon"> + <i class="fas fa-wrench" aria-hidden="true"></i> + </span> + {{ + ["quick", "super", "connect", "connectSelected"].indexOf( + task.info.algorithm + ) === -1 + ? "Algorithm:" + : "Method:" + }} {{ algorithmNames[task.info.algorithm] }} </h4> </div> @@ -64,156 +101,177 @@ <div class="column"> <table class="table is-narrow"> <tbody> - <tr - *ngIf=" + <tr + *ngIf=" result && result.geneInteractionDataset !== undefined " - > - <td>Protein-Protein Interaction Dataset</td> - <td> - {{ result.geneInteractionDataset.name }} (Version - {{ result.geneInteractionDataset.version }}) - </td> - </tr> - <tr - *ngIf=" + > + <td>Protein-Protein Interaction Dataset</td> + <td> + {{ result.geneInteractionDataset.name }} (Version + {{ result.geneInteractionDataset.version }}) + </td> + </tr> + <tr + *ngIf=" result && result.drugInteractionDataset !== undefined " - > - <td>Protein-Drug Interaction Dataset</td> - <td> - {{ result.drugInteractionDataset.name }} (Version - {{ result.drugInteractionDataset.version }}) - </td> - </tr> - <tr *ngIf="task.info.parameters.resultSize !== undefined"> - <td>Result Size</td> - <td>{{ task.info.parameters.resultSize }}</td> - </tr> - <tr *ngIf="task.info.parameters.k !== undefined"> - <td>K</td> - <td>{{ task.info.parameters.k }}</td> - </tr> - <tr *ngIf="task.info.parameters.numTrees !== undefined"> - <td>Number of trees</td> - <td>{{ task.info.parameters.numTrees }}</td> - </tr> - <tr *ngIf="task.info.parameters.tolerance !== undefined"> - <td>Tolerance</td> - <td>{{ task.info.parameters.tolerance }}</td> - </tr> - <tr *ngIf="task.info.parameters.dampingFactor !== undefined"> - <td>Damping Factor</td> - <td>{{ task.info.parameters.dampingFactor }}</td> - </tr> - <tr *ngIf="task.info.parameters.maxDeg !== undefined"> - <td>Maximum Degree</td> - <td>{{ task.info.parameters.maxDeg }}</td> - </tr> - <tr *ngIf="task.info.parameters.hubPenalty !== undefined"> - <td>Hub Penality</td> - <td>{{ task.info.parameters.hubPenalty }}</td> - </tr> - <tr - *ngIf=" + > + <td>Protein-Drug Interaction Dataset</td> + <td> + {{ result.drugInteractionDataset.name }} (Version + {{ result.drugInteractionDataset.version }}) + </td> + </tr> + <tr *ngIf="task.info.parameters.resultSize !== undefined"> + <td>Result Size</td> + <td>{{ task.info.parameters.resultSize }}</td> + </tr> + <tr *ngIf="task.info.parameters.k !== undefined"> + <td>K</td> + <td>{{ task.info.parameters.k }}</td> + </tr> + <tr *ngIf="task.info.parameters.numTrees !== undefined"> + <td>Number of trees</td> + <td>{{ task.info.parameters.numTrees }}</td> + </tr> + <tr *ngIf="task.info.parameters.tolerance !== undefined"> + <td>Tolerance</td> + <td>{{ task.info.parameters.tolerance }}</td> + </tr> + <tr *ngIf="task.info.parameters.dampingFactor !== undefined"> + <td>Damping Factor</td> + <td>{{ task.info.parameters.dampingFactor }}</td> + </tr> + <tr *ngIf="task.info.parameters.maxDeg !== undefined"> + <td>Maximum Degree</td> + <td>{{ task.info.parameters.maxDeg }}</td> + </tr> + <tr *ngIf="task.info.parameters.hubPenalty !== undefined"> + <td>Hub Penality</td> + <td>{{ task.info.parameters.hubPenalty }}</td> + </tr> + <tr + *ngIf=" task.info.parameters.includeIndirectDrugs !== undefined && task.info.target === 'drug' " - > - <td>Include indirect drugs</td> - <td> - <i - *ngIf="task.info.parameters.includeIndirectDrugs" - class="fa fa-check" - ></i> - <i - *ngIf="!task.info.parameters.includeIndirectDrugs" - class="fa fa-times color-danger" - ></i> - </td> - </tr> - <tr - *ngIf=" + > + <td>Include indirect drugs</td> + <td> + <i + *ngIf="task.info.parameters.includeIndirectDrugs" + class="fa fa-check" + ></i> + <i + *ngIf="!task.info.parameters.includeIndirectDrugs" + class="fa fa-times color-danger" + ></i> + </td> + </tr> + <tr + *ngIf=" task.info.parameters.includeNonApprovedDrugs !== undefined && task.info.target === 'drug' " - > - <td>Include non-approved drugs</td> - <td> - <i - *ngIf="task.info.parameters.includeNonApprovedDrugs" - class="fa fa-check" - ></i> - <i - *ngIf="!task.info.parameters.includeNonApprovedDrugs" - class="fa fa-times color-danger" - ></i> - </td> - </tr> + > + <td>Include non-approved drugs</td> + <td> + <i + *ngIf="task.info.parameters.includeNonApprovedDrugs" + class="fa fa-check" + ></i> + <i + *ngIf="!task.info.parameters.includeNonApprovedDrugs" + class="fa fa-times color-danger" + ></i> + </td> + </tr> + <tr *ngIf="task.info.parameters.customEdges !== undefined"> + <td>Include all displayed edges</td> + <td> + <i + *ngIf="task.info.parameters.customEdges" + class="fa fa-check" + ></i> + <i + *ngIf="!task.info.parameters.customEdges" + class="fa fa-times color-danger" + ></i> + </td> + </tr> </tbody> </table> </div> </div> - <div class="columns m-1" - *ngIf="['quick','super','connect','connectSelected'].indexOf(task.info.algorithm) > -1" + <div + class="columns m-1" + *ngIf=" + ['quick', 'super', 'connect', 'connectSelected'].indexOf( + task.info.algorithm + ) > -1 + " > <div class="column"> <h4 class="is-4 has-text-weight-bold"> - <span class="icon"> - <i class="fas fa-wrench" aria-hidden="true"></i> - </span> + <span class="icon"> + <i class="fas fa-wrench" aria-hidden="true"></i> + </span> Algorithm: {{ algorithmNames["multisteiner"] }} </h4> <table class="table is-narrow"> <tbody> - <tr> - <td>Number of Trees</td> - <td>1</td> - </tr> - <tr> - <td>Tolerance</td> - <td>0</td> - </tr> - <tr> - <td>Hub Penality</td> - <td>1</td> - </tr> + <tr> + <td>Number of Trees</td> + <td>1</td> + </tr> + <tr> + <td>Tolerance</td> + <td>0</td> + </tr> + <tr> + <td>Hub Penality</td> + <td>1</td> + </tr> </tbody> </table> </div> </div> - <div class="columns m-1" *ngIf="['quick','super'].indexOf(task.info.algorithm) > -1"> + <div + class="columns m-1" + *ngIf="['quick', 'super'].indexOf(task.info.algorithm) > -1" + > <div class="column"> <h4 class="is-4 has-text-weight-bold"> - <span class="icon"> - <i class="fas fa-wrench" aria-hidden="true"></i> - </span> + <span class="icon"> + <i class="fas fa-wrench" aria-hidden="true"></i> + </span> Algorithm: {{ algorithmNames["closeness"] }} </h4> <table class="table is-narrow"> <tbody> - <tr> - <td>Include indirect drugs</td> - <td> - <i class="fa fa-times"></i> - </td> - </tr> - <tr> - <td>Include non-approved drugs</td> - <td> - <i class="fa fa-check"></i> - </td> - </tr> - <tr> - <td>Hub Penality</td> - <td>1</td> - </tr> - <tr> - <td>Result Size</td> - <td>10</td> - </tr> + <tr> + <td>Include indirect drugs</td> + <td> + <i class="fa fa-times"></i> + </td> + </tr> + <tr> + <td>Include non-approved drugs</td> + <td> + <i class="fa fa-check"></i> + </td> + </tr> + <tr> + <td>Hub Penality</td> + <td>1</td> + </tr> + <tr> + <td>Result Size</td> + <td>10</td> + </tr> </tbody> </table> </div> @@ -223,10 +281,7 @@ <div class="tab-content" [class.is-visible]="tab === 'network'"> <!-- network start --> - <app-network - networkType="analysis" - [nodeData]="nodeData" - ></app-network> + <app-network networkType="analysis" [nodeData]="nodeData"></app-network> <!-- network end --> </div> <div @@ -263,16 +318,16 @@ class="button is-rounded has-tooltip is-small" pTooltip="Normalize the scores" [tooltipStyleClass]=" - 'drgstn drgstn-tooltip drgstn-tooltip-top' - " + '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 class="icon is-small"> + <i class="fa fa-ruler-vertical"></i> + </span> <span>Normalization On</span> </button> </p> @@ -281,8 +336,8 @@ class="button is-rounded has-tooltip is-small" pTooltip="Disable normalization of the scores." [tooltipStyleClass]=" - 'drgstn drgstn-tooltip drgstn-tooltip-top' - " + 'drgstn drgstn-tooltip drgstn-tooltip-top' + " tooltipPosition="top" [class.is-primary]="!tableNormalize" (click)="toggleNormalization(false)" @@ -339,16 +394,16 @@ class="button is-rounded has-tooltip is-small" pTooltip="Normalize the scores" [tooltipStyleClass]=" - 'drgstn drgstn-tooltip drgstn-tooltip-top' - " + '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 class="icon is-small"> + <i class="fa fa-ruler-vertical"></i> + </span> <span>Normalization On</span> </button> </p> @@ -357,8 +412,8 @@ class="button is-rounded has-tooltip is-small" pTooltip="Disable normalization of the scores." [tooltipStyleClass]=" - 'drgstn drgstn-tooltip drgstn-tooltip-top' - " + 'drgstn drgstn-tooltip drgstn-tooltip-top' + " tooltipPosition="top" [class.is-primary]="!tableNormalize" (click)="toggleNormalization(false)" diff --git a/src/app/components/analysis-panel/analysis-panel.component.scss b/src/app/components/analysis-panel/analysis-panel.component.scss index 92b3e1380674851115135894a532fd7e87761833..8794e59bc14356bf3723af66c9aa38c199be6133 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.scss +++ b/src/app/components/analysis-panel/analysis-panel.component.scss @@ -6,6 +6,15 @@ width: 100% !important; } +.fullscreen{ + position: fixed !important; + height: 100vh !important; + width: 100vw !important; + top: 0 !important; + left: 0 !important; + z-index: $fullscreen-z; +} + .tab-header-small { padding: 0 !important; } diff --git a/src/app/components/analysis-panel/analysis-panel.component.ts b/src/app/components/analysis-panel/analysis-panel.component.ts index 1745bcbaa9cf5bd400ea6a2708456f1f1ddd2b93..23ff59ce9977cd3066f47a077c9d4113aec5be2c 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.ts +++ b/src/app/components/analysis-panel/analysis-panel.component.ts @@ -80,6 +80,8 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit public result: any = null; public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig)); + public fullscreen = false; + public network: any; public nodeData: { nodes: any, edges: any } = {nodes: null, edges: null}; // private drugNodes: any[] = []; @@ -505,4 +507,9 @@ export class AnalysisPanelComponent implements OnInit, OnChanges, AfterViewInit this.analysis.addItems(addItems); this.analysis.removeItems(removeItems); } + + public toggleFullscreen() { + this.fullscreen = !this.fullscreen; + console.log('this.fullscreen', this.fullscreen) + } } diff --git a/src/app/components/network/network-legend/network-legend.component.html b/src/app/components/network/network-legend/network-legend.component.html index 89ca0d45f68329b5b9b532bb8259ef90ad43a039..f1c1912d84206f342365e90e057d4dd56e062d53 100644 --- a/src/app/components/network/network-legend/network-legend.component.html +++ b/src/app/components/network/network-legend/network-legend.component.html @@ -73,6 +73,13 @@ ... </span> </th> + <th *ngSwitchCase="'ellipse'"> + <span + class="node ellipse" + [style.background-color]="nodeGroup.value.color.background" + > + </span> + </th> <th *ngSwitchDefault> <span class="node {{ nodeGroup.value.shape }}" diff --git a/src/app/components/task-list/task-list.component.scss b/src/app/components/task-list/task-list.component.scss index ec5bceefa372b1f007e9ec671231569e201a1783..156944455feb7c65ed424cacf38260cd0af95c47 100644 --- a/src/app/components/task-list/task-list.component.scss +++ b/src/app/components/task-list/task-list.component.scss @@ -20,7 +20,7 @@ font-size: 10px; max-width: 215px; max-height: 30px; - overflow: scroll; + overflow-y: scroll; border: 1px solid var(--drgstn-border); display: inline-block; } diff --git a/src/app/config.ts b/src/app/config.ts index 6a5b84be6641137c609c734be38bb923b4440248..23f8f306c06f1206adabf7d010ec1aa71aa55bfa 100644 --- a/src/app/config.ts +++ b/src/app/config.ts @@ -72,6 +72,7 @@ export interface IConfig { nodeGroups: { [key: string]: NodeGroup }; edgeGroups: { [key: string]: EdgeGroup }; selfReferences: boolean; + customEdges: {default: boolean, selectable: boolean}; interactionDrugProtein: InteractionDrugProteinDB; interactionProteinProtein: InteractionProteinProteinDB; indicationDrugDisorder: IndicationDrugDisorderDB; @@ -162,6 +163,7 @@ export const defaultConfig: IConfig = { networkMenuButtonAnimationLabel: 'Animation', identifier: 'symbol', selfReferences: false, + customEdges: {default: true, selectable: true}, interactionDrugProtein: 'NeDRex', interactionProteinProtein: 'NeDRex', indicationDrugDisorder: 'NeDRex', diff --git a/src/app/dialogs/launch-analysis/launch-analysis.component.html b/src/app/dialogs/launch-analysis/launch-analysis.component.html index e7e3a040c39b7fe4710576a143f989bee2404195..728696d6c0aed4dae6af2a0e942ca301f709b9be 100644 --- a/src/app/dialogs/launch-analysis/launch-analysis.component.html +++ b/src/app/dialogs/launch-analysis/launch-analysis.component.html @@ -27,7 +27,7 @@ <div [class.is-active]="algorithm === algo.slug" *ngFor="let algo of algorithms" - class="is-fullwidth" + class="is-fullwidth algorithm-button" > <a (click)="algorithm = algo.slug" class="is-boxed is-medium"> {{ algo.name }} @@ -162,6 +162,25 @@ </div> <p class="has-text-info is-size-7">Penalty parameter for hubs.</p> </div> + + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="trustrankCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> </div> <div *ngIf="algorithm === 'closeness'"> @@ -261,6 +280,25 @@ </div> <p class="has-text-info is-size-7">Penalty parameter for hubs.</p> </div> + + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="closenessCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> </div> <div *ngIf="algorithm === 'degree'"> @@ -327,6 +365,25 @@ Disabled if equal to 0. </p> </div> + + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="degreeCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> </div> <div *ngIf="algorithm === 'proximity'"> @@ -407,6 +464,25 @@ </div> <p class="has-text-info is-size-7">Penalty parameter for hubs.</p> </div> + + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="proximityCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> </div> <div *ngIf="algorithm === 'betweenness'"> @@ -477,6 +553,25 @@ </div> <p class="has-text-info is-size-7">Penalty parameter for hubs.</p> </div> + + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="betweennessCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> </div> <div *ngIf="algorithm === 'keypathwayminer'"> @@ -537,8 +632,9 @@ <p> The Multi-level Steiner Tree algorithm can be used to approximate a minimum spanning subnetwork between seed - nodes, which happen to be central interaction partners between the seed nodes, and thus represent - favorable drug-targets (Ahmed et al. 2019). + nodes, which happen to be central interaction partners + between the seed nodes, and thus represent favorable + drug-targets (Ahmed et al. 2019). </p> </div> </div> @@ -627,8 +723,26 @@ </div> <p class="has-text-info is-size-7">Penalty parameter for hubs.</p> </div> - </div> + <div + class="field" + *ngIf="drugstoneConfig.config.customEdges.selectable" + > + <label class="label">Include all displayed edges</label> + <app-toggle + textOn="Include" + textOff="Ignore" + tooltipOn="Use all edges from the visualized network and the Drugst.One database." + tooltipOff="Use only Drugst.One edges." + [(value)]="multisteinerCustomEdges" + > + </app-toggle> + <p class="has-text-info is-size-7"> + Include PPI edges from displayed network in the algorithms or + use only edges from the Drugst.One database. + </p> + </div> + </div> </div> </div> </section> diff --git a/src/app/dialogs/launch-analysis/launch-analysis.component.scss b/src/app/dialogs/launch-analysis/launch-analysis.component.scss index f6c5d8357a2a165de67d433986f253fca3dbecdd..c1aefe6b67d008f0669916eea5a1c155e7db2478 100644 --- a/src/app/dialogs/launch-analysis/launch-analysis.component.scss +++ b/src/app/dialogs/launch-analysis/launch-analysis.component.scss @@ -23,7 +23,3 @@ margin-top: 15px; font-size: 11px; } - -div.is-active { - background-color: var(--drgstn-primary); -} diff --git a/src/app/dialogs/launch-analysis/launch-analysis.component.ts b/src/app/dialogs/launch-analysis/launch-analysis.component.ts index 273822d56a599c053baa142ec9968bcf603143a0..752cdf6ef2c3a31c590d983dba855b2d2af6592a 100644 --- a/src/app/dialogs/launch-analysis/launch-analysis.component.ts +++ b/src/app/dialogs/launch-analysis/launch-analysis.component.ts @@ -17,6 +17,9 @@ import {NetworkHandlerService} from "../../services/network-handler/network-hand }) export class LaunchAnalysisComponent implements OnInit, OnChanges { + constructor(public analysis: AnalysisService, public drugstoneConfig: DrugstoneConfigService, public networkHandler: NetworkHandlerService) { + } + @Input() public show = false; @Input() @@ -33,37 +36,38 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { // Trustrank Parameters public trustrankIncludeIndirectDrugs = false; public trustrankIncludeNonApprovedDrugs = false; - public trustrankIncludeViralNonSeeds = true; public trustrankDampingFactor = 0.85; public trustrankMaxDeg = 0; public trustrankHubPenalty = 0.0; public trustrankResultSize = 20; + public trustrankCustomEdges = this.drugstoneConfig.config.customEdges.default; // Closeness Parameters public closenessIncludeIndirectDrugs = false; public closenessIncludeNonApprovedDrugs = false; - public closenessIncludeViralNonSeeds = true; public closenessMaxDeg = 0; public closenessHubPenalty = 0.0; public closenessResultSize = 20; + public closenessCustomEdges = this.drugstoneConfig.config.customEdges.default; // Degree Parameters public degreeIncludeNonApprovedDrugs = false; - public degreeIncludeViralNonSeeds = true; public degreeMaxDeg = 0; public degreeResultSize = 20; + public degreeCustomEdges = this.drugstoneConfig.config.customEdges.default; // Network proximity public proximityIncludeNonApprovedDrugs = false; public proximityMaxDeg = 0; public proximityHubPenalty = 0.0; public proximityResultSize = 20; + public proximityCustomEdges = this.drugstoneConfig.config.customEdges.default; // Betweenness Parameters - public betweennessIncludeViralNonSeeds = true; public betweennessMaxDeg = 0; public betweennessHubPenalty = 0.0; public betweennessResultSize = 20; + public betweennessCustomEdges = this.drugstoneConfig.config.customEdges.default; // Keypathwayminer Parameters public keypathwayminerK = 5; @@ -71,15 +75,12 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { // Multisteiner Parameters public multisteinerNumTrees = 5; public multisteinerTolerance = 10; - public multisteinerIncludeViralNonSeeds = true; public multisteinerMaxDeg = 0; public multisteinerHubPenalty = 0.0; + public multisteinerCustomEdges = this.drugstoneConfig.config.customEdges.default; public maxTasks = MAX_TASKS; - constructor(public analysis: AnalysisService, public drugstoneConfig: DrugstoneConfigService, public networkHandler: NetworkHandlerService) { - } - ngOnInit(): void { } @@ -115,6 +116,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { config: this.drugstoneConfig.config, input_network: this.networkHandler.activeNetwork.inputNetwork }; + console.log(parameters) parameters.ppi_dataset = this.drugstoneConfig.config.interactionProteinProtein; parameters.pdi_dataset = this.drugstoneConfig.config.interactionDrugProtein; parameters.licenced = this.drugstoneConfig.config.licensedDatasets; @@ -137,6 +139,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { } parameters.hub_penalty = this.trustrankHubPenalty; parameters.result_size = this.trustrankResultSize; + parameters.custom_edges = this.trustrankCustomEdges; } else if (this.algorithm === 'closeness') { parameters.include_indirect_drugs = this.closenessIncludeIndirectDrugs; parameters.include_non_approved_drugs = this.closenessIncludeNonApprovedDrugs; @@ -145,12 +148,14 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { } parameters.hub_penalty = this.closenessHubPenalty; parameters.result_size = this.closenessResultSize; + parameters.custom_edges = this.closenessCustomEdges; } else if (this.algorithm === 'degree') { parameters.include_non_approved_drugs = this.degreeIncludeNonApprovedDrugs; if (this.degreeMaxDeg && this.degreeMaxDeg > 0) { parameters.max_deg = this.degreeMaxDeg; } parameters.result_size = this.degreeResultSize; + parameters.custom_edges = this.degreeCustomEdges; } else if (this.algorithm === 'proximity') { parameters.include_non_approved_drugs = this.proximityIncludeNonApprovedDrugs; if (this.proximityMaxDeg && this.proximityMaxDeg > 0) { @@ -158,12 +163,14 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { } parameters.hub_penalty = this.proximityHubPenalty; parameters.result_size = this.proximityResultSize; + parameters.custom_edges = this.proximityCustomEdges; } else if (this.algorithm === 'betweenness') { if (this.betweennessMaxDeg && this.betweennessMaxDeg > 0) { parameters.max_deg = this.betweennessMaxDeg; } parameters.hub_penalty = this.betweennessHubPenalty; parameters.result_size = this.betweennessResultSize; + parameters.custom_edges = this.betweennessCustomEdges; } else if (this.algorithm === 'keypathwayminer') { parameters.k = this.keypathwayminerK; } else if (this.algorithm === 'multisteiner') { @@ -173,6 +180,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { parameters.max_deg = this.multisteinerMaxDeg; } parameters.hub_penalty = this.multisteinerHubPenalty; + parameters.custom_edges = this.multisteinerCustomEdges; } const token = await this.analysis.startAnalysis(this.algorithm, this.target, parameters); const object = { taskId: token, algorithm: this.algorithm, target: this.target, params: parameters }; diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index 0687ed358f32a13b64b6f8af1436e057bf6a37ce..82cf955590889b0b59b24050ce07dca17326dabb 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -1,6 +1,5 @@ <div id="appWindow" (window:resize)="onResize($event)"> <div class="is-hidden-mobile fullheight" id="appContainer"> - <app-license-agreement></app-license-agreement> <app-launch-analysis @@ -10,7 +9,6 @@ > </app-launch-analysis> - <app-add-expressed-proteins [(show)]="showThresholdDialog" [selectedTissue]="networkHandler.activeNetwork.currentViewSelectedTissue" @@ -190,9 +188,15 @@ </div> </div> - <app-quick-drug-target *ngIf="drugstoneConfig.config.showConnectGenes" (taskEvent)="emitTaskEvent($event)"></app-quick-drug-target> + <app-quick-drug-target + *ngIf="drugstoneConfig.config.showConnectGenes" + (taskEvent)="emitTaskEvent($event)" + ></app-quick-drug-target> - <app-quick-drug *ngIf="drugstoneConfig.config.showSimpleAnalysis" (taskEvent)="emitTaskEvent($event)"></app-quick-drug> + <app-quick-drug + *ngIf="drugstoneConfig.config.showSimpleAnalysis" + (taskEvent)="emitTaskEvent($event)" + ></app-quick-drug> <div *ngIf="drugstoneConfig.config.showAdvAnalysis" @@ -465,17 +469,18 @@ </i> </div> - <footer class="card-footer"> - <!-- <a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary" - tooltipPosition="top" pTooltip="Invert the current selection."> + <a + (click)="analysis.invertSelection(networkHandler.activeNetwork.currentViewNodes)" + class="card-footer-item text-primary" + tooltipPosition="top" + pTooltip="Invert the current selection." + > <span class="icon"> <i class="fa fa-sync"></i> </span> - <span> - Invert - </span> - </a> --> + <span> Invert </span> + </a> <a *ngIf="analysis.getSelection().length" (click)="analysis.resetSelection()" @@ -510,10 +515,7 @@ ></app-analysis-panel> </div> <!-- explorer network --> - <app-network - networkType="explorer" - [nodeData]="nodeData" - ></app-network> + <app-network networkType="explorer" [nodeData]="nodeData"></app-network> </div> <!-- End network block --> diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index f43a78c29d1298d881fa41f788397398912fc418..6a521affe27571a63a15086fdf7fab440842ad3b 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -466,7 +466,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { * @param key * @param values */ - public setConfigNodeGroup(key: string, nodeGroups: { [key: string]: NodeGroup }) { + public setConfigNodeGroup(key: string, nodeGroups: { [key: string]: NodeGroup } | {}) { // make sure that return-groups (seeds, drugs, found nodes) are set const defaultNodeGroups = JSON.parse(JSON.stringify(defaultConfig.nodeGroups)); // user merge function to do deep merge diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts index b8c3735130b2b8cfe022e05e9828e59752d7e58c..40ac700e1cb0bc2a6e4f31bb86d3ca5e7c282577 100644 --- a/src/app/services/analysis/analysis.service.ts +++ b/src/app/services/analysis/analysis.service.ts @@ -177,16 +177,20 @@ export class AnalysisService { public invertSelection(nodes) { const newSelection = []; nodes.forEach((node: Node) => { + if (node.drugstoneType !== 'protein') { + // only consider proteins + return + } const wrapper = getWrapperFromNode(node); if (!this.inSelection(wrapper)) { newSelection.push(wrapper); } }); - this.selectedItems.clear(); + this.resetSelection() for (const wrapper of newSelection) { - this.selectedItems.set(wrapper.nodeId, wrapper); + this.selectedItems.set(wrapper.id, wrapper); } - this.selectListSubject.next({items: newSelection, selected: null}); + this.selectListSubject.next({items: newSelection, selected: true}); } resetSelection() { @@ -249,6 +253,7 @@ export class AnalysisService { target: target, num_trees: 5, tolerance: 10, + custom_edges: this.drugstoneConfig.config.customEdges.default, }; diff --git a/src/index.html b/src/index.html index 77d89d189a44887565c3f17d5a554c361f47fa8f..c1f77a357967d3d484f724238a6d7b7f00ff4157 100644 --- a/src/index.html +++ b/src/index.html @@ -92,9 +92,9 @@ <drugst-one id="netexp1" pluginId="2" - groups='{"nodeGroups":{"patient":{"type":"patient","color":"#000000","font":{"color":"#000000"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png"},"condition":{"type":"condition","color":"#000000","font":{"color":"#000000"},"groupName":"Condition","shape":"text"},"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"},"foundDrug":{"type":"drug","color":"#F12590","font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"genotype":{"color":"#000000","groupName":"Relevant Gene"},"has-condition":{"color":"#000000","groupName":"Has Condition","dashes":[2,2]},"default":{"color":"#000000","groupName":"default edge"},"ggi":{"color":"#000000","groupName":"Interaction","dashes":[3,2]}}}' + groups='{"nodeGroups":{"patient":{"type":"patient","color":"#000000","font":{"color":"#000000"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png"},"condition":{"type":"condition","color":"#000000","font":{"color":"#000000"},"groupName":"Condition","shape":"text"},"important":{"type":"gene","color":"#ff881f","font":{"color":"#000000"},"groupName":"Important Gene","shape":"ellipse"},"gene":{"type":"gene","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Gene","shape":"circle"},"foundDrug":{"type":"drug","color":"#F12590","font":{"color":"#000000"},"groupName":"Drug","shape":"diamond"}},"edgeGroups":{"genotype":{"color":"#000000","groupName":"Relevant Gene"},"has-condition":{"color":"#000000","groupName":"Has Condition","dashes":[2,2]},"default":{"color":"#000000","groupName":"default edge"},"ggi":{"color":"#000000","groupName":"Interaction","dashes":[3,2]}}}' config='{"expandNetworkMenu": false, "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"},{"id":"patient-1","group":"patient","x":592,"y":446},{"id":"patient-2","group":"patient","x":235,"y":87},{"id":"patient-3","group":"patient","x":105,"y":369},{"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},{"id":"subtype-1","label":"Subtype 1","group":"condition","x":556,"y":171},{"id":"subtype-2","label":"Subtype 2","group":"condition","x":-87,"y":221}],"edges":[{"from":"BRCA1","to":"BRCA2","group":"ggi"},{"from":"ATM","to":"BARD1","group":"ggi"},{"from":"BRCA1","to":"CHEK2","group":"ggi"},{"from":"RAD51C","to":"RAD51D","group":"ggi"},{"from":"STK11","to":"TP53","group":"ggi"},{"from":"TP53","to":"PALB2","group":"ggi"},{"from":"TP53","to":"RAD51D","group":"ggi"},{"from":"TP53","to":"NF1","group":"ggi"},{"from":"TP53","to":"BRCA1","group":"ggi"},{"from":"TP53","to":"BRCA2","group":"ggi"},{"from":"PTEN","to":"BRCA1","group":"ggi"},{"from":"PTEN","to":"BRCA2","group":"ggi"},{"from":"TP53","to":"PTEN","group":"ggi"},{"from":"ATM","to":"PTEN","group":"ggi"},{"from":"CDH1","to":"RAD51D","group":"ggi"},{"from":"CDH1","to":"PALB2","group":"ggi"},{"from":"NBN","to":"BRIP1","group":"ggi"},{"from":"BRIP1","to":"PTEN","group":"ggi"},{"from":"patient-1","to":"BRCA1","group":"genotype"},{"from":"patient-1","to":"TP53","group":"genotype"},{"from":"patient-1","to":"BRCA2","group":"genotype"},{"from":"patient-1","to":"PTEN","group":"genotype"},{"from":"patient-2","to":"TP53","group":"genotype"},{"from":"patient-2","to":"NF1","group":"genotype"},{"from":"patient-2","to":"BARD1","group":"genotype"},{"from":"patient-3","to":"TP53","group":"genotype"},{"from":"patient-3","to":"PTEN","group":"genotype"},{"from":"patient-3","to":"NBN","group":"genotype"},{"from":"patient-1","to":"subtype-1","group":"has-condition"},{"from":"patient-2","to":"subtype-1","group":"has-condition"},{"from":"patient-3","to":"subtype-2","group":"has-condition"}]}' + network='{"nodes":[{"id": "FOXP3"},{"id":"patient-1","group":"patient","x":592,"y":446},{"id":"patient-2","group":"patient","x":235,"y":87},{"id":"patient-3","group":"patient","x":105,"y":369},{"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},{"id":"subtype-1","label":"Subtype 1","group":"condition","x":556,"y":171},{"id":"subtype-2","label":"Subtype 2","group":"condition","x":-87,"y":221}],"edges":[{"from":"PTEN","to":"NBN","group":"ggi"}, {"from":"patient-3","to":"subtype-2","group":"has-condition"}]}' > </drugst-one> diff --git a/src/stylesheets/styles.scss b/src/stylesheets/styles.scss index 1acb530f787a809aaf875a81357d6266d6272277..c0a751a175469a03d6f6a9bfcf765f6dd779ed29 100644 --- a/src/stylesheets/styles.scss +++ b/src/stylesheets/styles.scss @@ -255,3 +255,5 @@ padding: 0.5rem 1rem; line-height: 24px; } + + diff --git a/src/stylesheets/theme-styles.scss b/src/stylesheets/theme-styles.scss index 1da0834c14566bd20a41035ba75fc4c4e7a7e711..38a35385d64cd33a74b43279d056871df5eeb542 100644 --- a/src/stylesheets/theme-styles.scss +++ b/src/stylesheets/theme-styles.scss @@ -55,14 +55,14 @@ border-color: var(--drgstn-border) !important; } - .fa-spinner { - color: var(--drgstn-secondary) !important; - } - .tabs.is-toggle a:hover { background-color: var(--drgstn-panel) !important; } + .fa-spinner { + color: var(--drgstn-secondary) !important; + } + .tabs li a { border-bottom: none; } @@ -178,7 +178,6 @@ color: var(--drgstn-text-secondary) !important; } - .text-primary { color: var(--drgstn-primary) !important; } @@ -263,12 +262,10 @@ } } - .ng-select.ng-select-opened > .ng-select-container .ng-arrow { border-bottom-color: var(--drgstn-text-primary) !important; } - ::-webkit-scrollbar { width: 10px !important; } @@ -293,8 +290,18 @@ .toast-times { color: var(--drgstn-text-secondary) !important; } + + .algorithm-button.is-active { + a { + background-color: var(--drgstn-primary) !important; + } + a:hover { + background-color: var(--drgstn-primary) !important; + } + } } + // scrolllbar styles network-expander { --thumbBG: var(--drgstn-primary) !important; diff --git a/src/stylesheets/variables.scss b/src/stylesheets/variables.scss index 93a9ab0380f2d390beee98d9b7257b31995d6e11..6c28503c3cfdbd7329f335e66298a85fcb3130cb 100644 --- a/src/stylesheets/variables.scss +++ b/src/stylesheets/variables.scss @@ -50,7 +50,7 @@ $legend-triangle-height: 29px; $legend-hexagon-font-size: 38px; $legend-diamond-size: 25px; $legend-scaling: 0.8; -$legend-scaling-small: 0.6; +$legend-scaling-small: 0.75; $height: 100%;