From 7316eff0769f1d4be0a06088b219f8355fffb6b0 Mon Sep 17 00:00:00 2001 From: nanglo123 Date: Thu, 19 Sep 2024 11:42:05 -0400 Subject: [PATCH] Remove duplicate script --- docker/generate_obo_graphs.py | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 docker/generate_obo_graphs.py diff --git a/docker/generate_obo_graphs.py b/docker/generate_obo_graphs.py deleted file mode 100644 index 1d51a264..00000000 --- a/docker/generate_obo_graphs.py +++ /dev/null @@ -1,32 +0,0 @@ -from pyobo import get_version -from pyobo.getters import _ensure_ontology_path -from pathlib import Path -from obonet import read_obo -import networkx -import pickle - - -def download_convert_ncbitaxon_obo_to_graph(): - resource_prefix = "ncbitaxon" - version = get_version(resource_prefix) - - # Checks to see if the pickled ncbitaxon obo graph exists in the container - cached_relabeled_obo_graph_path = Path("/graphs/ncbitaxon_obo_graph.pkl") - if not cached_relabeled_obo_graph_path.exists(): - _, obo_path = _ensure_ontology_path( - resource_prefix, force=False, version=version - ) - obo_graph = read_obo(obo_path) - - # Normalize node indices - relabeled_graph = networkx.relabel_nodes( - obo_graph, lambda node_index: node_index.lower() - ) - with open( - cached_relabeled_obo_graph_path, "wb" - ) as relabeled_graph_file: - pickle.dump(relabeled_graph, relabeled_graph_file) - - -if __name__ == "__main__": - download_convert_ncbitaxon_obo_to_graph()