@@ -11,6 +11,7 @@ import ExpandableCell from '../../../components/tables/ExpandableCell';
11
11
import ExpandableTable from '../../../components/tables/ExpandableTable' ;
12
12
import { IArrangerEdge } from '../../../graphql/types' ;
13
13
import StackLayout from '../../../layout/StackLayout' ;
14
+ import { removeUnderscoreAndCapitalize } from '../../../utils/stringUtils' ;
14
15
import { IVariantEntity , IVariantEntityDictionary } from '../types' ;
15
16
import { Impact } from '../types' ;
16
17
import { IVariantConsequence , IVariantGene } from '../types' ;
@@ -144,11 +145,11 @@ export const makeTables = (
144
145
145
146
export const makeRows = (
146
147
consequences : IArrangerEdge < IVariantConsequence > [ ] ,
147
- dictionary : IVariantEntityDictionary [ 'consequences' ] [ 'prediction ' ] ,
148
+ dictionary : IVariantEntityDictionary [ 'consequences' ] [ 'predictions ' ] ,
148
149
) =>
149
150
consequences . map ( ( consequence : IArrangerEdge < IVariantConsequence > , index : number ) => ( {
150
- aa_change : consequence . node . aa_change ,
151
- coding_dna_change : consequence . node . coding_dna_change ,
151
+ aa_change : consequence . node . hgvsp ?. split ( ':' ) [ 1 ] ,
152
+ coding_dna_change : consequence . node . hgvsc ?. split ( ':' ) [ 1 ] ,
152
153
consequences : consequence . node . consequences ?. filter ( ( c ) => c ?. length ) ,
153
154
conservation : consequence . node . conservations ?. phylo_p17way_primate_rankscore ,
154
155
impact : [
@@ -190,7 +191,11 @@ export const getColumns = (dictionary: IVariantEntityDictionary['consequences'])
190
191
{
191
192
dataIndex : 'aa_change' ,
192
193
render : ( aa_change : string ) => < div className = { styles . longValue } > { aa_change || TABLE_EMPTY_PLACE_HOLDER } </ div > ,
193
- title : < Tooltip title = { dictionary . aaColumnTooltip } > { dictionary . aaColumn } </ Tooltip > ,
194
+ title : (
195
+ < Tooltip className = { styles . dotted } title = { dictionary . aaColumnTooltip } >
196
+ { dictionary . aaColumn }
197
+ </ Tooltip >
198
+ ) ,
194
199
width : '10%' ,
195
200
} ,
196
201
{
@@ -255,15 +260,17 @@ export const getColumns = (dictionary: IVariantEntityDictionary['consequences'])
255
260
const description = label ? `${ capitalize ( label ) } - ${ score } ` : score ;
256
261
return (
257
262
< StackLayout className = { styles . cellList } horizontal key = { id } >
258
- < Text type = { 'secondary' } > { predictionField } :</ Text >
263
+ < Text className = { styles . predictionLabel } type = { 'secondary' } >
264
+ { predictionField } :
265
+ </ Text >
259
266
< Text > { description } </ Text >
260
267
</ StackLayout >
261
268
) ;
262
269
} }
263
270
/>
264
271
) ;
265
272
} ,
266
- title : dictionary . prediction . prediction ,
273
+ title : dictionary . predictions . predictions ,
267
274
width : '15%' ,
268
275
} ,
269
276
{
@@ -322,13 +329,12 @@ const Consequences: React.FC<IConsequencesProps> = ({ dictionary, id, loading, v
322
329
{ dictionary . consequence }
323
330
</ Title >
324
331
< Collapse arrowIcon = "caretFilled" className = { styles . collapse } defaultActiveKey = { [ '1' ] } >
325
- < CollapsePanel className = { styles . panel } header = { dictionary . geneConsequences } key = "1" >
332
+ < CollapsePanel className = { styles . panel } header = { dictionary . geneConsequence } key = "1" >
326
333
< Card className = { styles . card } loading = { loading } >
327
334
< Space className = { styles . consequenceCards } direction = "vertical" size = { 48 } >
328
335
{ tables . length > 0 ? (
329
336
tables . map ( ( tableData : TableGroup , index : number ) => {
330
- const { symbol } = tableData ;
331
- const { omim } = tableData ;
337
+ const { omim, symbol } = tableData ;
332
338
const orderedConsequences = sortConsequences ( tableData . consequences ) ;
333
339
334
340
return (
@@ -341,9 +347,10 @@ const Consequences: React.FC<IConsequencesProps> = ({ dictionary, id, loading, v
341
347
< Space size = { 12 } >
342
348
< Space size = { 4 } >
343
349
< span >
344
- < span > { dictionary . gene } </ span >
350
+ < span className = { styles . bold } > { dictionary . gene } </ span >
345
351
< span >
346
352
< ExternalLink
353
+ className = { styles . link }
347
354
href = { `https://useast.ensembl.org/Homo_sapiens/Gene/Summary?g=${ symbol } ` }
348
355
>
349
356
{ symbol }
@@ -354,25 +361,35 @@ const Consequences: React.FC<IConsequencesProps> = ({ dictionary, id, loading, v
354
361
< Space size = { 4 } >
355
362
{ omim && (
356
363
< >
357
- < span > { dictionary . omim } </ span >
364
+ < span className = { styles . bold } > { dictionary . omim } </ span >
358
365
< span >
359
- < ExternalLink href = { `https://omim.org/entry/${ omim } ` } >
366
+ < ExternalLink
367
+ className = { styles . link }
368
+ href = { `https://omim.org/entry/${ omim } ` }
369
+ >
360
370
{ omim }
361
371
</ ExternalLink >
362
372
</ span >
363
373
</ >
364
374
) }
365
375
</ Space >
376
+ < Space size = { 4 } >
377
+ < span className = { styles . bold } >
378
+ { removeUnderscoreAndCapitalize (
379
+ orderedConsequences [ 0 ] . node . biotype ,
380
+ ) }
381
+ </ span >
382
+ </ Space >
366
383
</ Space >
367
384
< ExpandableTable
368
385
bordered
369
386
buttonText = { ( showAll , hiddenNum ) =>
370
387
showAll
371
388
? `${ dictionary . hideTranscript } `
372
- : `${ hiddenNum } ${ dictionary . showTranscript } `
389
+ : `${ dictionary . showTranscript ( hiddenNum ) } `
373
390
}
374
391
columns = { getColumns ( dictionary ) }
375
- dataSource = { makeRows ( orderedConsequences , dictionary [ 'prediction ' ] ) }
392
+ dataSource = { makeRows ( orderedConsequences , dictionary [ 'predictions ' ] ) }
376
393
nOfElementsWhenCollapsed = { 1 }
377
394
pagination = { false }
378
395
size = "small"
0 commit comments