From 1cac38018bb698f40e768f8df8e707babc7cd338 Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Wed, 8 Jul 2026 16:54:32 +0200 Subject: [PATCH 1/8] feat(transformer): add escat tier for oncoKB. --- config/schema.yaml | 35 ++++++++ oncodashkb/adapters/oncokb.yaml | 61 +++++++++----- .../transformers/escat_tier_transformer.py | 80 +++++++++++++++++++ weave.py | 4 + 4 files changed, 159 insertions(+), 21 deletions(-) create mode 100644 oncodashkb/transformers/escat_tier_transformer.py diff --git a/config/schema.yaml b/config/schema.yaml index 2fabb1a..b56635c 100644 --- a/config/schema.yaml +++ b/config/schema.yaml @@ -384,6 +384,41 @@ variant biomarker for treatment: data_source: str Tier: str +biomarker_for_treatment_level_IA: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IA + +biomarker_for_treatment_level_IC: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IC + +biomarker_for_treatment_level_II: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_II + +biomarker_for_treatment_level_IIIA: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IIIA + +biomarker_for_treatment_level_IIIB: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IIIB + +biomarker_for_treatment_level_IVA: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IVA + +biomarker_for_treatment_level_IVB: + is_a: variant biomarker for treatment + represented_as: edge + input_label: biomarker_for_treatment_level_IVB + ## METADATA patient has chronic illness: diff --git a/oncodashkb/adapters/oncokb.yaml b/oncodashkb/adapters/oncokb.yaml index 3e61f37..7be1b54 100644 --- a/oncodashkb/adapters/oncokb.yaml +++ b/oncodashkb/adapters/oncokb.yaml @@ -9,20 +9,23 @@ row: - CNA: to_subject: copy_number_amplification transformers: - - replace: - column: treatment - to_object: treatment - via_relation: variant_biomarker_for_treatment - forbidden: ';' - substitute: ' + ' - - split_translate: - column: treatment - to_object: drug - via_relation: variant_biomarker_for_treatment - separator: ";" - translations_file: ./data/OT/drug_molecule/part-00000-871f412e-aec4-4d33-a50d-feee532ddcd2-c000.snappy.parquet - translate_from: name - translate_to: id + # - replace: + # # replaced by user-defined transformer with escat level included in the name of the relation + # column: treatment + # to_object: treatment + # via_relation: variant_biomarker_for_treatment + # forbidden: ';' + # substitute: ' + ' + # + # - split_translate: + # # Not used anymore + # column: treatment + # to_object: drug + # via_relation: variant_biomarker_for_treatment + # separator: ";" + # translations_file: ./data/OT/drug_molecule/part-00000-871f412e-aec4-4d33-a50d-feee532ddcd2-c000.snappy.parquet + # translate_from: name + # translate_to: id - split_translate: column: treatment from_subject: treatment @@ -44,20 +47,36 @@ transformers: # translate_from: name # translate_to: id ## Variant biomarker for treatment - - map: - column: level_of_evidence - to_property: level_of_evidence - for_object: variant_biomarker_for_treatment + # - map: + # # Replaced by escat_tier_transformer + # column: level_of_evidence + # to_property: level_of_evidence + # for_object: variant_biomarker_for_treatment + - escat_tier_transformer - replace: column: citations to_property: citations - for_object: variant_biomarker_for_treatment + for_object: + - variant_biomarker_for_treatment_level_IA + - variant_biomarker_for_treatment_level_IC + - variant_biomarker_for_treatment_level_II + - variant_biomarker_for_treatment_level_IIIA + - variant_biomarker_for_treatment_level_IIIB + - variant_biomarker_for_treatment_level_IVA + - variant_biomarker_for_treatment_level_IVB forbidden: ';' substitute: ',' - map: column: tumorType to_property: tumorType - for_object: variant_biomarker_for_treatment + for_object: + - variant_biomarker_for_treatment_level_IA + - variant_biomarker_for_treatment_level_IC + - variant_biomarker_for_treatment_level_II + - variant_biomarker_for_treatment_level_IIIA + - variant_biomarker_for_treatment_level_IIIB + - variant_biomarker_for_treatment_level_IVA + - variant_biomarker_for_treatment_level_IVB metadata: - data_source: oncokb_annotation @@ -105,4 +124,4 @@ validate: dtype: str nullable: true checks: - str_matches: ^[ABCD]\([^\d]+\)$ \ No newline at end of file + str_matches: ^[ABCD]\([^\d]+\)$ diff --git a/oncodashkb/transformers/escat_tier_transformer.py b/oncodashkb/transformers/escat_tier_transformer.py new file mode 100644 index 0000000..77e9b33 --- /dev/null +++ b/oncodashkb/transformers/escat_tier_transformer.py @@ -0,0 +1,80 @@ +import logging +import ontoweaver +from ontoweaver import types as owtypes + +class escat_tier_transformer(ontoweaver.base.Transformer): + + def is_type_of_cancer_in(type, list_of_types): + for t in list_of_types: + if t in type: + return True + return False + + # def description_contains_drugs(descr, list_of_drugs): + # for d in list_of_drugs: + # if d in descr: + # return True + # return False + + def __init__(self, **kwargs): + super().__init__(**kwargs) +# self.declare = ontoweaver.base.Declare(raise_errors = kwargs["raise_errors"]) + self.declare_types.make_node_class("alteration") + self.declare_types.make_node_class("treatment") + self.declare_types.make_edge_class("biomarker_for_treatment_level_IA", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_IC", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_II", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_IIIA", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_IIIB", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_IVA", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + self.declare_types.make_edge_class("biomarker_for_treatment_level_IVB", getattr(owtypes, "alteration"), getattr(owtypes, "treatment")) + + def __call__(self, row, i): + treatment = str(row["treatment"]) + fda_level = str(row["level_of_evidence"]) + cancer_type = str(row["tumorType"]) + + approved_drugs = ["Zenocutuzumab", "Selitrectinib"] + # approved = description_contains_drugs(str(row["decription"], approved_drugs) and fda_level in ["1", "2"] + approved = treatment in approved_drugs and fda_level in ["1", "2"] + + # Tier IA + if fda_level in ["LEVEL_1", "LEVEL_2"] and cancer_type in ["Ovarian", "ovarian"]: + tier = "IA" + + # Tier IC + elif fda_level in ["LEVEL_1", "LEVEL_2"] and cancer_type in ["Solid", "solid"]: + tier = "IC" + + # Tier II: + elif fda_level in ["LEVEL_3A"] and \ + cancer_type in ["Solid", "solid", "Ovarian", "ovarian"] and \ + not row["treatment"].contains("Trastuzumab Deruxtecan") and \ + approved: + tier = "II" + + # Tier IVA + elif fda_level in ["LEVEL_3A"] and \ + not "Trastuzumab Deruxtecan" in treatment and \ + cancer_type in ["Ovarian", "ovarian", "Solid", "solid"]: + tier = "IVA" + + # Tier IIIA + # FIXME NB rule => fda 1 ou 2 mais code de Taru = fda 1, 2 ou 3 et approved a verifier + elif fda_level in ["LEVEL_1", "LEVEL_2", "LEVEL_3A"] and \ + approved : + # and cancer_type not in ["ovarian", "ovarian", "Solid", "solid"] + tier = "IIIA" + + # FIXME Tier IIIB ne concerne pas oncokb, donc pas applicable dans le transformer. + + # FIXME Tier IVA deuxieme regle a verifier: est-ce qu'on prend que level 4 ou R1 et R2 aussi ? + elif fda_level in ["LEVEL_4"]: + tier = "IVA" + + # Tier IVB + else: + tier = "IVB" + + yield treatment, getattr(owtypes, "biomarker_for_treatment_level_"+tier), getattr(owtypes, "treatment"), None + diff --git a/weave.py b/weave.py index 94dabda..c5ec05a 100755 --- a/weave.py +++ b/weave.py @@ -38,6 +38,10 @@ ontoweaver.transformer.register(translate_sample_ids) ontoweaver.transformer.register(translate_cat_format) +# Importing custom transformer for tanslating FDA levels to ESCAT Tiers +from oncodashkb.transformers.escat_tier_transformer import escat_tier_transformer +ontoweaver.transformer.register(escat_tier_transformer) + # Importing OpenTargets custom transformer and registering it. from oncodashkb.transformers.ot_transformers import access_proteins, urls_to_prop ontoweaver.transformer.register(access_proteins) From 9fd8bb78327eea109e05fd41cfc57d4204d52a28 Mon Sep 17 00:00:00 2001 From: Claire Laudy Date: Wed, 8 Jul 2026 16:56:16 +0200 Subject: [PATCH 2/8] fix(prepare.sh): do not call realpath on inexisting dir. --- prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare.sh b/prepare.sh index 5b3d331..3d88c65 100755 --- a/prepare.sh +++ b/prepare.sh @@ -19,7 +19,7 @@ set -e root_dir=$(pwd) data_dir="data" decider_dir="$(realpath $1)" -decider_snapshot_dir="$(realpath $data_dir/$2)" +decider_snapshot_dir="$data_dir/$2" log_file="prepare.log" echo "" > $log_file From 08aaeb3404f5d86abaeffac6b17dce162826436f Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Wed, 8 Jul 2026 09:26:21 +0200 Subject: [PATCH 3/8] fix(adapters): missing GoF + on_unknown_value --- .../template__copy_number_amplifications_external.yaml | 8 +++++--- .../template__copy_number_amplifications_local.yaml | 1 + .../adapters/template__short_mutations_external.yaml | 10 ++++++---- .../adapters/template__short_mutations_local.yaml | 1 + oncodashkb/adapters/template__structural_variants.yaml | 3 +++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/oncodashkb/adapters/template__copy_number_amplifications_external.yaml b/oncodashkb/adapters/template__copy_number_amplifications_external.yaml index f8ecc36..5678149 100644 --- a/oncodashkb/adapters/template__copy_number_amplifications_external.yaml +++ b/oncodashkb/adapters/template__copy_number_amplifications_external.yaml @@ -6,6 +6,7 @@ row: translate_from: Patient card::Patient cohort code_Patient Card translate_to: Patient card::Publication code index_col: 0 + on_unknown_value: skip usecols: [0,1,2] transformers: # Nodes @@ -45,7 +46,7 @@ transformers: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Act: GoF Inconclusive: Inconclusive ambiguous: ambiguous @@ -82,7 +83,7 @@ transformers: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Act: GoF Inconclusive: Inconclusive ambiguous: ambiguous @@ -91,11 +92,12 @@ transformers: columns: gene_role to_property: gene_role for_object: variant_causes_gene_status + on_unknown_value: skip translations: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Act: GoF Inconclusive: Inconclusive ambiguous: ambiguous diff --git a/oncodashkb/adapters/template__copy_number_amplifications_local.yaml b/oncodashkb/adapters/template__copy_number_amplifications_local.yaml index 071220a..cc23c6e 100644 --- a/oncodashkb/adapters/template__copy_number_amplifications_local.yaml +++ b/oncodashkb/adapters/template__copy_number_amplifications_local.yaml @@ -6,6 +6,7 @@ row: translate_from: Patient card::Patient cohort code_Patient Card translate_to: Patient card::Publication code index_col: 0 + on_unknown_value: skip usecols: [0,1,2] transformers: - translate_sample_ids : diff --git a/oncodashkb/adapters/template__short_mutations_external.yaml b/oncodashkb/adapters/template__short_mutations_external.yaml index 16ab08d..796e192 100644 --- a/oncodashkb/adapters/template__short_mutations_external.yaml +++ b/oncodashkb/adapters/template__short_mutations_external.yaml @@ -6,6 +6,7 @@ row: translate_from: Patient card::Patient cohort code_Patient Card translate_to: Patient card::Publication code index_col: 0 + on_unknown_value: skip usecols: [0,1,2] transformers: # Nodes @@ -42,7 +43,7 @@ transformers: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Inconclusive: Inconclusive Unknown: Unknown Likely Neutral: Likely Neutral @@ -64,13 +65,13 @@ transformers: for_object: gene_status to_property: ensembl_id_gene_status format_string: "{ensembl_id}:{gene_role}" - column_to_translate: + column_to_translate: - gene_role translations: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Inconclusive: Inconclusive Unknown: Unknown Likely Neutral: Likely Neutral @@ -78,11 +79,12 @@ transformers: columns: gene_role to_property: gene_role for_object: gene_status + on_unknown_value: skip translations: Loss-of-function: LoF Likely Loss-of-function: LoF Gain-of-function: GoF - Likely Gain-of-function: LoF + Likely Gain-of-function: GoF Inconclusive: Inconclusive Unknown: Unknown Likely Neutral: Likely Neutral diff --git a/oncodashkb/adapters/template__short_mutations_local.yaml b/oncodashkb/adapters/template__short_mutations_local.yaml index 8fc96f3..97cafe9 100644 --- a/oncodashkb/adapters/template__short_mutations_local.yaml +++ b/oncodashkb/adapters/template__short_mutations_local.yaml @@ -6,6 +6,7 @@ row: translate_from: Patient card::Patient cohort code_Patient Card translate_to: Patient card::Publication code index_col: 0 + on_unknown_value: skip usecols: [0,1,2] transformers: - translate_sample_ids : diff --git a/oncodashkb/adapters/template__structural_variants.yaml b/oncodashkb/adapters/template__structural_variants.yaml index 72daf59..f2c5f0a 100644 --- a/oncodashkb/adapters/template__structural_variants.yaml +++ b/oncodashkb/adapters/template__structural_variants.yaml @@ -6,6 +6,7 @@ row: translate_from: Patient card::Patient cohort code_Patient Card translate_to: Patient card::Publication code index_col: 0 + on_unknown_value: skip usecols: [0,1,2] transformers: # Nodes @@ -67,6 +68,7 @@ transformers: translations_file: data/HGNC/hgnc_complete_set.txt translate_from: symbol translate_to: ensembl_gene_id + on_unknown_value: skip sep: "\t" # Properties ## Sample @@ -112,6 +114,7 @@ transformers: columns: Gene_type to_property: gene_role for_object: gene_status + on_unknown_value: skip translations: gain: GoF loss: LoF From 63129d67bfa7f173caa74d08c4d6283bda84d482 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 9 Jul 2026 07:38:20 +0200 Subject: [PATCH 4/8] feat(make): more robust make.sh Checks that the import filename is not empty. More generic neo4j config check. Disable stop-on-error, as some BioCypher warnings ends in an error code. --- make.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/make.sh b/make.sh index b400ae2..f7597a9 100755 --- a/make.sh +++ b/make.sh @@ -19,8 +19,8 @@ else CONFIG="$2" fi -set -e -set -o pipefail +# set -e +# set -o pipefail decider_dir="$(realpath $1)" data_dir="$(realpath $1/..)" @@ -105,8 +105,12 @@ echo "$cmd" >&2 $cmd > last_biocypher_import.sh +if [[ -z "$(cat last_biocypher_import.sh)" ]] ; then + echo "ERROR: The weave command returned nothing." >&2 + exit 1 +fi -if [[ "$CONFIG" == "config/neo4j.yaml" ]] ; then +if [[ "$CONFIG" == *"neo4j"* ]] ; then echo "Stop Neo4j server..." >&2 neo_version=$(neo4j-admin --version | cut -d. -f 1) if [[ "$neo_version" -eq 4 ]]; then From cc6b049a8cc2b3fe42047e43d3a40047e0c70fbb Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 9 Jul 2026 09:10:20 +0200 Subject: [PATCH 5/8] fix(adapters): data_source with DECIDER prefix for all --- oncodashkb/adapters/clinical.yaml | 2 ++ .../adapters/template__copy_number_amplifications_external.yaml | 2 +- .../adapters/template__copy_number_amplifications_local.yaml | 2 +- oncodashkb/adapters/template__short_mutations_external.yaml | 2 +- oncodashkb/adapters/template__short_mutations_local.yaml | 2 +- oncodashkb/adapters/template__structural_variants.yaml | 2 +- oncodashkb/adapters/template__structural_variants_2.yaml | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/oncodashkb/adapters/clinical.yaml b/oncodashkb/adapters/clinical.yaml index 0034d94..a8380f8 100644 --- a/oncodashkb/adapters/clinical.yaml +++ b/oncodashkb/adapters/clinical.yaml @@ -320,3 +320,5 @@ transformers: # to_object: disease # via_relation: patient_has_chronic_illness +metadata: + - data_source: DECIDER_clinical diff --git a/oncodashkb/adapters/template__copy_number_amplifications_external.yaml b/oncodashkb/adapters/template__copy_number_amplifications_external.yaml index 5678149..68dec4f 100644 --- a/oncodashkb/adapters/template__copy_number_amplifications_external.yaml +++ b/oncodashkb/adapters/template__copy_number_amplifications_external.yaml @@ -172,4 +172,4 @@ transformers: - gene_status_affects_gene metadata: - - data_source: copy_number_amplifications_external + - data_source: DECIDER_copy_number_amplifications_external diff --git a/oncodashkb/adapters/template__copy_number_amplifications_local.yaml b/oncodashkb/adapters/template__copy_number_amplifications_local.yaml index cc23c6e..a85fe96 100644 --- a/oncodashkb/adapters/template__copy_number_amplifications_local.yaml +++ b/oncodashkb/adapters/template__copy_number_amplifications_local.yaml @@ -52,4 +52,4 @@ transformers: for_object: sample_carries_variant metadata: - - data_source: copy_number_amplifications_local + - data_source: DECIDER_copy_number_amplifications_local diff --git a/oncodashkb/adapters/template__short_mutations_external.yaml b/oncodashkb/adapters/template__short_mutations_external.yaml index 796e192..243606c 100644 --- a/oncodashkb/adapters/template__short_mutations_external.yaml +++ b/oncodashkb/adapters/template__short_mutations_external.yaml @@ -160,4 +160,4 @@ transformers: - variant_causes_gene_status - gene_status_affects_gene metadata: - - data_source: short_mutations_external + - data_source: DECIDER_short_mutations_external diff --git a/oncodashkb/adapters/template__short_mutations_local.yaml b/oncodashkb/adapters/template__short_mutations_local.yaml index 97cafe9..123e926 100644 --- a/oncodashkb/adapters/template__short_mutations_local.yaml +++ b/oncodashkb/adapters/template__short_mutations_local.yaml @@ -98,4 +98,4 @@ transformers: - patient_carries_sample - sample_carries_variant metadata: - - data_source: short_mutations_local + - data_source: DECIDER_short_mutations_local diff --git a/oncodashkb/adapters/template__structural_variants.yaml b/oncodashkb/adapters/template__structural_variants.yaml index f2c5f0a..d92b4b3 100644 --- a/oncodashkb/adapters/template__structural_variants.yaml +++ b/oncodashkb/adapters/template__structural_variants.yaml @@ -166,4 +166,4 @@ transformers: - gene_status_affects_gene metadata: - - data_source: structural_variants_placeholder + - data_source: DECIDER_structural_variants_placeholder diff --git a/oncodashkb/adapters/template__structural_variants_2.yaml b/oncodashkb/adapters/template__structural_variants_2.yaml index 535f860..c9f590e 100644 --- a/oncodashkb/adapters/template__structural_variants_2.yaml +++ b/oncodashkb/adapters/template__structural_variants_2.yaml @@ -117,5 +117,5 @@ transformers: - gene_status_affects_gene metadata: - - data_source: structural_variants + - data_source: DECIDER_structural_variants From 6e616052deeba3f0846eba7037729bed9f603269 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 9 Jul 2026 09:11:09 +0200 Subject: [PATCH 6/8] fix(prepare): smaller debug set --- prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare.sh b/prepare.sh index 3d88c65..b7a59d9 100755 --- a/prepare.sh +++ b/prepare.sh @@ -247,7 +247,7 @@ cd $root_dir # ## 2.3 - Debugging data echo "Create a smaller debuging data set in data_debug/..." >&2 -lines=100 +lines=10 echo " │ DECIDER..." >&2 mkdir -p data_debug mkdir -p data_debug/DECIDER_debug/ From 88e9e1fb9c6b02f6517af580b79abdcf0d17f7c6 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 9 Jul 2026 09:11:30 +0200 Subject: [PATCH 7/8] fix(weave): pass correct element sets to BioCypher --- weave.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weave.py b/weave.py index c5ec05a..2d6d1ba 100755 --- a/weave.py +++ b/weave.py @@ -756,9 +756,9 @@ def process_OT(directory, name): logging.info(f"Write the final SKG into files...") if nodes: - bc.write_nodes(n.as_tuple() for n in nodes) + bc.write_nodes(f_nodes) if edges: - bc.write_edges(e.as_tuple() for e in edges) + bc.write_edges(f_edges) #bc.summary() import_file = bc.write_import_call() logging.info(f"OK, wrote files.") From b2bbd28791bbe177a7145d4c5f59cd8ba56afa5b Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 9 Jul 2026 09:12:08 +0200 Subject: [PATCH 8/8] refactor(make): more robust Adds an xdebug mode. Fail on Neo4j error. --- make.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/make.sh b/make.sh index f7597a9..56429d1 100755 --- a/make.sh +++ b/make.sh @@ -4,15 +4,15 @@ work_dir=$(pwd) CONFIG="config/neo4j.yaml" if [[ -z "$1" ]] ; then - echo "ERROR, usage: $0 [config] [debug|sub-sample_percentage]" >&2 + echo "ERROR, usage: $0 [config] [debug|xdebug|sub-sample_percentage]" >&2 echo " config defaults to: $CONFIG" >&2 exit 2 fi if [[ -z "$2" ]] ; then echo "Selecting Neo4j output configuration." >&2 -elif [[ "$2" == "debug" ]] ; then - echo "ERROR, if DEBUG MODE, usage: $0 debug" >&2 +elif [[ "$2" == "debug" || "$2" == "xdebug" ]] ; then + echo "ERROR, if DEBUG MODE, usage: $0 " >&2 exit 2 else echo "Selecting output configuration: $2" >&2 @@ -27,7 +27,7 @@ data_dir="$(realpath $1/..)" sub_sample="" if [[ -n "$3" ]] ; then - if [[ "$3" == "debug" ]] ; then + if [[ "$3" == "debug" || "$3" == "xdebug" ]] ; then echo "DEBUG MODE" >&2 data_dir="$(realpath $decider_dir/../../data_debug)" decider_dir="$(realpath $decider_dir/../../data_debug/DECIDER_debug)" @@ -62,13 +62,14 @@ else NEO_USER="" fi -# py_args="-O" # Optimize = remove asserts and optimize bytecode. -py_args="" # Optimize = remove asserts and optimize bytecode. # HERE +py_args="-O" # Optimize = remove asserts and optimize bytecode. weave_args="-v INFO" # Default, for having clean progress bars. if [[ "$3" == "debug" ]] ; then + py_args="" + weave_args="--debug -v INFO" +elif [[ "$3" == "xdebug" ]] ; then py_args="" weave_args="--debug -v DEBUG" - # weave_args="--debug -v INFO" fi @@ -84,9 +85,9 @@ echo "Weave data..." >&2 cmd="uv run python3 ${py_args} $script_dir/weave.py --config $CONFIG - --structural-variants-2 $decider_dir/structural_variants_2.csv --clinical $decider_dir/clinical_export.xlsx --short-mutations-local $decider_dir/short_mutations_local.csv + --structural-variants-2 $decider_dir/structural_variants_2.csv --short-mutations-external $decider_dir/short_mutations_external.csv --copy-number-amplifications-local $decider_dir/cnas_local.csv --copy-number-amplifications-external $decider_dir/cnas_external.csv @@ -99,7 +100,6 @@ cmd="uv run python3 ${py_args} $script_dir/weave.py --oncokb-gene-status $decider_dir/oncokb_gene_status_info.csv ${sub_sample} ${weave_args}" - echo "Weaving command:" >&2 echo "$cmd" >&2 @@ -124,6 +124,12 @@ if [[ "$CONFIG" == *"neo4j"* ]] ; then chmod a+x $(cat last_biocypher_import.sh) ${NEO_USER} $SHELL $(cat last_biocypher_import.sh) + err=$? + if [[ $err -gt 0 ]] ; then + echo "Import in Neo4j failed on error: $err" + exit $err + fi + echo "Restart Neo4j..." >&2 $server start sleep 5