diff --git a/spras/mincostflow.py b/spras/mincostflow.py index e3c75708..744db736 100644 --- a/spras/mincostflow.py +++ b/spras/mincostflow.py @@ -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 @@ -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')