diff --git a/spras/omicsintegrator2.py b/spras/omicsintegrator2.py index 1e1e2d20..d02f793c 100644 --- a/spras/omicsintegrator2.py +++ b/spras/omicsintegrator2.py @@ -158,12 +158,12 @@ def parse_output(raw_pathway_file, standardized_pathway_file): else: df = pd.read_csv(raw_pathway_file, sep='\t', header=0) if (len(df.columns) == len(correct_columns)) and all(df.columns == correct_columns): - df = df[df['in_solution'] == True] # Check whether this column can be empty before revising this line + df = df[df['in_solution'] == True] # Check whether this column can be empty before revising this line df = df.take([0, 1], axis=1) df = add_rank_column(df) df = reinsert_direction_col_undirected(df) df.columns = ['Node1', 'Node2', 'Rank', "Direction"] - else: + else: df = pd.DataFrame(columns=['Node1', 'Node2', 'Rank', 'Direction']) df.to_csv(standardized_pathway_file, header=True, index=False, sep='\t') diff --git a/test/parse-outputs/test_parse_outputs.py b/test/parse-outputs/test_parse_outputs.py index b636c2cd..5da74ec5 100644 --- a/test/parse-outputs/test_parse_outputs.py +++ b/test/parse-outputs/test_parse_outputs.py @@ -61,4 +61,4 @@ def test_oi2_wrong_order_parse_output(self): test_file = RAW_PATHS_INDIR + f"oi2-wrong-order.txt" out_file = OUTDIR + f"oi2-wrong-order-pathway.txt" runner.parse_output('omicsintegrator2', test_file, out_file) - assert filecmp.cmp(out_file, RAW_PATHS_EXPDIR + f"oi2-expected-empty.txt", shallow=False) \ No newline at end of file + assert filecmp.cmp(out_file, RAW_PATHS_EXPDIR + f"oi2-expected-empty.txt", shallow=False)