Skip to content

Commit

Permalink
fixed error oi2 error
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Sep 3, 2024
1 parent b202639 commit ea88614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions spras/omicsintegrator2.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ def parse_output(raw_pathway_file, standardized_pathway_file):
"""
# Omicsintegrator2 returns a single line file if no network is found
num_lines = sum(1 for line in open(raw_pathway_file))
df = pd.read_csv(raw_pathway_file, sep='\t', header=0)
print(df)
# Omicsintegrator2 has corrupted output, list of correct column names and order
# Omicsintegrator2 has corrupted output; list of correct column names and order
correct_columns = ['protein1', 'protein2', 'cost', 'in_solution']

if num_lines < 2:
Expand Down
5 changes: 3 additions & 2 deletions test/parse-outputs/test_parse_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

algorithms = ['mincostflow', 'meo', 'omicsintegrator1', 'omicsintegrator2', 'pathlinker', 'allpairs', 'domino']


class TestParseOutputs:
@classmethod
def setup_class(cls):
Expand All @@ -38,14 +39,14 @@ def test_empty_file(self):
runner.parse_output(algo, test_file, out_file)
assert filecmp.cmp(OUTDIR + f"{algo}-empty-pathway.txt", EXPDIR + f"empty-pathway-expected.txt", shallow=False)

def test_oi2_miss_insolution_parse_output(self):
def test_oi2_miss_insolution(self):
test_file = RAW_PATHS_INDIR + f"oi2-miss-insolution.txt"
out_file = OUTDIR + f"oi2-miss-insolution-pathway.txt"

runner.parse_output('omicsintegrator2', test_file, out_file)
assert filecmp.cmp(out_file, EXPDIR + f"empty-pathway-expected.txt", shallow=False)

def test_oi2_wrong_order_parse_output(self):
def test_oi2_wrong_order(self):
test_file = RAW_PATHS_INDIR + f"oi2-wrong-order.txt"
out_file = OUTDIR + f"oi2-wrong-order-pathway.txt"

Expand Down

0 comments on commit ea88614

Please sign in to comment.