From 1a42e775c5535f269b0942821ebfd479d39d9a89 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:12:42 +0200 Subject: [PATCH 1/8] Fix : scheduler when import another VCF --- seal/schedulers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/seal/schedulers.py b/seal/schedulers.py index 08b0e84..49fbd8d 100644 --- a/seal/schedulers.py +++ b/seal/schedulers.py @@ -449,7 +449,7 @@ def importvcf(): app.logger.error(f'Path does not exist for : {vcf_path}') path_locker.unlink() return - + status_final = False if "add_caller" in data and data["add_caller"] == True: sample = get_sample(data) if not sample: @@ -457,6 +457,7 @@ def importvcf(): path_locker.unlink() return msg = "Add new caller" + status_final = sample.status else: sample = create_sample(data) msg = "Import Sample" @@ -493,7 +494,8 @@ def importvcf(): app.logger.info("------ END VEP ------") except CommandFailedError as e: app.logger.info(f"{type(e).__name__} : {e}") - sample.status = -1 + if not status_final: + sample.status = -1 path_locker.unlink() db.session.commit() error_file = current_file.with_suffix('.error') @@ -678,7 +680,8 @@ def importvcf(): date=datetime.now(), action=f"Sample Imported") db.session.add(history) - sample.status = 1 + if not status_final: + sample.status = status db.session.commit() From d900276b236fc1295e4d44a26ee335b012f9dd12 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:13:44 +0200 Subject: [PATCH 2/8] Remove log development messages --- seal/static/seal/analysis/sample.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/seal/static/seal/analysis/sample.js b/seal/static/seal/analysis/sample.js index 51bba43..feb2822 100644 --- a/seal/static/seal/analysis/sample.js +++ b/seal/static/seal/analysis/sample.js @@ -360,7 +360,6 @@ function BaseConditionsFilterSelect(values_options, condition="==", sort=true) { } if (sort) { options.sort((a, b) => { - console.log(a.val()) if (a.val().toLowerCase() < b.val().toLowerCase()) { return -1; } else if (a.val().toLowerCase() > b.val().toLowerCase()) { @@ -408,14 +407,6 @@ function BaseConditionsFilterSelect(values_options, condition="==", sort=true) { case "isTrue": conditionName = "Is True"; search = function (value) { - console.log("t"); - console.log((value === false || - value === "false" || - value === "0" || - value === null || - value === undefined || - value === "" || - (typeof value === 'number' && isNaN(value)))) return value === true || value === "true" || value === "1" || @@ -426,14 +417,6 @@ function BaseConditionsFilterSelect(values_options, condition="==", sort=true) { case "isFalse": conditionName = "Is False"; search = function (value) { - console.log("f"); - console.log((value === false || - value === "false" || - value === "0" || - value === null || - value === undefined || - value === "" || - (typeof value === 'number' && isNaN(value)))) return value === false || value === "false" || value === "0" || From 66a50269c1d7c7169762aaa2e9194cad8dabf171 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:16:20 +0200 Subject: [PATCH 3/8] Remove log development messages --- seal/templates/analysis/sample.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index b872f55..59de19f 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -896,10 +896,6 @@

Comments ()

const clinvar = data.clinvar || {}; const phenotypes = data.phenotypes || {}; const star = (clinvar.CLNREVSTAT == null) ? 0 : clinvar_stars[clinvar.CLNREVSTAT]; - if(clinvar.CLNREVSTAT == null){ - console.log(`${clinvar_stars[clinvar.CLNREVSTAT]} - ${clinvar.CLNREVSTAT}`) - } - let stat = ''; if (clinvar.CLNREVSTAT) { stat = ` (${star}/4)`; @@ -951,7 +947,6 @@

Comments ()

color = "peter-river"; colorHover = "belize-hole"; if (/pathogenic|establish/i.test(clinvar.CLNSIGCONF)) { - console.log(clinvar.CLNREVSTAT) color = "carrot"; colorHover = "pumpkin"; } From b01647296787c58be4f2b8d658ee39a6f13bd730 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:17:11 +0200 Subject: [PATCH 4/8] Fix: comma at the end of datatable --- seal/templates/analysis/sample.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index 59de19f..8078fad 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -1653,7 +1653,7 @@

Comments ()

return `[${family.filter}] ${af} (${family.allelic_depth}/${family.depth})`; }, } - }) + }), {% endfor %} ]; From 72bfafb35bd262a2a53949bac6a47ef2cd728997 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:21:30 +0200 Subject: [PATCH 5/8] Fix: sorting on column 'Gene' --- seal/templates/analysis/sample.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index 8078fad..dda3444 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -548,6 +548,9 @@

Comments ()

data: "annotations", myTitleFn: (data) => formatNA(data.SYMBOL), renderConfig: { + default: (data) => { + return data.SYMBOL + }, display: (data) => { return data.SYMBOL == null ? "NA" From f9a80a399351d6b3f540eb543ce60cd6348db15e Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:22:35 +0200 Subject: [PATCH 6/8] Add external links --- seal/templates/analysis/sample.html | 40 +++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index dda3444..7392645 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -575,32 +575,50 @@

Comments ()

const HGVSc = formatNA(data.HGVSc, "NA"); const HGVSp = formatNA(data.HGVSp, "NA"); + return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`; + }, + // Nomenclature Column + createColumn({ + id: "visible-Nomenclature", + data: null, + className: 'w3-border-right', + myTitleFn: (data) => { + if (data.annotations == null) return "NA"; + + let response = data.annotations.preferred ? " (selected)" : ""; + response += data.annotations.canonical ? " (canonical)" : ""; + + const HGVSg = formatNA(data.annotations.HGVSg, "NA"); + const HGVSc = formatNA(data.annotations.HGVSc, "NA"); + const HGVSp = formatNA(data.annotations.HGVSp, "NA"); + return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`; }, renderConfig: { display: (data) => { - if (data == null) return "NA"; - const mobidetails = (current_user_api_key_md !== "None") ? ` + if (data.annotations == null) return "NA"; + const genome = "{{ genome_version }}".toLowerCase() == "grch38" ? "hg38" : "hg19"; + const mobidetails = (current_user_api_key_md !== "None") ? ` MD
` : ""; - const genebe = ` + const genebe = ` GB
`; - const franklin = ` + const franklin = ` F `; - const color = data.preferred ? "w3-text-flat-peter-river" : ""; - const starIcon = data.canonical + const color = data.annotations.preferred ? "w3-text-flat-peter-river" : ""; + const starIcon = data.annotations.canonical ? `` : ``; @@ -610,9 +628,9 @@

Comments ()

${starIcon}
-

${formatNA(data.HGVSg, "NA")}

-

${formatNA(data.HGVSc, "NA")}

-

${formatNA(data.HGVSp, "NA")}

+

${formatNA(data.annotations.HGVSg, "NA")}

+

${formatNA(data.annotations.HGVSc, "NA")}

+

${formatNA(data.annotations.HGVSp, "NA")}

${mobidetails}${genebe}${franklin} @@ -621,9 +639,9 @@

Comments ()

`; }, sort: (data) => { - if (!data || !data.HGVSg) return -1; + if (!data.annotations || !data.annotations.HGVSg) return -1; - const matches = data.HGVSg.match(/(chr|cen|pter|qter|sup)?([0-9XYMt]+):[gmno]\.([0-9]+)(_[0-9]+)?([ACGT]+>)?(dup|ins|del|inv|[ACGT]+)?/); + const matches = data.annotations.HGVSg.match(/(chr|cen|pter|qter|sup)?([0-9XYMt]+):[gmno]\.([0-9]+)(_[0-9]+)?([ACGT]+>)?(dup|ins|del|inv|[ACGT]+)?/); if (!matches) return -1; const zero = "000000000"; From fdae73cfe7f7c7b83e101deb792e2ccf24e8bebc Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:24:01 +0200 Subject: [PATCH 7/8] Fix: Return values for predictions scores (filter and export columns) --- seal/templates/analysis/sample.html | 49 ++++++++++------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index 7392645..4c32b77 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -561,23 +561,6 @@

Comments ()

} }), // Nomenclature Column - createColumn({ - id: "visible-Nomenclature", - data: "annotations", - className: 'w3-border-right', - myTitleFn: (data) => { - if (data == null) return "NA"; - - let response = data.preferred ? " (selected)" : ""; - response += data.canonical ? " (canonical)" : ""; - - const HGVSg = formatNA(data.HGVSg, "NA"); - const HGVSc = formatNA(data.HGVSc, "NA"); - const HGVSp = formatNA(data.HGVSp, "NA"); - - return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`; - }, - // Nomenclature Column createColumn({ id: "visible-Nomenclature", data: null, @@ -1490,25 +1473,28 @@

Comments ()

}), createColumn({ id: "export-filter-clinvar_revstat", - data: "clinvar.CLNSIG", + data: null, searchBuilderTitle:"ClinVar", visible: false, type: "clinvar", renderConfig: { default: (data) => { - const clinvar = data || {}; + const clinvar = data.clinvar || {}; let value = "2 - NA"; - if (clinvar) { - if (/benign/i.test(clinvar)) value = "0 - Benign/Likely Benign"; - else if (/uncertain/i.test(clinvar)) value = "3 - Uncertain significance"; - else if (/pathogenic|establish/i.test(clinvar)) value = "5 - Pathogenic/Likely Pathogenic"; - else if (/conflicting/i.test(clinvar)) { - value = "1 - Conflicting (without Pathogenic)"; - if (/pathogenic|establish/i.test(clinvar)) { - value = "4 - Conflicting (with Pathogenic)"; + if (clinvar.CLNSIG) { + if (/benign/i.test(clinvar.CLNSIG)) { + value = "0 - Benign/Likely Benign" + } else if (/uncertain/i.test(clinvar.CLNSIG)) { + value = "3 - Uncertain significance" + } else if (/conflicting/i.test(clinvar.CLNSIG)) { + value = "1 - Conflicting (without Pathogenic)" + if (/pathogenic|establish/i.test(clinvar.CLNSIGCONF)) { + value = "4 - Conflicting (with Pathogenic)" } - } + } else if (/pathogenic|establish/i.test(clinvar.CLNSIG)) { + value = "5 - Pathogenic/Likely Pathogenic" + } } return value; }, @@ -1564,7 +1550,7 @@

Comments ()

const ref = parseFloat(data.MaxEntScan_ref || 0).toFixed(2); const mes_var = (((alt - ref) / Math.abs(ref)) * 100).toFixed(2); d = isNaN(parseFloat(mes_var)) ? null: parseFloat(mes_var).toFixed(2); - return type === 'export' && d=== null? '' : data; + return type === 'export' && d=== null? '' : Math.abs(d); }, } }), @@ -1576,7 +1562,7 @@

Comments ()

renderConfig: { default: (data, type) => { d = isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2); - return type === 'export' && d=== null? '' : data; + return type === 'export' && d=== null? '' : d; }, } }), @@ -1588,8 +1574,7 @@

Comments ()

renderConfig: { default: (data, type) => { d = isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2); - return type === 'export' && d=== null? '' : data; - return isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2); + return type === 'export' && d=== null? '' : d; }, } }), From b4bb9aaacbd0c3ab0bc87710fe62ed634dc2e5a0 Mon Sep 17 00:00:00 2001 From: Char-Al Date: Thu, 21 Aug 2025 16:25:19 +0200 Subject: [PATCH 8/8] Fix: change orgin-data for MaxEntScan (bug with SearchBuilder) --- seal/templates/analysis/sample.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seal/templates/analysis/sample.html b/seal/templates/analysis/sample.html index 4c32b77..cca0563 100644 --- a/seal/templates/analysis/sample.html +++ b/seal/templates/analysis/sample.html @@ -1541,13 +1541,13 @@

Comments ()

}), createColumn({ id: "export-filter-MES", - data: "annotations", + data: null, searchBuilderTitle:"Prediction - MaxEntScan", visible: false, renderConfig: { default: (data, type) => { - const alt = parseFloat(data.MaxEntScan_alt || 0).toFixed(2); - const ref = parseFloat(data.MaxEntScan_ref || 0).toFixed(2); + const alt = parseFloat(data.annotations.MaxEntScan_alt || 0).toFixed(2); + const ref = parseFloat(data.annotations.MaxEntScan_ref || 0).toFixed(2); const mes_var = (((alt - ref) / Math.abs(ref)) * 100).toFixed(2); d = isNaN(parseFloat(mes_var)) ? null: parseFloat(mes_var).toFixed(2); return type === 'export' && d=== null? '' : Math.abs(d);