From 4bdb82a16dba534bd910c1d74b46cbc5f1c98339 Mon Sep 17 00:00:00 2001 From: Julian Matschinske <ge93nar@mytum.de> Date: Sat, 11 Apr 2020 17:00:07 +0200 Subject: [PATCH] Extend analysis windows --- .../analysis-window.component.html | 52 ++++++++++++++++++- .../analysis-window.component.scss | 11 ++++ .../launch-analysis.component.html | 17 ++++++ .../launch-analysis.component.ts | 2 + src/app/interfaces.ts | 4 +- 5 files changed, 83 insertions(+), 3 deletions(-) diff --git a/src/app/components/analysis-window/analysis-window.component.html b/src/app/components/analysis-window/analysis-window.component.html index 21eb1a40..616582a4 100644 --- a/src/app/components/analysis-window/analysis-window.component.html +++ b/src/app/components/analysis-window/analysis-window.component.html @@ -21,9 +21,9 @@ <li [class.is-active]="tab === 'meta'"><a (click)="tab = 'meta'">Parameters</a></li> </ul> </div> - <div class="content tab-content" *ngIf="task && task.info.done" [class.is-visible]="tab === 'meta'"> + <div class="content tab-content meta" *ngIf="task && task.info.done" [class.is-visible]="tab === 'meta'"> <div *ngIf="task"> - <p> + <p *ngIf="task.info.algorithm !== 'quick' && task.info.algorithm !== 'super'"> Algorithm: <strong>{{algorithmNames[task.info.algorithm]}}</strong> </p> <div> @@ -37,6 +37,10 @@ <td>Number of trees</td> <td>{{task.info.parameters.numTrees}}</td> </tr> + <tr *ngIf="task.info.parameters.tolerance || task.info.parameters.tolerance === 0"> + <td>Tolerance</td> + <td>{{task.info.parameters.tolerance}}</td> + </tr> <tr *ngIf="task.info.parameters.dampingFactor"> <td>Damping Factor</td> <td>{{task.info.parameters.dampingFactor}}</td> @@ -62,6 +66,50 @@ </tbody> </table> </div> + <div *ngIf="task.info.algorithm === 'quick' || task.info.algorithm === 'super'"> + <p> + Algorithm: <strong>{{algorithmNames['multisteiner']}}</strong> + </p> + <table class="table is-narrow"> + <tbody> + <tr> + <td>Number of Trees</td> + <td>5</td> + </tr> + <tr> + <td>Tolerance</td> + <td>10</td> + </tr> + </tbody> + </table> + <p> + Algorithm: <strong>{{algorithmNames['trustrank']}}</strong> + </p> + <table class="table is-narrow"> + <tbody> + <tr> + <td>Damping Factor</td> + <td>0.85</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-times"></i> + </td> + </tr> + <tr> + <td>Result Size</td> + <td>30</td> + </tr> + </tbody> + </table> + </div> </div> </div> <div class="content tab-content" *ngIf="task && task.info.done" [class.is-visible]="tab === 'network'"> diff --git a/src/app/components/analysis-window/analysis-window.component.scss b/src/app/components/analysis-window/analysis-window.component.scss index 09f93625..082e3143 100644 --- a/src/app/components/analysis-window/analysis-window.component.scss +++ b/src/app/components/analysis-window/analysis-window.component.scss @@ -35,3 +35,14 @@ div.network { .checkbox-col { width: 50px; } + +.meta { + table { + width: 500px; + + td { + width: 50px; + } + } + +} diff --git a/src/app/components/launch-analysis/launch-analysis.component.html b/src/app/components/launch-analysis/launch-analysis.component.html index c0269b50..3ed65ba8 100644 --- a/src/app/components/launch-analysis/launch-analysis.component.html +++ b/src/app/components/launch-analysis/launch-analysis.component.html @@ -171,6 +171,23 @@ </div> </div> </div> + <div class="field"> + <label class="label" for="multisteiner-numtrees">Tolerance for trees</label> + <div class="control"> + <div class="select"> + <select id="multisteiner-tolerance" [(ngModel)]="multisteinerTolerance"> + <option [ngValue]="0">0</option> + <option [ngValue]="1">1</option> + <option [ngValue]="2">2</option> + <option [ngValue]="3">3</option> + <option [ngValue]="5">5</option> + <option [ngValue]="10">10</option> + <option [ngValue]="15">15</option> + <option [ngValue]="20">20</option> + </select> + </div> + </div> + </div> </div> </section> diff --git a/src/app/components/launch-analysis/launch-analysis.component.ts b/src/app/components/launch-analysis/launch-analysis.component.ts index 3e6ccaeb..ed3aaace 100644 --- a/src/app/components/launch-analysis/launch-analysis.component.ts +++ b/src/app/components/launch-analysis/launch-analysis.component.ts @@ -50,6 +50,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { // Multisteiner Parameters public multisteinerNumTrees = 5; + public multisteinerTolerance = 10; public hasBaits; @@ -106,6 +107,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { } else if (this.algorithm === 'multisteiner') { parameters.strain_or_drugs = this.dataset; parameters.num_trees = this.multisteinerNumTrees; + parameters.tolerance = this.multisteinerTolerance; } await this.analysis.startAnalysis(this.algorithm, this.target, parameters); diff --git a/src/app/interfaces.ts b/src/app/interfaces.ts index 854ba5c1..4f8c774e 100644 --- a/src/app/interfaces.ts +++ b/src/app/interfaces.ts @@ -1,3 +1,5 @@ +import {AlgorithmType, QuickAlgorithmType} from './analysis.service'; + export type NodeType = 'host' | 'virus' | 'drug'; export interface Protein { @@ -34,7 +36,7 @@ export interface Task { token: string; info: { target: 'drug' | 'drug-target', - algorithm: 'trustrank' | 'multisteiner' | 'keypathwayminer' | 'quick'; + algorithm: AlgorithmType | QuickAlgorithmType; parameters?: { [key: string]: any }; workerId?: string; -- GitLab