Skip to content

Commit 14a6dfb

Browse files
committed
fix: correct flag
1 parent 2a81c07 commit 14a6dfb

File tree

5 files changed

+26
-19
lines changed

5 files changed

+26
-19
lines changed

config/config.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ container_registry:
3737
# combinations. For instance if we have the following:
3838
# - name: "myAlg"
3939
# params:
40-
# include: true
40+
# include: false
4141
# a: [1,2]
4242
# b: [0.5,0.75]
4343
#
@@ -47,13 +47,13 @@ container_registry:
4747
algorithms:
4848
- name: "pathlinker"
4949
params:
50-
include: true
50+
include: false
5151
run1:
5252
k: range(100,201,100)
5353

5454
- name: "omicsintegrator1"
5555
params:
56-
include: true
56+
include: false
5757
run1:
5858
b: [5, 6]
5959
w: np.linspace(0,5,2)
@@ -62,7 +62,7 @@ algorithms:
6262

6363
- name: "omicsintegrator2"
6464
params:
65-
include: true
65+
include: false
6666
run1:
6767
b: 4
6868
g: 0
@@ -72,15 +72,15 @@ algorithms:
7272

7373
- name: "meo"
7474
params:
75-
include: true
75+
include: false
7676
run1:
7777
max_path_length: 3
7878
local_search: "Yes"
7979
rand_restarts: 10
8080

8181
- name: "mincostflow"
8282
params:
83-
include: true
83+
include: false
8484
run1:
8585
flow: 1 # The flow must be an int
8686
capacity: 1
@@ -91,7 +91,7 @@ algorithms:
9191

9292
- name: "domino"
9393
params:
94-
include: true
94+
include: false
9595
run1:
9696
slice_threshold: 0.3
9797
module_threshold: 0.05
@@ -149,17 +149,17 @@ reconstruction_settings:
149149
analysis:
150150
# Create one summary per pathway file and a single summary table for all pathways for each dataset
151151
summary:
152-
include: true
152+
include: false
153153
# Create output files for each pathway that can be visualized with GraphSpace
154154
graphspace:
155-
include: true
155+
include: false
156156
# Create Cytoscape session file with all pathway graphs for each dataset
157157
cytoscape:
158-
include: true
158+
include: false
159159
# Machine learning analysis (e.g. clustering) of the pathway output files for each dataset
160160
ml:
161161
# ml analysis per dataset
162-
include: true
162+
include: false
163163
# adds ml analysis per algorithm output
164164
# only runs for algorithms with multiple parameter combinations chosen
165165
aggregate_per_algorithm: true
@@ -175,7 +175,7 @@ analysis:
175175
evaluation:
176176
# evaluation per dataset-goldstandard pair
177177
# evaluation will not run unless ml include is set to true
178-
include: true
178+
include: false
179179
# adds evaluation per algorithm per dataset-goldstandard pair
180180
# evaluation per algortihm will not run unless ml include and ml aggregate_per_algorithm are set to true
181181
aggregate_per_algorithm: true

spras/allpairs.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def generate_inputs(data: Dataset, filename_map):
5959
# signal to `run` that the graph is directed.
6060
if has_direction(edges_df):
6161
edges_df = convert_undirected_to_directed(edges_df)
62-
# we also touch a 'directed_flag.txt' file to say that this is directed
63-
Path(filename_map['directed_flag']).touch()
62+
# we write to a 'directed_flag.txt' file to say that this is directed
63+
Path(filename_map['directed_flag']).write_text("true")
64+
else:
65+
Path(filename_map['directed_flag']).write_text("false")
6466

6567
# This is pretty memory intensive. We might want to keep the interactome centralized.
6668
edges_df.to_csv(filename_map["network"], sep="\t", index=False,
@@ -76,7 +78,7 @@ def run(nodetypes=None, network=None, directed_flag=None, output_file=None, cont
7678
@param container_framework: choose the container runtime framework, currently supports "docker" or "singularity" (optional)
7779
@param output_file: path to the output pathway file (required)
7880
"""
79-
if not nodetypes or not network or not output_file:
81+
if not nodetypes or not network or not output_file or not directed_flag:
8082
raise ValueError('Required All Pairs Shortest Paths arguments are missing')
8183

8284
work_dir = '/apsp'
@@ -100,7 +102,7 @@ def run(nodetypes=None, network=None, directed_flag=None, output_file=None, cont
100102
'--network', network_file,
101103
'--nodes', node_file,
102104
'--output', mapped_out_file]
103-
if directed_flag and Path(directed_flag).exists():
105+
if Path(directed_flag).read_text().strip() == "true":
104106
command.append("--directed")
105107

106108
container_suffix = "allpairs:v4"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
true

test/AllPairs/test_ap.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_allpairs(self):
4848
AllPairs.run(
4949
nodetypes=str(TEST_DIR / 'input' / 'sample-in-nodetypes.txt'),
5050
network=str(TEST_DIR / 'input' / 'sample-in-net.txt'),
51+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-false.txt'),
5152
output_file=str(out_path)
5253
)
5354
assert out_path.exists()
@@ -70,6 +71,7 @@ def test_allpairs_singularity(self):
7071
AllPairs.run(
7172
nodetypes=str(TEST_DIR / 'input' / 'sample-in-nodetypes.txt'),
7273
network=str(TEST_DIR / 'input' / 'sample-in-net.txt'),
74+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-false.txt'),
7375
output_file=str(out_path),
7476
container_framework="singularity")
7577
assert out_path.exists()
@@ -83,6 +85,7 @@ def test_allpairs_singularity_unpacked(self):
8385
AllPairs.run(
8486
nodetypes=str(TEST_DIR / 'input/sample-in-nodetypes.txt'),
8587
network=str(TEST_DIR / 'input/sample-in-net.txt'),
88+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-false.txt'),
8689
output_file=str(out_path),
8790
container_framework="singularity")
8891
config.config.unpack_singularity = False
@@ -104,6 +107,7 @@ def test_allpairs_correctness(self):
104107
AllPairs.run(
105108
nodetypes=str(TEST_DIR / 'input' / 'correctness-nodetypes.txt'),
106109
network=str(TEST_DIR / 'input' / 'correctness-network.txt'),
110+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-false.txt'),
107111
output_file=str(OUT_DIR / 'correctness-out.txt')
108112
)
109113

@@ -113,13 +117,11 @@ def test_allpairs_directed(self):
113117
out_path = OUT_DIR / 'directed-out.txt'
114118
out_path.unlink(missing_ok=True)
115119

116-
OUT_DIR.joinpath('directed-flag.txt').touch()
117-
118120
AllPairs.run(
119121
nodetypes=str(TEST_DIR / 'input' / 'directed-nodetypes.txt'),
120122
network=str(TEST_DIR / 'input' / 'directed-network.txt'),
123+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-true.txt'),
121124
output_file=str(OUT_DIR / 'directed-out.txt'),
122-
directed_flag=str(OUT_DIR / 'directed-flag.txt')
123125
)
124126

125127
edge_equality_test_util(out_path, EXPECTED_DIR.joinpath('directed-expected.txt'))
@@ -137,6 +139,7 @@ def test_allpairs_zero_length(self):
137139
AllPairs.run(
138140
nodetypes=TEST_DIR / 'input' / 'zero-length-nodetypes.txt',
139141
network=TEST_DIR / 'input' / 'zero-length-network.txt',
142+
directed_flag=str(TEST_DIR / 'input' / 'directed-flag-false.txt'),
140143
output_file=OUT_DIR / 'zero-length-out.txt'
141144
)
142145

0 commit comments

Comments
 (0)