Skip to content

Commit

Permalink
fix: do not prefix chromosomes with chr in igv link (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo committed Apr 22, 2024
1 parent 73436d9 commit a07e360
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/components/SeqvarToolsCard/SeqvarToolsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,10 @@ const franklinLinkout = computed<string>(() => {
})
const jumpToLocus = async () => {
const chrPrefixed = props.seqvar?.chrom.startsWith('chr')
? props.seqvar?.chrom
: `chr${props.seqvar?.chrom}`
const chrom = props.seqvar?.chrom == 'chrMT' ? 'chrM' : props.seqvar?.chrom
// 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) => {
Expand Down
8 changes: 2 additions & 6 deletions src/components/StrucvarToolsCard/StrucvarToolsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,10 @@ const franklinLinkout = computed((): string => {
})
const jumpToLocus = async () => {
const chrPrefixed = props.strucvar?.chrom.startsWith('chr')
? props.strucvar?.chrom
: `chr${props.strucvar?.chrom}`
const chrom = props.strucvar?.chrom == 'chrMT' ? 'chrM' : props.strucvar?.chrom
// 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(
props.strucvar!
)}`
`http://127.0.0.1:60151/goto?locus=${chrom}:${props.strucvar?.start}-${svStop(props.strucvar!)}`
).catch((e) => {
const msg = "Couldn't connect to IGV. Please make sure IGV is running and try again."
emit('error', msg)
Expand Down

0 comments on commit a07e360

Please sign in to comment.