Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MCF Wrapper Code #144

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')

Loading