11<template >
22 <div class =" mavedb-assay-facts-card" >
33 <div class =" mavedb-assay-facts-card-header" >
4- <span class =" mavedb-assay-facts-author" >{{ authorLine }}</span >
4+ <span class =" mavedb-assay-facts-heading" >
5+ <template v-if =" firstAuthor " >{{ firstAuthor }}</template >
6+ <span v-if =" firstAuthor && numAuthors > 1" class =" mavedb-assay-facts-heading-et-al" >  ; et al.</span >
7+ <template v-if =" geneAndYear " ><template v-if =" firstAuthor " >  ; </template >{{ geneAndYear }}</template >
8+ <span v-if =" (firstAuthor || geneAndYear) && journal" class =" mavedb-assay-facts-heading-journal"
9+ >  ; {{ journal }}</span
10+ >
11+ <template v-if =" missingAuthorGeneAndYear " >Score set</template >
12+ </span >
513 </div >
614 <div class =" mavedb-assay-facts-section mavedb-assay-facts-bottom-separator" >
715 <div class =" mavedb-assay-facts-row" >
1927 <div v-else >Not specified</div >
2028 </div >
2129 </div >
30+ <div class =" mavedb-assay-facts-row" >
31+ <div class =" mavedb-assay-facts-label" >Molecular Mechanism Assessed</div >
32+ <div class =" mavedb-assay-facts-value" >
33+ <div v-if =" scoreSet.experiment.keywords?.some((k) => k.keyword.key === 'Molecular Mechanism Assessed')" >
34+ {{
35+ scoreSet.experiment.keywords.find((k) => k.keyword.key === 'Molecular Mechanism Assessed').keyword.label
36+ }}
37+ </div >
38+ <div v-else >Not specified</div >
39+ </div >
40+ </div >
2241 <div class =" mavedb-assay-facts-row" >
2342 <div class =" mavedb-assay-facts-label" >Variant Consequences Detected</div >
2443 <div class =" mavedb-assay-facts-value" >
108127</template >
109128
110129<script lang="ts">
130+ import _ from ' lodash'
111131import {defineComponent , PropType } from ' vue'
112132
133+ import {getScoreSetFirstAuthor } from ' @/lib/score-sets'
113134import type {components } from ' @/schema/openapi'
114135
115136export default defineComponent ({
@@ -123,15 +144,29 @@ export default defineComponent({
123144 },
124145
125146 computed: {
126- authorLine : function () {
127- const author = this .scoreSet . primaryPublicationIdentifiers [ 0 ]?. authors [ 0 ]. name
128- const gene = this . scoreSet . targetGenes ?.[ 0 ]?. name || ' '
129- const year = this . scoreSet . primaryPublicationIdentifiers [ 0 ]?. publicationYear || ' '
147+ firstAuthor : function () {
148+ const firstAuthor = getScoreSetFirstAuthor ( this .scoreSet )
149+ return ! firstAuthor || _ . isEmpty ( firstAuthor ?. name ) ? undefined : firstAuthor . name . split ( ' , ' )[ 0 ]
150+ },
130151
131- if (author && author .length > 0 ) {
132- return ` ${author } et al. ${gene } ${year } `
133- }
134- return ` ${gene } ${year } `
152+ numAuthors : function () {
153+ return this .scoreSet .primaryPublicationIdentifiers [0 ]?.authors .length ?? 0
154+ },
155+
156+ geneAndYear : function () {
157+ // TODO VariantEffect/mavedb-api#450
158+ const gene = this .scoreSet .targetGenes ?.[0 ]?.name
159+ const year = this .scoreSet .primaryPublicationIdentifiers [0 ]?.publicationYear
160+ const parts = [gene , year ?.toString ()].filter ((x ) => x != null )
161+ return parts .length > 0 ? parts .join (' ' ) : undefined
162+ },
163+
164+ missingAuthorGeneAndYear : function () {
165+ return ! this .firstAuthor && ! this .geneAndYear
166+ },
167+
168+ journal : function () {
169+ return this .scoreSet .primaryPublicationIdentifiers [0 ]?.publicationJournal
135170 },
136171
137172 detectsNmd : function () {
@@ -241,12 +276,17 @@ export default defineComponent({
241276 border-radius : 4px ;
242277}
243278
244- /* Specific fields */
279+ /* Heading */
245280
246- .mavedb-assay-facts-author {
281+ .mavedb-assay-facts-heading {
247282 font-size : 21px ;
248283}
249284
285+ .mavedb-assay-facts-heading-et-al ,
286+ .mavedb-assay-facts-heading-journal {
287+ font-style : italic ;
288+ }
289+
250290/* Variant classification */
251291
252292.mavedb-classification-badge {
0 commit comments