Skip to content
Snippets Groups Projects
Commit 0499fc98 authored by AndiMajore's avatar AndiMajore
Browse files

fixing quick and super start option

parent d8bdd5e6
No related branches found
No related tags found
No related merge requests found
......@@ -250,7 +250,7 @@
"
>
<button
(click)="analysis.startQuickAnalysis(true, null)"
(click)="analysis.startQuickAnalysis(true, drugstoneConfig.config,{ nodes: proteins, edges: edges })"
[disabled]="analysis.isLaunchingQuick()"
class="button is-white is-rounded has-tooltip quick-start-btn"
pTooltip="Find drugs for all proteins."
......@@ -341,7 +341,7 @@
"
>
<button
(click)="analysis.startQuickAnalysis(false, null)"
(click)="analysis.startQuickAnalysis(false, drugstoneConfig.config,{ nodes: proteins, edges: edges })"
[disabled]="
analysis.getCount() === 0 ||
analysis.isLaunchingQuick()
......
......@@ -5,6 +5,7 @@ import {environment} from '../../../environments/environment';
import {toast} from 'bulma-toast';
import {Injectable} from '@angular/core';
import {NetexControllerService} from '../netex-controller/netex-controller.service';
import {IConfig} from "../../config";
export type AlgorithmType =
'trustrank'
......@@ -207,7 +208,7 @@ export class AnalysisService {
});
}
async startQuickAnalysis(isSuper: boolean, dataset: Dataset) {
async startQuickAnalysis(isSuper: boolean, config: IConfig, network: any) {
if (!this.canLaunchTask()) {
toast({
message: `You can only run ${MAX_TASKS} tasks at once. Please wait for one of them to finish or delete it from the task list.`,
......@@ -221,29 +222,20 @@ export class AnalysisService {
return;
}
if (dataset == null) {
toast({
message: `Passed dataset is null. This feature might be still under development.`,
duration: 5000,
dismissible: true,
pauseOnHover: true,
type: 'is-danger',
position: 'top-center',
animate: {in: 'fadeIn', out: 'fadeOut'}
});
return;
}
this.launchingQuick = true;
const params = {
ppi_dataset: config.interactionProteinProtein,
pdi_dataset: config.interactionDrugProtein,
config: config,
input_network: network,
seeds: isSuper ? network.nodes.filter(n => n.drugstoneId && n.drugstoneId[0] === 'p').map(n => n.drugstoneId) : this.getSelection().map((i) => i.id),
};
console.log(params)
const resp = await this.http.post<any>(`${environment.backend}task/`, {
algorithm: isSuper ? 'super' : 'quick',
target: 'drug',
parameters: {
strain_or_drugs: dataset.id,
bait_datasets: dataset.data,
seeds: isSuper ? [] : this.getSelection().map((i) => i.id),
},
parameters: params,
}).toPromise();
this.tokens.push(resp.token);
localStorage.setItem(this.tokensCookieKey, JSON.stringify(this.tokens));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment