-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added parse_output tests and still fixing generate inputs
- Loading branch information
Showing
17 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
S1 A 1 U | ||
S1 B 1 U | ||
A E 1 U | ||
A F 1 U | ||
E T1 1 U | ||
T1 F 1 U | ||
F T2 1 U | ||
F B 1 U | ||
B S2 1 U | ||
S2 T3 1 U |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GENEA GENEC 1 U | ||
GENEC GENEB 1 U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
B A 1 D | ||
D B 1 D |
2 changes: 2 additions & 0 deletions
2
test/ParseOutputs/expected/omicsintegrator1-pathway-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
A C 1 U | ||
C D 1 U |
2 changes: 2 additions & 0 deletions
2
test/ParseOutputs/expected/omicsintegrator2-pathway-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
B A 1 U | ||
B C 1 U |
17 changes: 17 additions & 0 deletions
17
test/ParseOutputs/expected/pathlinker-pathway-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
S2 T3 1 D | ||
A E 2 D | ||
S1 A 2 D | ||
E T1 2 D | ||
B F 3 D | ||
F T2 3 D | ||
S2 B 3 D | ||
C F 4 D | ||
S2 C 4 D | ||
C G 5 D | ||
G T2 5 D | ||
G T3 6 D | ||
E F 7 D | ||
B C 8 D | ||
F E 11 D | ||
G F 13 D | ||
F A 16 D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
S1 A | ||
S1 B | ||
A E | ||
A F | ||
E T1 | ||
T1 F | ||
F T2 | ||
F B | ||
B S2 | ||
S2 T3 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Source Type Target Oriented Weight | ||
GENEA pp GENEC true 0.5 | ||
GENEC pp GENEB true 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
B A | ||
D B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
A pp C | ||
C pp D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
protein1 protein2 cost in_solution | ||
B A 0.52 True | ||
B C 0.73 True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#tail head KSP index path cost | ||
S2 T3 1 5.00000e-01 | ||
A E 2 1.25000e-01 | ||
S1 A 2 1.25000e-01 | ||
E T1 2 1.25000e-01 | ||
B F 3 1.25000e-01 | ||
F T2 3 1.25000e-01 | ||
S2 B 3 1.25000e-01 | ||
C F 4 1.25000e-01 | ||
S2 C 4 1.25000e-01 | ||
C G 5 1.25000e-01 | ||
G T2 5 1.25000e-01 | ||
G T3 6 1.25000e-01 | ||
E F 7 6.25000e-02 | ||
B C 8 6.25000e-02 | ||
F E 11 6.25000e-02 | ||
G F 13 6.25000e-02 | ||
F A 16 3.12500e-02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import filecmp | ||
import os | ||
import shutil | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from src import runner | ||
from src.domino import DOMINO, post_domino_id_transform, pre_domino_id_transform | ||
INDIR = "test/ParseOutputs/input/" | ||
OUTDIR = "test/ParseOutputs/output/" | ||
EXPDIR = "test/ParseOutputs/expected/" | ||
|
||
# for domino | ||
OUT_FILE_PARSE = OUTDIR+'/domino-parse-output.txt' | ||
OUT_FILE_PARSE_EXP = EXPDIR + '/domino-parse-output.txt' | ||
|
||
algorithms = ['mincostflow', 'meo', 'omicsintegrator1', "omicsintegrator2", "pathlinker", "allpairs"] | ||
class TestParseOutputs: | ||
def setup_class(cls): | ||
""" | ||
Create the expected output directory | ||
""" | ||
Path(OUTDIR).mkdir(parents=True, exist_ok=True) | ||
|
||
def test_parse_outputs(self): | ||
|
||
# skip domino | ||
for algo in algorithms: | ||
# inputs = runner.get_required_inputs(algo) | ||
test_file = INDIR + f"{algo}-raw-pathway.txt" | ||
out_file = OUTDIR + f"{algo}-pathway.txt" | ||
print(out_file) | ||
runner.parse_output(algo, test_file, out_file) | ||
assert filecmp.cmp(OUTDIR +f"{algo}-pathway.txt", EXPDIR + f"{algo}-pathway-expected.txt") | ||
|
||
def test_domino_parse_output(self): | ||
# Input is the concatenated module_0.html and module_1.html file from | ||
# the DOMINO output of the network dip.sif and the nodes tnfa_active_genes_file.txt | ||
# from https://github.com/Shamir-Lab/DOMINO/tree/master/examples | ||
# Confirms the generated output matches the expected output | ||
out_path = Path(OUT_FILE_PARSE) | ||
out_path.unlink(missing_ok=True) | ||
DOMINO.parse_output( | ||
INDIR+ 'domino-concat-modules.txt', | ||
OUT_FILE_PARSE) | ||
assert filecmp.cmp(OUT_FILE_PARSE, OUT_FILE_PARSE_EXP, shallow=False) |