Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Sep 3, 2024
1 parent 059c0fc commit d786ec9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spras/omicsintegrator2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion test/parse-outputs/test_parse_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
assert filecmp.cmp(out_file, RAW_PATHS_EXPDIR + f"oi2-expected-empty.txt", shallow=False)

0 comments on commit d786ec9

Please sign in to comment.