Skip to content

Commit f9a80a3

Browse files
committed
Add external links
1 parent 72bfafb commit f9a80a3

1 file changed

Lines changed: 29 additions & 11 deletions

File tree

seal/templates/analysis/sample.html

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -575,32 +575,50 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
575575
const HGVSc = formatNA(data.HGVSc, "NA");
576576
const HGVSp = formatNA(data.HGVSp, "NA");
577577

578+
return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`;
579+
},
580+
// Nomenclature Column
581+
createColumn({
582+
id: "visible-Nomenclature",
583+
data: null,
584+
className: 'w3-border-right',
585+
myTitleFn: (data) => {
586+
if (data.annotations == null) return "<i>NA</i>";
587+
588+
let response = data.annotations.preferred ? " (selected)" : "";
589+
response += data.annotations.canonical ? " (canonical)" : "";
590+
591+
const HGVSg = formatNA(data.annotations.HGVSg, "NA");
592+
const HGVSc = formatNA(data.annotations.HGVSc, "NA");
593+
const HGVSp = formatNA(data.annotations.HGVSp, "NA");
594+
578595
return `${HGVSg}\n${HGVSc}${response}\n${HGVSp}`;
579596
},
580597
renderConfig: {
581598
display: (data) => {
582-
if (data == null) return "<i>NA</i>";
583-
const mobidetails = (current_user_api_key_md !== "None") ? `<a target="_blank" title="MobiDetails" href="https://mobidetails.chu-montpellier.fr/api/variant/create?variant_chgvs=${encodeURIComponent(data.HGVSc)}&caller=browser&api_key=${current_user_api_key_md}" class="w3-text-flat-peter-river w3-hover-text-flat-carrot do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
599+
if (data.annotations == null) return "<i>NA</i>";
600+
const genome = "{{ genome_version }}".toLowerCase() == "grch38" ? "hg38" : "hg19";
601+
const mobidetails = (current_user_api_key_md !== "None") ? `<a target="_blank" title="MobiDetails" href="https://mobidetails.chu-montpellier.fr/api/variant/create?variant_chgvs=${encodeURIComponent(data.annotations.HGVSc)}&caller=browser&api_key=${current_user_api_key_md}" class="w3-text-flat-peter-river w3-hover-text-flat-carrot do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
584602
<span class="fa-layers do-not-select">
585603
<i class="fa-solid fa-square do-not-select" data-fa-transform="grow-11"></i>
586604
<span class="fa-layers-text fa-inverse do-not-select" data-fa-transform="shrink-3" style="font-weight:900">MD</span>
587605
</span>
588606
</span></a><br />` : "";
589-
const genebe = `<a target="_blank" title="GeneBe" href="https://genebe.net/variant/hg38/${data.HGVSg}" class="w3-text-flat-emerald w3-hover-text-flat-pumpkin do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
607+
const genebe = `<a target="_blank" title="GeneBe" href="https://genebe.net/variant/${genome}/${data.annotations.HGVSg}" class="w3-text-flat-emerald w3-hover-text-flat-pumpkin do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
590608
<span class="fa-layers do-not-select">
591609
<i class="fa-solid fa-square do-not-select" data-fa-transform="grow-11"></i>
592610
<span class="fa-layers-text fa-inverse do-not-select" data-fa-transform="shrink-3" style="font-weight:900">GB</span>
593611
</span>
594612
</span></a><br />`;
595-
const franklin = `<a target="_blank" title="Franklin" href="https://franklin.genoox.com/clinical-db/variant/snp/${data.HGVSg}" class="w3-text-flat-midnight-blue w3-hover-text-flat-turquoise do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
613+
const franklin = `<a target="_blank" title="Franklin" href="https://franklin.genoox.com/clinical-db/variant/snp/${data.id}-${genome}" class="w3-text-flat-midnight-blue w3-hover-text-flat-turquoise do-not-select" style="cursor: pointer;"><span class="fa-layers fa-fw do-not-select">
596614
<span class="fa-layers do-not-select">
597615
<i class="fa-solid fa-square do-not-select" data-fa-transform="grow-11"></i>
598616
<span class="fa-layers-text fa-inverse do-not-select" data-fa-transform="shrink-3" style="font-weight:900">F</span>
599617
</span>
600618
</span></a>`;
601619

602-
const color = data.preferred ? "w3-text-flat-peter-river" : "";
603-
const starIcon = data.canonical
620+
const color = data.annotations.preferred ? "w3-text-flat-peter-river" : "";
621+
const starIcon = data.annotations.canonical
604622
? `<i class="${color} fas fa-star w3-tiny"></i>`
605623
: `<i class="${color} far fa-star w3-tiny"></i>`;
606624

@@ -610,9 +628,9 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
610628
${starIcon}
611629
</div>
612630
<div class="w3-container w3-cell" style="padding: 0px !important;">
613-
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.HGVSg, "<i>NA</i>")}</p>
614-
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.HGVSc, "<i>NA</i>")}</p>
615-
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.HGVSp, "<i>NA</i>")}</p>
631+
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.annotations.HGVSg, "<i>NA</i>")}</p>
632+
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.annotations.HGVSc, "<i>NA</i>")}</p>
633+
<p style="width: 180px;margin:0;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">${formatNA(data.annotations.HGVSp, "<i>NA</i>")}</p>
616634
</div>
617635
<div class="w3-center w3-container w3-cell" style="vertical-align: middle;padding: 0px !important;">
618636
${mobidetails}${genebe}${franklin}
@@ -621,9 +639,9 @@ <h3>Comments (<span class="commentsCountVar"></span>)</h3>
621639
`;
622640
},
623641
sort: (data) => {
624-
if (!data || !data.HGVSg) return -1;
642+
if (!data.annotations || !data.annotations.HGVSg) return -1;
625643

626-
const matches = data.HGVSg.match(/(chr|cen|pter|qter|sup)?([0-9XYMt]+):[gmno]\.([0-9]+)(_[0-9]+)?([ACGT]+>)?(dup|ins|del|inv|[ACGT]+)?/);
644+
const matches = data.annotations.HGVSg.match(/(chr|cen|pter|qter|sup)?([0-9XYMt]+):[gmno]\.([0-9]+)(_[0-9]+)?([ACGT]+>)?(dup|ins|del|inv|[ACGT]+)?/);
627645
if (!matches) return -1;
628646

629647
const zero = "000000000";

0 commit comments

Comments
 (0)