Skip to content

Commit

Permalink
Merge pull request #241 from VariantEffect/release-2024.2.2
Browse files Browse the repository at this point in the history
Release 2024.2.2
  • Loading branch information
bencap authored Jul 30, 2024
2 parents bba337b + ad70dbc commit 929fe0f
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mavedb-ui",
"version": "2024.2.0",
"version": "2024.2.2",
"private": true,
"scripts": {
"build": "vite build --mode=${MODE=live}",
Expand Down
10 changes: 10 additions & 0 deletions src/components/ScoreSetHeatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,18 @@ export default {
// Count of variants that do not appear to be complex but are don't have a valid substitution
let numIgnoredVariantInstances = 0
const distinctAccessions = new Set()
const simpleVariantInstances = _.filter(
scores.map((score) => {
const variant = parseSimpleProVariant(score.hgvs_pro)
if (!variant) {
numComplexVariantInstances++
return null
}
if (variant.target) {
distinctAccessions.add(variant.target)
}
const row = heatmapRowForVariant(variant.substitution)
if (row == null) {
numIgnoredVariantInstances++
Expand All @@ -187,6 +192,11 @@ export default {
}),
(x) => x != null
)
// TODO(#237) See https://github.com/VariantEffect/mavedb-ui/issues/237.
if (distinctAccessions.size > 1) {
numComplexVariantInstances += simpleVariantInstances.length
simpleVariantInstances = []
}
return {simpleVariantInstances, numComplexVariantInstances, numIgnoredVariantInstances}
},
Expand Down
57 changes: 46 additions & 11 deletions src/components/common/HighlightsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@
<ProgressSpinner class="highlights-progress" />
</div>
<div v-else>
<DataTable :value="leaderboardData" sortField="count" :sortOrder="-1" paginator :rows="5"
:rowsPerPageOptions="[5, 10, 20]" size="small">
<DataTable
:ref="`targetDataTable${tab}`"
:exportFilename="`mavedb-${pluralize(tab)}`"
paginator
:rows="5"
:rowsPerPageOptions="[5, 10, 20]"
size="small"
sortField="count"
:sortOrder="-1"
:value="leaderboardData"
>
<template #paginatorstart>
<Button type="button" icon="pi pi-download" text @click="exportCsv('target', tab)" />
</template>
<Column v-for="col of targetLeaderboardColumns[this.field]" :field="col.field" :header="col.header"
:sortable="col.field == 'count'" :key="col.field" :style="`width: ${col.width || auto}`">
<!-- Link any identifier columns or `column` (in this compoenent representative of some db key) to a MaveDB search page -->
Expand Down Expand Up @@ -84,8 +96,20 @@
<ProgressSpinner class="highlights-progress" />
</div>
<div v-else>
<DataTable :value="leaderboardData" sortField="count" :sortOrder="-1" paginator :rows="5"
:rowsPerPageOptions="[5, 10, 20]" size="small">
<DataTable
:ref="`scoreSetDataTable${tab}`"
:exportFilename="`mavedb-${pluralize(tab)}`"
:value="leaderboardData"
sortField="count"
:sortOrder="-1"
paginator
:rows="5"
:rowsPerPageOptions="[5, 10, 20]"
size="small"
>
<template #paginatorstart>
<Button type="button" icon="pi pi-download" text @click="exportCsv('scoreSet', tab)" />
</template>
<Column v-for="col of scoreSetLeaderboardColumns[this.field]" :field="col.field" :header="col.header"
:sortable="col.field == 'count'" :key="col.field" :style="`width: ${col.width || auto}`">
<!-- Link publication identifiers to their MaveDB page -->
Expand Down Expand Up @@ -160,20 +184,23 @@

<script>
import axios from 'axios'
import config from '@/config'
import { defineComponent, ref } from 'vue';
import useItem from '@/composition/item'
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import pluralize from 'pluralize'
import Button from 'primevue/button'
import Column from 'primevue/column'
import Card from 'primevue/card'
import DataTable from 'primevue/datatable'
import TabView from 'primevue/tabview'
import TabPanel from 'primevue/tabpanel'
import ProgressSpinner from 'primevue/progressspinner';
import ProgressSpinner from 'primevue/progressspinner'
import Chart from 'primevue/chart'
import {defineComponent, ref} from 'vue'
import config from '@/config'
import useItem from '@/composition/item'
export default defineComponent({
name: 'HighlightsView',
components: { Card, Chart, Column, DataTable, TabView, TabPanel, ProgressSpinner },
components: {Button, Card, Chart, Column, DataTable, TabView, TabPanel, ProgressSpinner},
setup: (props) => {
const targetAccessionAssemblyStatistic = useItem({ itemTypeName: 'target-accession-statistics' })
Expand Down Expand Up @@ -343,6 +370,14 @@ export default defineComponent({
},
methods: {
pluralize: function(...args) {
return pluralize(...args)
},
exportCsv: function(model, tab) {
this.$refs[`${model}DataTable${tab}`][0].exportCSV()
},
chartDataForTarget: function (targetData) {
if (!targetData) {
return {}
Expand Down
28 changes: 25 additions & 3 deletions src/components/screens/ScoreSetCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ export default {
return i;
}
}
return numSteps - 1
return numSteps - 1
},
wizardStepHasError: function(step) {
Expand Down Expand Up @@ -1631,16 +1631,33 @@ export default {
},
addTarget: function () {
if (this.taxonomy) {
if (this.targetGene.name && this.taxonomy) {
if ( !this.targetGene.category ) {
this.$toast.add({ severity: 'error', summary: 'Please choose protein coding, regulatory or other noncoding for the target gene type.' })
return null
}
if ( !this.targetGene.targetSequence.sequence ) {
this.$toast.add({ severity: 'error', summary: 'Please upload reference sequence FAST file.' })
return null
}
if ( !this.targetGene.targetSequence.sequenceType ) {
this.$toast.add({ severity: 'error', summary: 'Please choose DNA or protein for the sequence type.' })
return null
}
this.targetGene.targetSequence.taxonomy = this.taxonomy
delete this.targetGene.targetAccession;
}
else if (this.assembly || this.geneName) {
else if (this.geneName && this.assembly) {
if ( !this.targetGene.category ) {
this.$toast.add({ severity: 'error', summary: 'Please choose protein coding, regulatory or other noncoding for the target gene type.' })
return null
}
this.targetGene.targetAccession.assembly = this.assemblyDropdownValue
this.targetGene.targetAccession.gene = this.geneNameDropdownValue // Name property on string object array
delete this.targetGene.targetSequence;
}
else {
this.$toast.add({ severity: 'error', summary: 'Target must include taxonomy or assembly and gene name.' })
return null // target must include one of the above objects
}
this.targetGene.externalIdentifiers = _.keys(
Expand Down Expand Up @@ -1704,6 +1721,9 @@ export default {
if (!this.item) {
editedFields.supersededScoreSetUrn = this.supersededScoreSet ? this.supersededScoreSet.urn : null
editedFields.metaAnalyzesScoreSetUrns = this.metaAnalyzesScoreSets.map((s) => s.urn)
if ( editedFields.metaAnalyzesScoreSetUrns.length===0 && editedFields.supersededScoreSetUrn ) {
editedFields.experimentUrn = this.supersededScoreSet.experiment.urn
}
}
else {
// empty item arrays so that deleted items aren't merged back into editedItem object
Expand Down Expand Up @@ -1969,8 +1989,10 @@ export default {
display: table;
}
/* Ensure the step controls are never off-screen. */
.mavedb-wizard-step-controls {
padding-left: 10px;
max-width: 100vw;
}
/* Switches */
Expand Down
1 change: 1 addition & 0 deletions src/components/screens/ScoreSetEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@
delete this.targetGene.targetSequence;
}
else {
this.$toast.add({ severity: 'error', summary: 'Target must include taxonomy or assembly and gene name.' })
return null // target must include one of the above objects
}
this.targetGene.externalIdentifiers = _.keys(
Expand Down
10 changes: 8 additions & 2 deletions src/lib/mave-hgvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface SimpleProteinVariation {
* change of another sort.
*/
substitution: string
/** The genomic target (accession) from a fully qualified MaveHGVS-pro string. */
target: null | string
}

/**
Expand All @@ -30,15 +32,19 @@ const proVariantRegex = /^p\.([A-Za-z]{3})([0-9]+)([A-Za-z]{3}|=|\*|-)$/
* @returns An object with properties indicating
*/
export function parseSimpleProVariant(variant: string): SimpleProteinVariation | null {
const match = variant.match(proVariantRegex)
const parts = variant.split(":")
const variation = parts.length == 1 ? parts[0] : parts[1]
const target = parts.length == 1 ? null : parts[0]
const match = variation.match(proVariantRegex)
if (!match) {
// console.log(`WARNING: Unrecognized pro variant: ${variant}`)
return null
}
return {
position: parseInt(match[2]),
original: match[1],
substitution: match[3]
substitution: match[3],
target: target
}
}

Expand Down

0 comments on commit 929fe0f

Please sign in to comment.