Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
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
Show more breadcrumbs
Cosy-Bio
Drugst.One
backend
Commits
527b60cb
Commit
527b60cb
authored
2 years ago
by
AndiMajore
Browse files
Options
Downloads
Patches
Plain Diff
fixed seed issue at quick drug search
parent
b856cde6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker-django.env.dev
+1
-1
1 addition, 1 deletion
docker-django.env.dev
drugstone/views.py
+2
-0
2 additions, 0 deletions
drugstone/views.py
tasks/quick_task.py
+10
-4
10 additions, 4 deletions
tasks/quick_task.py
with
13 additions
and
5 deletions
docker-django.env.dev
+
1
−
1
View file @
527b60cb
...
...
@@ -15,4 +15,4 @@ CELERY_BROKER_URL=redis://redis:6379/0
FLOWER_PORT=8888
FLOWER_BASIC_AUTH=drugstone:test
GT_THREADS=2
DB_UPDATE_ON_START=1
\ No newline at end of file
DB_UPDATE_ON_START=0
\ No newline at end of file
This diff is collapsed.
Click to expand it.
drugstone/views.py
+
2
−
0
View file @
527b60cb
...
...
@@ -291,7 +291,9 @@ def result_view(request) -> Response:
if
not
node_types
:
node_types
=
{}
node_attributes
[
'
node_types
'
]
=
node_types
is_seed
=
node_attributes
.
get
(
'
is_seed
'
)
print
(
result
)
if
not
is_seed
:
is_seed
=
{}
node_attributes
[
'
is_seed
'
]
=
is_seed
...
...
This diff is collapsed.
Click to expand it.
tasks/quick_task.py
+
10
−
4
View file @
527b60cb
from
tasks.task_hook
import
TaskHook
def
quick_task
(
task_hook
:
TaskHook
):
def
run_closeness
(
parameters
,
network
):
def
run_closeness
(
parameters
,
network
,
original_seeds
=
None
):
from
.closeness_centrality
import
closeness_centrality
def
closeness_progress
(
progress
,
status
):
...
...
@@ -9,6 +10,8 @@ def quick_task(task_hook: TaskHook):
def
closeness_set_result
(
result
):
result
[
"
network
"
][
"
edges
"
].
extend
(
network
[
"
edges
"
])
if
original_seeds
is
not
None
:
result
[
'
node_attributes
'
][
'
is_seed
'
]
=
original_seeds
task_hook
.
set_results
(
result
)
# Prepare intermediate hook
...
...
@@ -20,7 +23,6 @@ def quick_task(task_hook: TaskHook):
# Run closeness centrality
closeness_centrality
(
closeness_task_hook
)
def
run_multi_steiner
(
parameters
):
from
.multi_steiner
import
multi_steiner
...
...
@@ -35,7 +37,7 @@ def quick_task(task_hook: TaskHook):
if
len
(
seeds
)
==
0
:
task_hook
.
set_results
({
"
network
"
:
{
"
nodes
"
:
[],
"
edges
"
:
[]}})
return
og_seeds
=
parameters
.
get
(
'
seeds
'
)
parameters
.
update
({
"
seeds
"
:
seeds
,
"
result_size
"
:
10
,
...
...
@@ -43,7 +45,11 @@ def quick_task(task_hook: TaskHook):
"
target
"
:
"
drug
"
,
"
include_non_approved_drugs
"
:
True
})
run_closeness
(
parameters
,
result
[
"
network
"
])
is_seed
=
result
.
get
(
'
node_attributes
'
)
run_closeness
(
parameters
,
result
[
"
network
"
],
result
[
'
node_attributes
'
][
'
is_seed
'
])
# parameters.update({
# "seeds": og_seeds
# })
parameters
[
"
num_trees
"
]
=
1
parameters
[
"
hub_penalty
"
]
=
1
...
...
This diff is collapsed.
Click to expand it.
Maier, Andreas
@bba1660
mentioned in commit
4d3f856e
·
1 year ago
mentioned in commit
4d3f856e
mentioned in commit 4d3f856efc4b98ec9fdbce555de260083b98c72f
Toggle commit list
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