Skip to content

Commit fdae73c

Browse files
committed
Fix: Return values for predictions scores (filter and export columns)
1 parent f9a80a3 commit fdae73c

1 file changed

Lines changed: 17 additions & 32 deletions

File tree

seal/templates/analysis/sample.html

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -561,23 +561,6 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
561561
}
562562
}),
563563
// Nomenclature Column
564-
createColumn({
565-
id: "visible-Nomenclature",
566-
data: "annotations",
567-
className: 'w3-border-right',
568-
myTitleFn: (data) => {
569-
if (data == null) return "<i>NA</i>";
570-
571-
let response = data.preferred ? " (selected)" : "";
572-
response += data.canonical ? " (canonical)" : "";
573-
574-
const HGVSg = formatNA(data.HGVSg, "NA");
575-
const HGVSc = formatNA(data.HGVSc, "NA");
576-
const HGVSp = formatNA(data.HGVSp, "NA");
577-
578-
return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`;
579-
},
580-
// Nomenclature Column
581564
createColumn({
582565
id: "visible-Nomenclature",
583566
data: null,
@@ -1490,25 +1473,28 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
14901473
}),
14911474
createColumn({
14921475
id: "export-filter-clinvar_revstat",
1493-
data: "clinvar.CLNSIG",
1476+
data: null,
14941477
searchBuilderTitle:"ClinVar",
14951478
visible: false,
14961479
type: "clinvar",
14971480
renderConfig: {
14981481
default: (data) => {
1499-
const clinvar = data || {};
1482+
const clinvar = data.clinvar || {};
15001483
let value = "2 - NA";
15011484

1502-
if (clinvar) {
1503-
if (/benign/i.test(clinvar)) value = "0 - Benign/Likely Benign";
1504-
else if (/uncertain/i.test(clinvar)) value = "3 - Uncertain significance";
1505-
else if (/pathogenic|establish/i.test(clinvar)) value = "5 - Pathogenic/Likely Pathogenic";
1506-
else if (/conflicting/i.test(clinvar)) {
1507-
value = "1 - Conflicting (without Pathogenic)";
1508-
if (/pathogenic|establish/i.test(clinvar)) {
1509-
value = "4 - Conflicting (with Pathogenic)";
1485+
if (clinvar.CLNSIG) {
1486+
if (/benign/i.test(clinvar.CLNSIG)) {
1487+
value = "0 - Benign/Likely Benign"
1488+
} else if (/uncertain/i.test(clinvar.CLNSIG)) {
1489+
value = "3 - Uncertain significance"
1490+
} else if (/conflicting/i.test(clinvar.CLNSIG)) {
1491+
value = "1 - Conflicting (without Pathogenic)"
1492+
if (/pathogenic|establish/i.test(clinvar.CLNSIGCONF)) {
1493+
value = "4 - Conflicting (with Pathogenic)"
15101494
}
1511-
}
1495+
} else if (/pathogenic|establish/i.test(clinvar.CLNSIG)) {
1496+
value = "5 - Pathogenic/Likely Pathogenic"
1497+
}
15121498
}
15131499
return value;
15141500
},
@@ -1564,7 +1550,7 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
15641550
const ref = parseFloat(data.MaxEntScan_ref || 0).toFixed(2);
15651551
const mes_var = (((alt - ref) / Math.abs(ref)) * 100).toFixed(2);
15661552
d = isNaN(parseFloat(mes_var)) ? null: parseFloat(mes_var).toFixed(2);
1567-
return type === 'export' && d=== null? '' : data;
1553+
return type === 'export' && d=== null? '' : Math.abs(d);
15681554
},
15691555
}
15701556
}),
@@ -1576,7 +1562,7 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
15761562
renderConfig: {
15771563
default: (data, type) => {
15781564
d = isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2);
1579-
return type === 'export' && d=== null? '' : data;
1565+
return type === 'export' && d=== null? '' : d;
15801566
},
15811567
}
15821568
}),
@@ -1588,8 +1574,7 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
15881574
renderConfig: {
15891575
default: (data, type) => {
15901576
d = isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2);
1591-
return type === 'export' && d=== null? '' : data;
1592-
return isNaN(parseFloat(data)) ? null: parseFloat(data).toFixed(2);
1577+
return type === 'export' && d=== null? '' : d;
15931578
},
15941579
}
15951580
}),

0 commit comments

Comments
 (0)