From d0c20f18bc7063d5ee4d9c58d916d19f628b8123 Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Tue, 31 Mar 2026 15:14:05 +0200 Subject: [PATCH 1/4] fix(config for BPN): adds parameters to the biopathnet config file + fixes the pyproject for MacOs/ARM computers. --- config/biopathnet.yaml | 4 +++- make.sh | 2 ++ pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/biopathnet.yaml b/config/biopathnet.yaml index 6c3cc50..18a7c40 100644 --- a/config/biopathnet.yaml +++ b/config/biopathnet.yaml @@ -9,9 +9,11 @@ biocypher: root_node: entity biopathnet: - file_format: txt + file_format: txt:bn entity_types_file_stem: entity_types entity_names_file_stem: entity_names background_graph_file_stem: brg skg_file_stem: skg + targeted_relation: "(alteration, variant_biomarker_for_treatment, drug)" + include_properties: False diff --git a/make.sh b/make.sh index 8e5d64a..3c267b7 100755 --- a/make.sh +++ b/make.sh @@ -78,6 +78,8 @@ fi echo "Weave data..." >&2 +echo "CONFIG = $CONFIG" >&2 + cmd="uv run python3 ${py_args} $script_dir/weave.py \ --config $CONFIG \ --short-mutations-local $decider_dir/short_mutations_local.csv \ diff --git a/pyproject.toml b/pyproject.toml index c0b074c..9060199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "seaborn>=0.13.2,<0.14", "ontoweaver>=1.3.0,<1.4.0", "openpyxl>=3.1.5", - "pyarrow<21.0.0", + "pyarrow>20.0.0", "fastparquet<2026.3.0", ] From ef7744f014b90363fa63c0a9606404ed1dd281ec Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Tue, 31 Mar 2026 20:06:30 +0200 Subject: [PATCH 2/4] feat(fetch all datasources): Adds all the datasource to the make.sh script. --- make.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/make.sh b/make.sh index 2d5df70..fec908a 100755 --- a/make.sh +++ b/make.sh @@ -81,17 +81,17 @@ echo "Weave data..." >&2 echo "CONFIG = $CONFIG" >&2 cmd="uv run python3 ${py_args} $script_dir/weave.py \ - --omnipath-networks $data_dir/omnipath_networks/subset_omnipath_networks_different_type_entity_type_source_and_entity_type_target_shorter.tsv \ + --omnipath-networks $data_dir/omnipath_networks/omnipath_networks_different_type_entity_type_source_and_entity_type_target_shorter.tsv \ + --copy-number-amplifications-external $decider_dir/cnas_external.csv \ + --short-mutations-local $decider_dir/short_mutations_local.csv \ + --short-mutations-external $decider_dir/short_mutations_external.csv \ + --copy-number-amplifications-local $decider_dir/cnas_local.csv \ + --structural-variants $decider_dir/structural_variants.xlsx \ + --open-targets-drug-molecule $data_dir/OT/drug_molecule/ + --open-targets-drug_mechanism_of_action $data_dir/OT/drug_mechanism_of_action/ + --open-targets-target $data_dir/OT/target/ --config $CONFIG \ ${weave_args}" # \ - # --copy-number-amplifications-external $decider_dir/cnas_external.csv \ - # --short-mutations-local $decider_dir/short_mutations_local.csv \ - # --short-mutations-external $decider_dir/short_mutations_external.csv \ - # --copy-number-amplifications-local $decider_dir/cnas_local.csv \ - # --structural-variants $decider_dir/structural_variants.xlsx \ - # --open-targets-drug-molecule $data_dir/OT/drug_molecule/ - # --open-targets-drug_mechanism_of_action $data_dir/OT/drug_mechanism_of_action/ - # --open-targets-target $data_dir/OT/target/ # --cgi $decider_dir/treatments_cgi.csv \ # --clinical $data_dir/DECIDER/clinical/clinical_export.xlsx \ # --oncokb $data_dir/DECIDER/$data_version/treatments.csv \ From 71a55d86ec55df6926dcca7c37f92ca1857f69b2 Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Wed, 1 Apr 2026 17:36:32 +0200 Subject: [PATCH 3/4] fix(config & make): Fixes the biopathnet config file and make.sh to script to enable the export of oncodashkb into a BioPathNet set of input files. --- config/biopathnet.yaml | 2 +- make.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/biopathnet.yaml b/config/biopathnet.yaml index 18a7c40..7d87237 100644 --- a/config/biopathnet.yaml +++ b/config/biopathnet.yaml @@ -14,6 +14,6 @@ biopathnet: entity_names_file_stem: entity_names background_graph_file_stem: brg skg_file_stem: skg - targeted_relation: "(alteration, variant_biomarker_for_treatment, drug)" + targeted_relation: "(alteration, variant biomarker for treatment, drug)" include_properties: False diff --git a/make.sh b/make.sh index fec908a..a7b5ad3 100755 --- a/make.sh +++ b/make.sh @@ -81,18 +81,18 @@ echo "Weave data..." >&2 echo "CONFIG = $CONFIG" >&2 cmd="uv run python3 ${py_args} $script_dir/weave.py \ - --omnipath-networks $data_dir/omnipath_networks/omnipath_networks_different_type_entity_type_source_and_entity_type_target_shorter.tsv \ --copy-number-amplifications-external $decider_dir/cnas_external.csv \ --short-mutations-local $decider_dir/short_mutations_local.csv \ --short-mutations-external $decider_dir/short_mutations_external.csv \ --copy-number-amplifications-local $decider_dir/cnas_local.csv \ - --structural-variants $decider_dir/structural_variants.xlsx \ --open-targets-drug-molecule $data_dir/OT/drug_molecule/ --open-targets-drug_mechanism_of_action $data_dir/OT/drug_mechanism_of_action/ --open-targets-target $data_dir/OT/target/ + --cgi $decider_dir/treatments_cgi.csv \ --config $CONFIG \ ${weave_args}" # \ - # --cgi $decider_dir/treatments_cgi.csv \ + # --omnipath-networks $data_dir/omnipath_networks/omnipath_networks_different_type_entity_type_source_and_entity_type_target_shorter.tsv \ + # --structural-variants $decider_dir/structural_variants.xlsx \ # --clinical $data_dir/DECIDER/clinical/clinical_export.xlsx \ # --oncokb $data_dir/DECIDER/$data_version/treatments.csv \ From 9453d91917204b1abcb630eed992edce4b4b9ab3 Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Fri, 3 Apr 2026 10:53:56 +0200 Subject: [PATCH 4/4] feat(multiple export back-ends): Adds the possibility to export the SKG to sevral back-ends. --- config/owl.yaml | 16 ++++++++++++++++ weave.py | 38 ++++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 config/owl.yaml diff --git a/config/owl.yaml b/config/owl.yaml new file mode 100644 index 0000000..60a2b17 --- /dev/null +++ b/config/owl.yaml @@ -0,0 +1,16 @@ +biocypher: + debug: false + offline: true + dbms: owl + + # Ontology configuration + head_ontology: + url: https://github.com/biolink/biolink-model/raw/v3.2.1/biolink-model.owl.ttl + root_node: entity + +owl: + edge_model: ObjectProperty + file_format: turtle + labels_order: "Ascending" # Default: From more specific to more generic. + node_labels_order: "Ascending" # Default: use labels_order. + edge_labels_order: "Leaves" diff --git a/weave.py b/weave.py index 1044015..278730e 100755 --- a/weave.py +++ b/weave.py @@ -136,7 +136,8 @@ def process_OT(directory, name): parser = argparse.ArgumentParser( description=usage) - parser.add_argument("-C", "--config", metavar="FILE", default="config/neo4j.yaml", + parser.add_argument("-C", "--config", metavar="FILE", default=["config/neo4j.yaml"], + action="append", help="The BioCypher configuration to load [default: config/neo4j.yaml].") parser.add_argument("-i", "--clinical", metavar="CSV", nargs="+", @@ -197,10 +198,6 @@ def process_OT(directory, name): help="Set the verbose level (default: %(default)s).") asked = parser.parse_args() - bc = biocypher.BioCypher( - biocypher_config_path = asked.config, - schema_config_path = "config/schema.yaml" - ) logging.basicConfig() logging.getLogger().setLevel(asked.verbose) @@ -670,17 +667,26 @@ def process_OT(directory, name): # Export the final SKG. ################################################### - logging.info(f"Write the final SKG into files...") - if fnodes: - bc.write_nodes(n.as_tuple() for n in fnodes) - if fedges: - bc.write_edges(e.as_tuple() for e in fedges) - #bc.summary() - import_file = bc.write_import_call() - logging.info(f"OK, wrote files.") - - # Print on stdout for other scripts to get. - print(import_file) + configs = asked.config + + for config in configs: + logging.info(f"Write the final SKG into {config} files...") + + bc = biocypher.BioCypher( + biocypher_config_path = config, + schema_config_path = "config/schema.yaml" + ) + + if fnodes: + bc.write_nodes(n.as_tuple() for n in fnodes) + if fedges: + bc.write_edges(e.as_tuple() for e in fedges) + #bc.summary() + import_file = bc.write_import_call() + logging.info(f"OK, wrote files.") + + # Print on stdout for other scripts to get. + print(import_file) if asked.import_script_run: shell = os.environ["SHELL"]