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 generator.py #206

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/pyBiodatafuse/graph/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,8 @@ def save_graph(
:param disease_compound: the input DataFrame containing disease-compound relationships.
:param graph_name: the name of the graph.
:param graph_dir: the directory to save the graph.
:returns: a NetworkX MultiDiGraph

"""
graph_path = f"{graph_dir}/{graph_name}"
os.makedirs(graph_path, exist_ok=True)
Expand All @@ -965,3 +967,5 @@ def save_graph(
pickle.dump(g, f)
nx.write_gml(g, graph_path_gml)
logger.warning(f"Graph saved in {graph_path_pickle} and {graph_path_gml}")

return g