Skip to content

Commit

Permalink
fix: genome browser not jumping to locus with grch38 (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo committed May 28, 2024
1 parent 90b9218 commit 6d1f46b
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/components/GenomeBrowserCard/GenomeBrowserCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,35 @@ const addTracks = (browser: any) => {
}
}
const removeTracks = (browser: any) => {
for (const track of publicTracks()) {
browser.removeTrack(track)

Check warning on line 56 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L55-L56

Added lines #L55 - L56 were not covered by tests
}
}
// Watch changes to the genome (requires full reload).
watch(
() => props.genomeBuild,
() => {
;(igvBrowser.value! as GenomeBrowser)
.loadGenome(translateGenome(props.genomeBuild))
.then((browser: GenomeBrowser) => {
browser.search(props.locus)
})
.then((browser: GenomeBrowser) => {
addTracks(browser)
})
if (igvBrowser.value && props.genomeBuild) {
removeTracks(igvBrowser.value! as GenomeBrowser)
;(igvBrowser.value! as GenomeBrowser)

Check warning on line 66 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L65-L66

Added lines #L65 - L66 were not covered by tests
.loadGenome(translateGenome(props.genomeBuild))
.then(() => {
addTracks(igvBrowser.value! as GenomeBrowser)

Check warning on line 69 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L68-L69

Added lines #L68 - L69 were not covered by tests
if (props.locus) {
;(igvBrowser.value! as GenomeBrowser).search(props.locus)

Check warning on line 71 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L71

Added line #L71 was not covered by tests
}
})
}
}
)
// Watch changes to the locus (jumping is enough).
watch(
() => props.locus,
() => {
if (igvBrowser.value) {
if (igvBrowser.value && props.locus) {
;(igvBrowser.value! as GenomeBrowser).search(props.locus)
}
}
Expand All @@ -84,11 +93,11 @@ onMounted(() => {
locus: props.locus
})
.then((browser: GenomeBrowser) => {
igvBrowser.value = browser
addTracks(browser)
if (props.locus) {
;(igvBrowser.value! as GenomeBrowser).search(props.locus)
;(browser! as GenomeBrowser).search(props.locus)

Check warning on line 98 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L98

Added line #L98 was not covered by tests
}
igvBrowser.value = browser

Check warning on line 100 in src/components/GenomeBrowserCard/GenomeBrowserCard.vue

View check run for this annotation

Codecov / codecov/patch

src/components/GenomeBrowserCard/GenomeBrowserCard.vue#L100

Added line #L100 was not covered by tests
})
})
</script>
Expand Down

0 comments on commit 6d1f46b

Please sign in to comment.