Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Mar 13, 2024
1 parent c183abf commit 01ad342
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spras/omicsintegrator1.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def parse_output(raw_pathway_file, standardized_pathway_file):
# I'm assuming from having read the documentation that we will be passing in optimalForest.sif
# as raw_pathway_file, in which case the format should be edge1 interactiontype edge2.
# if that assumption is wrong we will need to tweak things


df = raw_pathway_df(raw_pathway_file, header=None)
if not df.empty:
Expand Down
8 changes: 4 additions & 4 deletions spras/omicsintegrator2.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def parse_output(raw_pathway_file, standardized_pathway_file):
num_lines = sum(1 for line in open(raw_pathway_file))
if num_lines < 2:
df = pd.DataFrame(columns = ['Node1', 'Node2', 'Rank', 'Direction'])
else:
else:
df = pd.read_csv(raw_pathway_file, sep='\t', header=0)
df = df[df['in_solution'] == True] # Check whether this column can be empty before revising this line
df = add_rank_column(df)
df = add_rank_column(df)
df = reinsert_direction_col_undirected(df)
df.drop(columns=['cost', 'in_solution'], inplace = True)
df.columns = ['Node1', 'Node2', 'Rank', "Direction"]

df.to_csv(standardized_pathway_file, header=True, index=False, sep='\t')

0 comments on commit 01ad342

Please sign in to comment.