-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
287 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
import { API_BASE_PREFIX_NGINX } from '@/api/common' | ||
|
||
const API_BASE_URL = `${API_BASE_PREFIX_NGINX}/` | ||
|
||
const visibilityWindow = 10000000 | ||
|
||
const hescTadTrack = { | ||
name: 'hESC TADs', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/hesc.bed`, | ||
color: 'gray' | ||
} | ||
|
||
const curatedMmsTrack = { | ||
name: 'Curated MMS', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/patho-mms.bed`, | ||
color: 'red' | ||
} | ||
|
||
// const clinvarTrack = { | ||
// name: 'ClinVar SVs', | ||
// sourceType: 'custom', | ||
// visibilityWindow, | ||
// height: 100, | ||
// displayMode: 'SQUISHED', | ||
// source: { | ||
// url: `/svs/worker/clinvar/grch37/?min_pathogenicity=likely-pathogenic&chromosome=$CHR&begin=$START&end=$END`, | ||
// method: 'GET', | ||
// contentType: 'application/json', | ||
// mappings: { | ||
// chr: 'chromosome', | ||
// start: 'begin', | ||
// }, | ||
// queryable: true, | ||
// }, | ||
// format: 'annotation', | ||
// colorBy: 'pathogenicity', | ||
// colorTable: { | ||
// pathogenic: 'red', | ||
// 'likely-pathogenic': 'orange', | ||
// uncertain: 'blue', | ||
// 'likely-benign': 'gray', | ||
// benign: 'light gray', | ||
// }, | ||
// } | ||
|
||
const duplicationTrack = { | ||
name: 'UCSC Segmental Duplications', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/genomicSuperDups.bed.gz`, | ||
indexURL: `${API_BASE_URL}grch37/genomicSuperDups.bed.gz.tbi`, | ||
color: 'black' | ||
} | ||
|
||
const repeatsTrack = { | ||
name: 'UCSC Repeat Masker', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/rmsk.bed.gz`, | ||
indexURL: `${API_BASE_URL}grch37/rmsk.bed.gz.tbi`, | ||
color: 'black' | ||
} | ||
|
||
const altTrack = { | ||
name: 'UCSC Alt Loci Track', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/altSeqLiftOverPsl.bed.gz`, | ||
indexURL: `${API_BASE_URL}grch37/altSeqLiftOverPsl.bed.gz.tbi`, | ||
color: 'black' | ||
} | ||
|
||
const fixTrack = { | ||
name: 'UCSC Fix Track', | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
url: `${API_BASE_URL}grch37/fixSeqLiftOverPsl.bed.gz`, | ||
indexURL: `${API_BASE_URL}grch37/fixSeqLiftOverPsl.bed.gz.tbi`, | ||
color: 'black' | ||
} | ||
|
||
const bgDbTracks = [ | ||
// { | ||
// title: 'In-House SVs', | ||
// token: 'inhouse', | ||
// }, | ||
{ | ||
title: 'gnomad-SV', | ||
token: 'gnomad' | ||
}, | ||
{ | ||
title: 'DGV SVs', | ||
token: 'dgv' | ||
}, | ||
{ | ||
title: 'DGV GS SVs', | ||
token: 'dgv-gs' | ||
}, | ||
{ | ||
title: 'ExAC CNVs', | ||
token: 'exac' | ||
} | ||
].map(({ title, token }) => { | ||
return { | ||
name: title, | ||
sourceType: 'annotation', | ||
format: 'bed', | ||
visibilityWindow, | ||
displayMode: 'SQUISHED', | ||
url: `${API_BASE_URL}grch37/${token}.bed.gz`, | ||
indexURL: `${API_BASE_URL}grch37/${token}.bed.gz.tbi`, | ||
color: 'black' | ||
} | ||
}) | ||
export const publicTracks = [ | ||
duplicationTrack, | ||
repeatsTrack, | ||
altTrack, | ||
fixTrack, | ||
hescTadTrack, | ||
curatedMmsTrack | ||
// clinvarTrack, | ||
].concat(bgDbTracks) | ||
|
||
export const genCaseTrack = (caseUuid: string) => ({ | ||
order: -1, | ||
height: '200', | ||
name: 'Case SVs', | ||
sourceType: 'custom', | ||
visibilityWindow, | ||
source: { | ||
url: `/svs/ajax/fetch-variants/${caseUuid}/?chromosome=$CHR&start=$START&end=$END`, | ||
// url: `https://varfish.bihealth.org/svs/ajax/fetch-variants/7a538a72-f8fb-4d71-a08b-6045f1e983dc/?chromosome=chr15&start=16989370.8&end=26828561.7`, | ||
method: 'GET', | ||
contentType: 'application/json', | ||
mappings: { | ||
chr: 'chromosome' | ||
}, | ||
queryable: true | ||
}, | ||
format: 'annotation', | ||
colorBy: 'sv_type', | ||
colorTable: { | ||
DEL: 'red', | ||
DUP: 'green', | ||
INV: 'blue', | ||
'*': 'black' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<script setup lang="ts"> | ||
import { ref, onMounted, watch } from 'vue' | ||
import igv from 'igv' | ||
// import { genCaseTrack, publicTracks } from '@/components/GenomeBrowser.tracks' | ||
/** Alias for Genome Browser type. */ | ||
type GenomeBrowser = any | ||
// Define the props. | ||
const props = defineProps({ | ||
// Case UUID | ||
caseUuid: String, | ||
// Genome build, e.g., "hg19" or "b37" | ||
genome: String, | ||
// Locus to go to, e.g., "chr1:1,900,000-2,000,000" | ||
locus: String | ||
}) | ||
// The <div> to show the browser in. | ||
const genomeBrowserDivRef = ref(null) | ||
// Set on IGV browser creation. | ||
const igvBrowser = ref(null) | ||
const translateGenome = (value: any) => { | ||
if (value === 'GRCh37') { | ||
return 'hg19' | ||
} else if (value === 'GRCh38') { | ||
return 'b38' | ||
} else { | ||
return value | ||
} | ||
} | ||
// Conditionally add case tracks. | ||
// const addCaseTracks = (browser: GenomeBrowser) => { | ||
// if (props.caseUuid) { | ||
// console.log(genCaseTrack(props.caseUuid)) | ||
// browser.loadTrack(genCaseTrack(props.caseUuid)) | ||
// } | ||
// } | ||
// Add all tracks. | ||
// const addTracks = (browser: any) => { | ||
// addCaseTracks(browser) | ||
// for (const track of publicTracks) { | ||
// browser.loadTrack(track) | ||
// } | ||
// } | ||
// Watch changes to the genome (requires full reload). | ||
watch( | ||
() => props.genome, | ||
() => { | ||
igvBrowser.value?.loadGenome(translateGenome(props.genome)).then((browser: GenomeBrowser) => { | ||
browser.search(props.locus) | ||
}) | ||
// .then((browser: GenomeBrowser) => { | ||
// addTracks(browser) | ||
// }) | ||
} | ||
) | ||
// Watch changes to the case (requires track reload). | ||
watch( | ||
() => props.caseUuid, | ||
() => { | ||
if (igvBrowser.value) { | ||
igvBrowser.value.removeTrackByName('Case SVs') | ||
// addCaseTracks(igvBrowser.value) | ||
} | ||
} | ||
) | ||
// Watch changes to the locus (jumping is enough). | ||
watch( | ||
() => props.locus, | ||
() => { | ||
if (igvBrowser.value) { | ||
igvBrowser.value.search(props.locus) | ||
} | ||
} | ||
) | ||
// Construct igv.js browser when mounted. | ||
onMounted(() => { | ||
igv | ||
.createBrowser(genomeBrowserDivRef.value, { | ||
genome: translateGenome(props.genome), | ||
locus: props.locus | ||
}) | ||
.then((browser: GenomeBrowser) => { | ||
igvBrowser.value = browser | ||
// addTracks(browser) | ||
if (props.locus) { | ||
igvBrowser.value?.search(props.locus) | ||
} | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div ref="genomeBrowserDivRef"></div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters