diff --git a/src/components/SeqvarToolsCard/SeqvarToolsCard.vue b/src/components/SeqvarToolsCard/SeqvarToolsCard.vue index 762af42..9deb707 100644 --- a/src/components/SeqvarToolsCard/SeqvarToolsCard.vue +++ b/src/components/SeqvarToolsCard/SeqvarToolsCard.vue @@ -123,12 +123,13 @@ const franklinLinkout = computed(() => { }) const jumpToLocus = async () => { - const chrPrefixed = props.seqvar?.chrom.startsWith('chr') - ? props.seqvar?.chrom - : `chr${props.seqvar?.chrom}` + let chrom = props.seqvar?.chrom + if (chrom?.startsWith('chr')) { + chrom = chrom.slice(3) + } // NB: we allow the call to fetch here as it goes to local IGV. await fetch( - `http://127.0.0.1:60151/goto?locus=${chrPrefixed}:${props.seqvar?.pos}-${ + `http://127.0.0.1:60151/goto?locus=${chrom}:${props.seqvar?.pos}-${ (props.seqvar?.pos ?? 0) + (props.seqvar?.del?.length ?? 0) }` ).catch((e) => { diff --git a/src/components/StrucvarToolsCard/StrucvarToolsCard.vue b/src/components/StrucvarToolsCard/StrucvarToolsCard.vue index beb05db..4bd973a 100644 --- a/src/components/StrucvarToolsCard/StrucvarToolsCard.vue +++ b/src/components/StrucvarToolsCard/StrucvarToolsCard.vue @@ -98,12 +98,13 @@ const franklinLinkout = computed((): string => { }) const jumpToLocus = async () => { - const chrPrefixed = props.strucvar?.chrom.startsWith('chr') - ? props.strucvar?.chrom - : `chr${props.strucvar?.chrom}` + let chrom = props.strucvar?.chrom + if (chrom?.startsWith('chr')) { + chrom = chrom.slice(3) + } // NB: we allow the call to fetch here as it goes to local IGV. await fetch( - `http://127.0.0.1:60151/goto?locus=${chrPrefixed}:${props.strucvar?.start}-${svStop( + `http://127.0.0.1:60151/goto?locus=${chrom}:${props.strucvar?.start}-${svStop( props.strucvar! )}` ).catch((e) => {