Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Cosy-Bio
Drugst.One
plugin
Commits
0499fc98
Commit
0499fc98
authored
2 years ago
by
AndiMajore
Browse files
Options
Downloads
Patches
Plain Diff
fixing quick and super start option
parent
d8bdd5e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/pages/explorer-page/explorer-page.component.html
+2
-2
2 additions, 2 deletions
src/app/pages/explorer-page/explorer-page.component.html
src/app/services/analysis/analysis.service.ts
+12
-20
12 additions, 20 deletions
src/app/services/analysis/analysis.service.ts
with
14 additions
and
22 deletions
src/app/pages/explorer-page/explorer-page.component.html
+
2
−
2
View file @
0499fc98
...
@@ -250,7 +250,7 @@
...
@@ -250,7 +250,7 @@
"
"
>
>
<button
<button
(click)=
"analysis.startQuickAnalysis(true,
null
)"
(click)=
"analysis.startQuickAnalysis(true,
drugstoneConfig.config,{ nodes: proteins, edges: edges }
)"
[disabled]=
"analysis.isLaunchingQuick()"
[disabled]=
"analysis.isLaunchingQuick()"
class=
"button is-white is-rounded has-tooltip quick-start-btn"
class=
"button is-white is-rounded has-tooltip quick-start-btn"
pTooltip=
"Find drugs for all proteins."
pTooltip=
"Find drugs for all proteins."
...
@@ -341,7 +341,7 @@
...
@@ -341,7 +341,7 @@
"
"
>
>
<button
<button
(click)=
"analysis.startQuickAnalysis(false,
null
)"
(click)=
"analysis.startQuickAnalysis(false,
drugstoneConfig.config,{ nodes: proteins, edges: edges }
)"
[disabled]=
"
[disabled]=
"
analysis.getCount() === 0 ||
analysis.getCount() === 0 ||
analysis.isLaunchingQuick()
analysis.isLaunchingQuick()
...
...
This diff is collapsed.
Click to expand it.
src/app/services/analysis/analysis.service.ts
+
12
−
20
View file @
0499fc98
...
@@ -5,6 +5,7 @@ import {environment} from '../../../environments/environment';
...
@@ -5,6 +5,7 @@ import {environment} from '../../../environments/environment';
import
{
toast
}
from
'
bulma-toast
'
;
import
{
toast
}
from
'
bulma-toast
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
NetexControllerService
}
from
'
../netex-controller/netex-controller.service
'
;
import
{
NetexControllerService
}
from
'
../netex-controller/netex-controller.service
'
;
import
{
IConfig
}
from
"
../../config
"
;
export
type
AlgorithmType
=
export
type
AlgorithmType
=
'
trustrank
'
'
trustrank
'
...
@@ -207,7 +208,7 @@ export class AnalysisService {
...
@@ -207,7 +208,7 @@ export class AnalysisService {
});
});
}
}
async
startQuickAnalysis
(
isSuper
:
boolean
,
dataset
:
Dataset
)
{
async
startQuickAnalysis
(
isSuper
:
boolean
,
config
:
IConfig
,
network
:
any
)
{
if
(
!
this
.
canLaunchTask
())
{
if
(
!
this
.
canLaunchTask
())
{
toast
({
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.`
,
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 {
...
@@ -221,29 +222,20 @@ export class AnalysisService {
return
;
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
;
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/`
,
{
const
resp
=
await
this
.
http
.
post
<
any
>
(
`
${
environment
.
backend
}
task/`
,
{
algorithm
:
isSuper
?
'
super
'
:
'
quick
'
,
algorithm
:
isSuper
?
'
super
'
:
'
quick
'
,
target
:
'
drug
'
,
target
:
'
drug
'
,
parameters
:
{
parameters
:
params
,
strain_or_drugs
:
dataset
.
id
,
bait_datasets
:
dataset
.
data
,
seeds
:
isSuper
?
[]
:
this
.
getSelection
().
map
((
i
)
=>
i
.
id
),
},
}).
toPromise
();
}).
toPromise
();
this
.
tokens
.
push
(
resp
.
token
);
this
.
tokens
.
push
(
resp
.
token
);
localStorage
.
setItem
(
this
.
tokensCookieKey
,
JSON
.
stringify
(
this
.
tokens
));
localStorage
.
setItem
(
this
.
tokensCookieKey
,
JSON
.
stringify
(
this
.
tokens
));
...
@@ -320,7 +312,7 @@ export class AnalysisService {
...
@@ -320,7 +312,7 @@ export class AnalysisService {
const
watch
=
async
()
=>
{
const
watch
=
async
()
=>
{
if
(
this
.
tokens
.
length
>
0
)
{
if
(
this
.
tokens
.
length
>
0
)
{
const
newtasks
=
await
this
.
getTasks
();
const
newtasks
=
await
this
.
getTasks
();
if
(
newtasks
.
length
===
0
)
if
(
newtasks
.
length
===
0
)
return
;
return
;
const
newTaskIds
=
newtasks
.
map
(
t
=>
t
.
token
.
toString
());
const
newTaskIds
=
newtasks
.
map
(
t
=>
t
.
token
.
toString
());
this
.
tasks
=
newtasks
.
concat
(
this
.
tasks
.
filter
(
t
=>
newTaskIds
.
indexOf
(
t
.
token
)
===
-
1
));
this
.
tasks
=
newtasks
.
concat
(
this
.
tasks
.
filter
(
t
=>
newTaskIds
.
indexOf
(
t
.
token
)
===
-
1
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment