File tree Expand file tree Collapse file tree 18 files changed +658
-92
lines changed
nextclade-web/src/components Expand file tree Collapse file tree 18 files changed +658
-92
lines changed Original file line number Diff line number Diff line change 376
376
"type" : " string"
377
377
}
378
378
}
379
+ },
380
+ "aaMutLabelMap" : {
381
+ "type" : " object" ,
382
+ "additionalProperties" : {
383
+ "type" : " array" ,
384
+ "items" : {
385
+ "type" : " string"
386
+ }
387
+ }
379
388
}
380
389
}
381
390
},
Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ definitions:
229
229
type : array
230
230
items :
231
231
type : string
232
+ aaMutLabelMap :
233
+ type : object
234
+ additionalProperties :
235
+ type : array
236
+ items :
237
+ type : string
232
238
QcConfig :
233
239
description : Configuration for QC rules
234
240
examples :
Original file line number Diff line number Diff line change 1216
1216
"required" : [
1217
1217
" aaChangesGroups" ,
1218
1218
" cdsName" ,
1219
+ " labeledSubstitutions" ,
1219
1220
" privateDeletionRanges" ,
1220
1221
" privateDeletions" ,
1221
1222
" privateSubstitutions" ,
1222
1223
" reversionSubstitutions" ,
1224
+ " totalLabeledSubstitutions" ,
1223
1225
" totalPrivateDeletions" ,
1224
1226
" totalPrivateSubstitutions" ,
1225
- " totalReversionSubstitutions"
1227
+ " totalReversionSubstitutions" ,
1228
+ " totalUnlabeledSubstitutions" ,
1229
+ " unlabeledSubstitutions"
1226
1230
],
1227
1231
"properties" : {
1228
1232
"cdsName" : {
1252
1256
"$ref" : " #/definitions/AaSub"
1253
1257
}
1254
1258
},
1259
+ "labeledSubstitutions" : {
1260
+ "type" : " array" ,
1261
+ "items" : {
1262
+ "$ref" : " #/definitions/AaSubLabeled"
1263
+ }
1264
+ },
1265
+ "unlabeledSubstitutions" : {
1266
+ "type" : " array" ,
1267
+ "items" : {
1268
+ "$ref" : " #/definitions/AaSub"
1269
+ }
1270
+ },
1255
1271
"totalPrivateSubstitutions" : {
1256
1272
"type" : " integer" ,
1257
1273
"format" : " uint" ,
1267
1283
"format" : " uint" ,
1268
1284
"minimum" : 0.0
1269
1285
},
1286
+ "totalLabeledSubstitutions" : {
1287
+ "type" : " integer" ,
1288
+ "format" : " uint" ,
1289
+ "minimum" : 0.0
1290
+ },
1291
+ "totalUnlabeledSubstitutions" : {
1292
+ "type" : " integer" ,
1293
+ "format" : " uint" ,
1294
+ "minimum" : 0.0
1295
+ },
1270
1296
"aaChangesGroups" : {
1271
1297
"type" : " array" ,
1272
1298
"items" : {
1286
1312
}
1287
1313
}
1288
1314
},
1315
+ "AaSubLabeled" : {
1316
+ "description" : " Labeled aminoacid substitution" ,
1317
+ "type" : " object" ,
1318
+ "required" : [
1319
+ " labels" ,
1320
+ " substitution"
1321
+ ],
1322
+ "properties" : {
1323
+ "substitution" : {
1324
+ "$ref" : " #/definitions/AaSub"
1325
+ },
1326
+ "labels" : {
1327
+ "type" : " array" ,
1328
+ "items" : {
1329
+ "type" : " string"
1330
+ }
1331
+ }
1332
+ }
1333
+ },
1289
1334
"CladeNodeAttrFounderInfo" : {
1290
1335
"description" : " Information about a clade-like node attribute founder" ,
1291
1336
"type" : " object" ,
Original file line number Diff line number Diff line change @@ -882,13 +882,17 @@ definitions:
882
882
required :
883
883
- aaChangesGroups
884
884
- cdsName
885
+ - labeledSubstitutions
885
886
- privateDeletionRanges
886
887
- privateDeletions
887
888
- privateSubstitutions
888
889
- reversionSubstitutions
890
+ - totalLabeledSubstitutions
889
891
- totalPrivateDeletions
890
892
- totalPrivateSubstitutions
891
893
- totalReversionSubstitutions
894
+ - totalUnlabeledSubstitutions
895
+ - unlabeledSubstitutions
892
896
properties :
893
897
cdsName :
894
898
type : string
@@ -908,6 +912,14 @@ definitions:
908
912
type : array
909
913
items :
910
914
$ref : ' #/definitions/AaSub'
915
+ labeledSubstitutions :
916
+ type : array
917
+ items :
918
+ $ref : ' #/definitions/AaSubLabeled'
919
+ unlabeledSubstitutions :
920
+ type : array
921
+ items :
922
+ $ref : ' #/definitions/AaSub'
911
923
totalPrivateSubstitutions :
912
924
type : integer
913
925
format : uint
@@ -920,6 +932,14 @@ definitions:
920
932
type : integer
921
933
format : uint
922
934
minimum : 0.0
935
+ totalLabeledSubstitutions :
936
+ type : integer
937
+ format : uint
938
+ minimum : 0.0
939
+ totalUnlabeledSubstitutions :
940
+ type : integer
941
+ format : uint
942
+ minimum : 0.0
923
943
aaChangesGroups :
924
944
type : array
925
945
items :
@@ -931,6 +951,19 @@ definitions:
931
951
properties :
932
952
range :
933
953
$ref : ' #/definitions/Range_for_Position'
954
+ AaSubLabeled :
955
+ description : Labeled aminoacid substitution
956
+ type : object
957
+ required :
958
+ - labels
959
+ - substitution
960
+ properties :
961
+ substitution :
962
+ $ref : ' #/definitions/AaSub'
963
+ labels :
964
+ type : array
965
+ items :
966
+ type : string
934
967
CladeNodeAttrFounderInfo :
935
968
description : Information about a clade-like node attribute founder
936
969
type : object
Original file line number Diff line number Diff line change 974
974
"required" : [
975
975
" aaChangesGroups" ,
976
976
" cdsName" ,
977
+ " labeledSubstitutions" ,
977
978
" privateDeletionRanges" ,
978
979
" privateDeletions" ,
979
980
" privateSubstitutions" ,
980
981
" reversionSubstitutions" ,
982
+ " totalLabeledSubstitutions" ,
981
983
" totalPrivateDeletions" ,
982
984
" totalPrivateSubstitutions" ,
983
- " totalReversionSubstitutions"
985
+ " totalReversionSubstitutions" ,
986
+ " totalUnlabeledSubstitutions" ,
987
+ " unlabeledSubstitutions"
984
988
],
985
989
"properties" : {
986
990
"cdsName" : {
1010
1014
"$ref" : " #/definitions/AaSub"
1011
1015
}
1012
1016
},
1017
+ "labeledSubstitutions" : {
1018
+ "type" : " array" ,
1019
+ "items" : {
1020
+ "$ref" : " #/definitions/AaSubLabeled"
1021
+ }
1022
+ },
1023
+ "unlabeledSubstitutions" : {
1024
+ "type" : " array" ,
1025
+ "items" : {
1026
+ "$ref" : " #/definitions/AaSub"
1027
+ }
1028
+ },
1013
1029
"totalPrivateSubstitutions" : {
1014
1030
"type" : " integer" ,
1015
1031
"format" : " uint" ,
1025
1041
"format" : " uint" ,
1026
1042
"minimum" : 0.0
1027
1043
},
1044
+ "totalLabeledSubstitutions" : {
1045
+ "type" : " integer" ,
1046
+ "format" : " uint" ,
1047
+ "minimum" : 0.0
1048
+ },
1049
+ "totalUnlabeledSubstitutions" : {
1050
+ "type" : " integer" ,
1051
+ "format" : " uint" ,
1052
+ "minimum" : 0.0
1053
+ },
1028
1054
"aaChangesGroups" : {
1029
1055
"type" : " array" ,
1030
1056
"items" : {
1044
1070
}
1045
1071
}
1046
1072
},
1073
+ "AaSubLabeled" : {
1074
+ "description" : " Labeled aminoacid substitution" ,
1075
+ "type" : " object" ,
1076
+ "required" : [
1077
+ " labels" ,
1078
+ " substitution"
1079
+ ],
1080
+ "properties" : {
1081
+ "substitution" : {
1082
+ "$ref" : " #/definitions/AaSub"
1083
+ },
1084
+ "labels" : {
1085
+ "type" : " array" ,
1086
+ "items" : {
1087
+ "type" : " string"
1088
+ }
1089
+ }
1090
+ }
1091
+ },
1047
1092
"CladeNodeAttrFounderInfo" : {
1048
1093
"description" : " Information about a clade-like node attribute founder" ,
1049
1094
"type" : " object" ,
Original file line number Diff line number Diff line change @@ -718,13 +718,17 @@ definitions:
718
718
required :
719
719
- aaChangesGroups
720
720
- cdsName
721
+ - labeledSubstitutions
721
722
- privateDeletionRanges
722
723
- privateDeletions
723
724
- privateSubstitutions
724
725
- reversionSubstitutions
726
+ - totalLabeledSubstitutions
725
727
- totalPrivateDeletions
726
728
- totalPrivateSubstitutions
727
729
- totalReversionSubstitutions
730
+ - totalUnlabeledSubstitutions
731
+ - unlabeledSubstitutions
728
732
properties :
729
733
cdsName :
730
734
type : string
@@ -744,6 +748,14 @@ definitions:
744
748
type : array
745
749
items :
746
750
$ref : ' #/definitions/AaSub'
751
+ labeledSubstitutions :
752
+ type : array
753
+ items :
754
+ $ref : ' #/definitions/AaSubLabeled'
755
+ unlabeledSubstitutions :
756
+ type : array
757
+ items :
758
+ $ref : ' #/definitions/AaSub'
747
759
totalPrivateSubstitutions :
748
760
type : integer
749
761
format : uint
@@ -756,6 +768,14 @@ definitions:
756
768
type : integer
757
769
format : uint
758
770
minimum : 0.0
771
+ totalLabeledSubstitutions :
772
+ type : integer
773
+ format : uint
774
+ minimum : 0.0
775
+ totalUnlabeledSubstitutions :
776
+ type : integer
777
+ format : uint
778
+ minimum : 0.0
759
779
aaChangesGroups :
760
780
type : array
761
781
items :
@@ -767,6 +787,19 @@ definitions:
767
787
properties :
768
788
range :
769
789
$ref : ' #/definitions/Range_for_Position'
790
+ AaSubLabeled :
791
+ description : Labeled aminoacid substitution
792
+ type : object
793
+ required :
794
+ - labels
795
+ - substitution
796
+ properties :
797
+ substitution :
798
+ $ref : ' #/definitions/AaSub'
799
+ labels :
800
+ type : array
801
+ items :
802
+ type : string
770
803
CladeNodeAttrFounderInfo :
771
804
description : Information about a clade-like node attribute founder
772
805
type : object
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { getSafeId } from 'src/helpers/getSafeId'
9
9
import { TableSlim } from 'src/components/Common/TableSlim'
10
10
import { Tooltip } from 'src/components/Results/Tooltip'
11
11
import { ListOfNucMuts } from 'src/components/Results/ListOfNucMuts'
12
- import { ListOfAaSubs } from 'src/components/SequenceView/ListOfAaSubs '
12
+ import { ListOfAaMuts } from 'src/components/Results/ListOfAaMuts '
13
13
import { useTranslationSafe } from 'src/helpers/useTranslationSafe'
14
14
15
15
export function ColumnMutations ( { analysisResult } : ColumnCladeProps ) {
@@ -100,7 +100,7 @@ export function ColumnMutations({ analysisResult }: ColumnCladeProps) {
100
100
</ tr >
101
101
< tr >
102
102
< td >
103
- < ListOfAaSubs analysisResult = { analysisResult } />
103
+ < ListOfAaMuts analysisResult = { analysisResult } />
104
104
</ td >
105
105
</ tr >
106
106
</ tbody >
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ import type { AaSub } from 'src/types'
4
+ import { AminoacidMutationBadge } from 'src/components/Common/MutationBadge'
5
+ import { useTranslationSafe } from 'src/helpers/useTranslationSafe'
6
+ import { splitToRows } from 'src/components/Results/splitToRows'
7
+ import { TableSlim } from 'src/components/Common/TableSlim'
8
+
9
+ export interface ListOfAaMutationsGenericProps {
10
+ substitutions : AaSub [ ]
11
+ }
12
+
13
+ export function ListOfAaMutationsGeneric ( { substitutions } : ListOfAaMutationsGenericProps ) {
14
+ const { t } = useTranslationSafe ( )
15
+
16
+ const totalMutations = substitutions . length
17
+ const maxRows = Math . min ( 8 , totalMutations )
18
+ const numCols = 8
19
+ const substitutionsSelected = substitutions . slice ( 0 , maxRows * numCols )
20
+ const columns = splitToRows ( substitutionsSelected , { rowLength : maxRows } )
21
+
22
+ let moreText
23
+ if ( totalMutations > substitutionsSelected . length ) {
24
+ moreText = t ( '(truncated)' )
25
+ }
26
+
27
+ return (
28
+ < div className = "d-flex" >
29
+ < div className = "mr-auto" >
30
+ < TableSlim >
31
+ < tbody >
32
+ { columns . map ( ( col , i ) => (
33
+ // eslint-disable-next-line react/no-array-index-key
34
+ < tr key = { i } >
35
+ { col . map ( ( item ) => (
36
+ < td key = { item . pos } > { < AminoacidMutationBadge mutation = { item } /> } </ td >
37
+ ) ) }
38
+ </ tr >
39
+ ) ) }
40
+
41
+ { moreText && (
42
+ < tr >
43
+ < td colSpan = { numCols } className = "text-center" >
44
+ { moreText }
45
+ </ td >
46
+ </ tr >
47
+ ) }
48
+ </ tbody >
49
+ </ TableSlim >
50
+ </ div >
51
+ </ div >
52
+ )
53
+ }
You can’t perform that action at this time.
0 commit comments