Skip to content

Commit

Permalink
update mcf wrapper code
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Jan 24, 2024
1 parent 879f1b5 commit 32bd0e6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spras/mincostflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ def generate_inputs(data, filename_map):
# create the network of edges
edges = data.get_interactome()

# Format network edges
edges = convert_undirected_to_directed(edges)

# creates the edges files that contains the head and tail nodes and the weights after them
edges.to_csv(filename_map['edges'], sep='\t', index=False, columns=["Interactor1", "Interactor2", "Weight"],
edges.to_csv(filename_map['edges'], sep='\t', index=False, columns=["Interactor1", "Interactor2", "Weight", "Direction"],
header=False)

@staticmethod
Expand Down Expand Up @@ -152,8 +149,5 @@ def parse_output(raw_pathway_file, standardized_pathway_file):

df = pd.read_csv(raw_pathway_file, sep='\t', header=None)
df = add_rank_column(df)
# TODO update MinCostFlow version to support mixed graphs
# Currently directed edges in the input will be converted to undirected edges in the output
df = reinsert_direction_col_undirected(df)
df.to_csv(standardized_pathway_file, header=False, index=False, sep='\t')
df.to_csv(standardized_pathway_file, header=True, index=False, sep='\t')

0 comments on commit 32bd0e6

Please sign in to comment.