Skip to content

Commit

Permalink
bugfix for custom_edges input bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiykol committed Oct 9, 2024
1 parent 3fe6770 commit e0acf39
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drugstone/management/commands/import_from_nedrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def add_dpi(edge):
if update and e.__hash__() in existing:
if existing[e.__hash__()] != e:
delete.add(existing[e.__hash__()])
del existing[e.__hash__()]
del existing[e.__hash__()]
else:
return
if not update or e.__hash__() not in existing:
Expand Down
5 changes: 4 additions & 1 deletion tasks/betweenness_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,14 @@ def betweenness_centrality(task_hook: TaskHook):

search_target = task_hook.parameters.get("target", "drug-target")

filterPaths = task_hook.parameters.get("filter_paths", True)
filterPaths = task_hook.parameters.get("filter_paths", True)

id_space = task_hook.parameters["config"].get("identifier","symbol")

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down
3 changes: 3 additions & 0 deletions tasks/closeness_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def closeness_centrality(task_hook: TaskHook):
id_space = task_hook.parameters["config"].get("identifier", "symbol")

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down
3 changes: 3 additions & 0 deletions tasks/degree_centrality.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ def degree_centrality(task_hook: TaskHook):
filterPaths = task_hook.parameters.get("filter_paths", True)

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down
3 changes: 3 additions & 0 deletions tasks/multi_steiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def multi_steiner(task_hook: TaskHook):
node_name_attribute = "internal_id" # nodes in the input network which is created from RepoTrialDB have primaryDomainId as name attribute

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down
3 changes: 3 additions & 0 deletions tasks/network_proximity.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def network_proximity(task_hook: TaskHook):
filter_paths = task_hook.parameters.get("filter_paths", True)

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down
3 changes: 3 additions & 0 deletions tasks/trust_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ def trust_rank(task_hook: TaskHook):
filter_paths = task_hook.parameters.get("filter_paths", True)

custom_edges = task_hook.parameters.get("custom_edges", False)
if custom_edges:
if not isinstance(custom_edges, list):
custom_edges = False

no_default_edges = task_hook.parameters.get("exclude_drugstone_ppi_edges", False)

Expand Down

0 comments on commit e0acf39

Please sign in to comment.