Skip to content

Commit

Permalink
updated genereate inputs test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Nov 7, 2024
1 parent 28321e0 commit 2a1aeab
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Interactor1 Interactor2 Weight
A B 0.98
test_A B 0.98
B C 0.77
2 changes: 1 addition & 1 deletion test/generate-inputs/expected/domino-network-expected.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ID_interactor_A ppi ID_interactor_B
ENSG0A ppi ENSG0B
ENSG0test_A ppi ENSG0B
ENSG0B ppi ENSG0C
2 changes: 1 addition & 1 deletion test/generate-inputs/expected/meo-edges-expected.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
A (pp) B 0.98
test꧁SEP꧂A (pp) B 0.98
B (pp) C 0.77
4 changes: 2 additions & 2 deletions test/generate-inputs/expected/mincostflow-edges-expected.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A B 0.98
test_A B 0.98
B C 0.77
B A 0.98
B test_A 0.98
C B 0.77
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
protein1 protein2 weight directionality
A B 0.98 U
test_A B 0.98 U
B C 0.77 U
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
protein1 protein2 cost
A B 0.52
test_A B 0.52
B C 0.73
4 changes: 2 additions & 2 deletions test/generate-inputs/expected/pathlinker-network-expected.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Interactor1 Interactor2 Weight
A B 0.98
test_A B 0.98
B C 0.77
B A 0.98
B test_A 0.98
C B 0.77
2 changes: 2 additions & 0 deletions test/generate-inputs/inputs/network.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test_A B 0.98 U
B C 0.77 U
3 changes: 3 additions & 0 deletions test/generate-inputs/inputs/node-prizes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODEID prize active
test_A 2 true
C 5.7 true
1 change: 1 addition & 0 deletions test/generate-inputs/inputs/sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_A
1 change: 1 addition & 0 deletions test/generate-inputs/inputs/targets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C
69 changes: 69 additions & 0 deletions test/generate-inputs/inputs/test_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
hash_length: 7
container_framework: docker
unpack_singularity: false
container_registry:
base_url: docker.io
owner: reedcompbio

algorithms:
- name: "pathlinker"
params:
include: true
run1:
k: range(100,201,100)

- name: "omicsintegrator1"
params:
include: true
run1:
b: [5, 6]
w: np.linspace(0,5,2)
d: [10]

- name: "omicsintegrator2"
params:
include: true
run1:
b: [4]
g: [0]
run2:
b: [2]
g: [3]

- name: "meo"
params:
include: true
run1:
max_path_length: [3]
local_search: ["Yes"]
rand_restarts: [10]

- name: "mincostflow"
params:
include: true
run1:
flow: [1] # The flow must be an int
capacity: [1]

- name: "allpairs"
params:
include: true

- name: "domino"
params:
include: true
run1:
slice_threshold: [0.3]
module_threshold: [0.05]

datasets:
-
# Labels can only contain letters, numbers, or underscores
label: test_data
node_files: ["node-prizes.txt", "sources.txt", "targets.txt"]
# DataLoader.py can currently only load a single edge file, which is the primary network
edge_files: ["network.txt"]
# Placeholder
other_files: []
# Relative path from the spras directory
data_dir: "test/generate-inputs/inputs"
6 changes: 3 additions & 3 deletions test/generate-inputs/test_generate_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def setup_class(cls):
Path(OUTDIR).mkdir(parents=True, exist_ok=True)

def test_prepare_inputs_networks(self):
config_loc = os.path.join("config", "config.yaml")
config_loc = os.path.join("test","generate-inputs", "inputs", "test_config.yaml")

with open(config_loc) as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
test_file = "test/generate-inputs/output/test_pickled_dataset.pkl"

data0_dataset = next((ds for ds in config["datasets"] if ds["label"] == "data0"), None)
runner.merge_input(data0_dataset, test_file)
test_dataset = next((ds for ds in config["datasets"] if ds["label"] == "test_data"), None)
runner.merge_input(test_dataset, test_file)

for algo in algo_exp_file.keys():
inputs = runner.get_required_inputs(algo)
Expand Down

0 comments on commit 2a1aeab

Please sign in to comment.