Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display all MMSplice and SpliceAI Scores (#296) #310

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 102 additions & 13 deletions frontend/src/components/SeqvarDetails/VariantScoresCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue'
import { computed, ref } from 'vue'

import ScoreDisplay from '@/components/SeqvarDetails/VariantScoresCard/ScoreDisplay.vue'
import Conservation from '@/components/SeqvarDetails/VariantScoresCard/UcscConservation.vue'
Expand Down Expand Up @@ -29,20 +29,45 @@ const bestOf = (obj: any, keys: string[]) => {
}
}

const expandSpliceAi = ref(false)
const expandMMSplice = ref(false)

const SpliceAiKeys = [
'SpliceAI-acc-gain',
'SpliceAi-acc-loss',
'SpliceAi-don-gain',
'SpliceAi-don-loss'
]
const MMSpliceKeys = [
'MMSp_acceptorIntron',
'MMSp_acceptor',
'MMSp_exon',
'MMSp_donor',
'MMSp_donorIntron'
]

const bestSpliceAi = computed(() => {
const keys = ['SpliceAI-acc-gain', 'SpliceAi-acc-loss', 'SpliceAi-don-gain', 'SpliceAi-don-loss']
return bestOf(props.varAnnos?.cadd, keys)
return bestOf(props.varAnnos?.cadd, SpliceAiKeys)
})

const allSpliceAi = computed(() => {
const res: any = {}
for (const key of SpliceAiKeys) {
res[key] = props.varAnnos?.cadd[key]
}
return res
})

const bestMMSplice = computed(() => {
const keys = [
'MMSp_acceptorIntron',
'MMSp_acceptor',
'MMSp_exon',
'MMSp_donor',
'MMSp_donorIntron'
]
return bestOf(props.varAnnos?.cadd, keys)
return bestOf(props.varAnnos?.cadd, MMSpliceKeys)
})

const allMMSplice = computed(() => {
const res: any = {}
for (const key of MMSpliceKeys) {
res[key] = props.varAnnos?.cadd[key]
}
return res
})

const decodeMultiDbnsfp = (s: string): number | null => {
Expand Down Expand Up @@ -333,7 +358,22 @@ const polyphenScore = computed((): number | null =>
</tr>

<tr>
<th class="align-middle">MMSplice</th>
<th class="align-middle">
MMSplice
<!-- Toggle Button -->
<v-btn
variant="outlined"
size="30"
color=""
icon
:disabled="!bestMMSplice.key || bestMMSplice.score === Infinity"
@click="expandMMSplice = !expandMMSplice"
>
<v-icon>
{{ expandMMSplice ? 'mdi-chevron-down' : 'mdi-chevron-right' }}
</v-icon>
</v-btn>
</th>
<template v-if="bestMMSplice.key && bestMMSplice.score !== Infinity">
<td class="text-center align-middle">
{{ bestMMSplice.score }}
Expand All @@ -355,6 +395,23 @@ const polyphenScore = computed((): number | null =>
</td>
</tr>

<template v-if="expandMMSplice">
<tr v-for="(score, index) in allMMSplice" :key="index">
<th class="text-center align-middle">{{ index }}</th>
<td>{{ score }}</td>
<td class="text-center align-middle">
<ScoreDisplay
:range-lower="0"
:range-upper="1"
:height="12"
font-size="10px"
:value="score"
/>
</td>
<td class="text-center align-middle">&mdash;</td>
</tr>
</template>

<tr>
<th class="align-middle">MPC</th>
<template v-if="mpcScore && mpcScore !== Infinity">
Expand Down Expand Up @@ -605,7 +662,22 @@ const polyphenScore = computed((): number | null =>
</tr>

<tr>
<th class="align-middle">SpliceAI</th>
<th class="align-middle">
SpliceAI
<!-- Toggle Button -->
<v-btn
variant="outlined"
size="30"
color=""
icon
:disabled="!bestSpliceAi.key || bestSpliceAi.score === Infinity"
@click="expandSpliceAi = !expandSpliceAi"
>
<v-icon>
{{ expandSpliceAi ? 'mdi-chevron-down' : 'mdi-chevron-right' }}
</v-icon>
</v-btn>
</th>
<template v-if="bestSpliceAi.key && bestSpliceAi.score !== Infinity">
<td class="text-center align-middle">
{{ bestSpliceAi.score }}
Expand All @@ -627,6 +699,23 @@ const polyphenScore = computed((): number | null =>
</td>
</tr>

<template v-if="expandSpliceAi">
<tr v-for="(score, index) in allSpliceAi" :key="index">
<th class="text-center align-middle">{{ index }}</th>
<td>{{ score }}</td>
<td class="text-center align-middle">
<ScoreDisplay
:range-lower="0"
:range-upper="1"
:height="12"
font-size="10px"
:value="score"
/>
</td>
<td class="text-center align-middle">&mdash;</td>
</tr>
</template>

<tr>
<th class="align-middle">REVEL</th>
<template v-if="revelScore && revelScore !== Infinity">
Expand Down
Loading