Skip to content

Commit

Permalink
fix: adjust mt chromosome in igv calls (#1562) (#1563)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo authored Apr 19, 2024
1 parent c4bc4ef commit a28a279
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
5 changes: 1 addition & 4 deletions svs/vueapp/src/components/StrucvarDetailsNavi/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export const jumpToLocus = async (strucvar?: Strucvar) => {
return
}
let url: string
let chrom = strucvar.chrom
if (chrom?.startsWith('chr')) {
chrom = chrom.slice(3)
}
const chrom = strucvar.chrom == 'chrMT' ? 'chrM' : strucvar.chrom
if (strucvar.svType === 'BND' || strucvar.svType === 'INS') {
url = `http://127.0.0.1:60151/goto?locus=${chrom}:${strucvar.start ?? 1}-${(strucvar.start ?? 1) + 1}`
} else {
Expand Down
5 changes: 1 addition & 4 deletions svs/vueapp/src/components/SvFilterResultsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ const loadFromServer = async () => {
}
const goToLocus = async ({ chromosome, start, end }) => {
let chrom = chromosome
if (chrom?.startsWith('chr')) {
chrom = chrom.slice(3)
}
const chrom = chromosome == 'chrMT' ? 'chrM' : chromosome
await fetch(`http://127.0.0.1:60151/goto?locus=${chrom}:${start}-${end}`)
}
Expand Down
5 changes: 1 addition & 4 deletions variants/vueapp/src/components/FilterResultsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,7 @@ const effectSummary = (item) => {
return [null, 'p.?', 'p.='].includes(item.hgvs_p) ? item.hgvs_c : item.hgvs_p
}
const goToLocus = async (item) => {
let chrom = item.chromosome
if (chrom.startsWith('chr')) {
chrom = chrom.slice(3)
}
const chrom = item.chromosome == 'chrMT' ? 'chrM' : item.chromosome
await fetch(
`http://127.0.0.1:60151/goto?locus=${chrom}:${item.start}-${item.end}`,
).catch(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const props = defineProps({
})
const goToLocus = async () => {
let chrom = props.params.data.chromosome
if (chrom?.startsWith('chr')) {
chrom = chrom.slice(3)
}
const chrom =
props.params.data.chromosome == 'chrMT'
? 'chrM'
: props.params.data.chromosome
await fetch(
`http://127.0.0.1:60151/goto?locus=${chrom}:${props.params.data.start}-${props.params.data.end}`,
).catch(() => {
Expand Down
5 changes: 1 addition & 4 deletions variants/vueapp/src/components/SeqvarDetailsNavi/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { Seqvar } from '@bihealth/reev-frontend-lib/lib/genomicVars'
*/
export const jumpToLocus = async (seqvar?: Seqvar) => {
// NB: we allow the call to fetch here as it goes to local IGV.
let chrom = seqvar?.chrom
if (chrom?.startsWith('chr')) {
chrom = chrom.slice(3)
}
const chrom = seqvar?.chrom == 'chrMT' ? 'chrM' : seqvar?.chrom
await fetch(
`http://127.0.0.1:60151/goto?locus=${chrom}:${seqvar?.pos}-${
(seqvar?.pos ?? 0) + (seqvar?.del?.length ?? 0)
Expand Down

0 comments on commit a28a279

Please sign in to comment.