@genspectrum/dashboard-components 0.6.17 → 0.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -12
- package/custom-elements.json +4 -4
- package/dist/assets/mutationOverTimeWorker-BdzqDqvO.js.map +1 -0
- package/dist/dashboard-components.js +216 -214
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +40 -40
- package/dist/style.css +3 -2
- package/package.json +13 -2
- package/src/operator/FetchInsertionsOperator.ts +2 -2
- package/src/operator/FetchSubstitutionsOrDeletionsOperator.ts +3 -3
- package/src/preact/mutationComparison/fetchMutationData.spec.ts +3 -3
- package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +11 -11
- package/src/preact/mutationComparison/getMutationComparisonTableData.ts +4 -4
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +27 -18
- package/src/preact/mutationFilter/parseAndValidateMutation.ts +4 -4
- package/src/preact/mutationFilter/parseMutation.spec.ts +17 -17
- package/src/preact/mutations/getInsertionsTableData.spec.ts +3 -3
- package/src/preact/mutations/getMutationsGridData.spec.ts +9 -9
- package/src/preact/mutations/getMutationsTableData.spec.ts +7 -7
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -3
- package/src/preact/mutations/mutations-table.tsx +3 -3
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +45686 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +58989 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +103991 -0
- package/src/preact/mutationsOverTime/__mockData__/mockConversion.ts +54 -0
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +63690 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +176 -159
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +17 -59
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +27 -0
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.ts +29 -0
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +13 -14
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +9 -334
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +68 -52
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +3 -3
- package/src/preact/prevalenceOverTime/getPrevalenceOverTimeTableData.spec.ts +5 -5
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +2 -2
- package/src/preact/shared/sort/sortInsertions.spec.ts +11 -11
- package/src/preact/shared/sort/sortInsertions.ts +2 -2
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +13 -13
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +7 -4
- package/src/preact/webWorkers/useWebWorker.ts +51 -0
- package/src/preact/webWorkers/workerFunction.ts +14 -0
- package/src/query/queryAggregatedDataOverTime.ts +3 -3
- package/src/query/queryMutationsOverTime.spec.ts +272 -51
- package/src/query/queryMutationsOverTime.ts +114 -45
- package/src/query/queryPrevalenceOverTime.ts +2 -2
- package/src/query/queryRelativeGrowthAdvantage.ts +3 -3
- package/src/types.ts +25 -5
- package/src/utils/map2d.spec.ts +29 -1
- package/src/utils/map2d.ts +22 -1
- package/src/utils/mutations.spec.ts +20 -20
- package/src/utils/mutations.ts +80 -17
- package/src/utils/sort.ts +5 -2
- package/src/utils/temporal.spec.ts +27 -24
- package/src/utils/{temporal.ts → temporalClass.ts} +170 -72
- package/src/utils/temporalTestHelpers.ts +3 -3
- package/src/web-components/input/gs-text-input.tsx +1 -1
- package/src/web-components/introduction.mdx +46 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +6 -699
- package/src/web-components/visualization/gs-mutations-over-time.tsx +2 -2
- package/standalone-bundle/dashboard-components.js +13763 -13754
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byDay.json +0 -38
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byWeek.json +0 -122
- package/src/preact/mutationsOverTime/__mockData__/aggregated_date.json +0 -642
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations.json +0 -1470
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json +0 -6778
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json +0 -7129
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json +0 -4681
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_23_01_2024.json +0 -10738
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json +0 -11710
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json +0 -11557
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json +0 -8596
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json +0 -4726
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json +0 -1747
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json +0 -1774
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json +0 -1819
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_04.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json +0 -1927
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json +0 -9
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json +0 -11143
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json +0 -9154
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_tooManyMutations.json +0 -16453
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json +0 -8812
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json +0 -9730
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json +0 -9865
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week6_2024.json +0 -11314
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
|
|
3
3
|
import { parseAndValidateMutation } from './parseAndValidateMutation';
|
|
4
|
-
import {
|
|
4
|
+
import { DeletionClass, InsertionClass, SubstitutionClass } from '../../utils/mutations';
|
|
5
5
|
|
|
6
6
|
describe('parseMutation', () => {
|
|
7
7
|
const singleSegmentedReferenceGenome = {
|
|
@@ -28,22 +28,22 @@ describe('parseMutation', () => {
|
|
|
28
28
|
{
|
|
29
29
|
name: 'should parse nucleotide insertions',
|
|
30
30
|
input: 'ins_10:ACGT',
|
|
31
|
-
expected: { type: 'nucleotideInsertions', value: new
|
|
31
|
+
expected: { type: 'nucleotideInsertions', value: new InsertionClass(undefined, 10, 'ACGT') },
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: 'should parse amino acid insertions',
|
|
35
35
|
input: 'ins_gene1:10:ACGT',
|
|
36
|
-
expected: { type: 'aminoAcidInsertions', value: new
|
|
36
|
+
expected: { type: 'aminoAcidInsertions', value: new InsertionClass('gene1', 10, 'ACGT') },
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: 'should parse amino acid insertion with LAPIS-style wildcard',
|
|
40
40
|
input: 'ins_gene1:10:?AC?GT',
|
|
41
|
-
expected: { type: 'aminoAcidInsertions', value: new
|
|
41
|
+
expected: { type: 'aminoAcidInsertions', value: new InsertionClass('gene1', 10, '?AC?GT') },
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'should parse amino acid insertion with SILO-style wildcard',
|
|
45
45
|
input: 'ins_gene1:10:.*AC.*GT',
|
|
46
|
-
expected: { type: 'aminoAcidInsertions', value: new
|
|
46
|
+
expected: { type: 'aminoAcidInsertions', value: new InsertionClass('gene1', 10, '.*AC.*GT') },
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
name: 'should return null for insertion with segment not in reference genome',
|
|
@@ -56,32 +56,32 @@ describe('parseMutation', () => {
|
|
|
56
56
|
{
|
|
57
57
|
name: 'should parse nucleotide deletion in single segmented reference genome, when no segment is given',
|
|
58
58
|
input: 'A123-',
|
|
59
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
59
|
+
expected: { type: 'nucleotideMutations', value: new DeletionClass(undefined, 'A', 123) },
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'should parse nucleotide deletion without valueAtReference when no segment is given',
|
|
63
63
|
input: '123-',
|
|
64
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
64
|
+
expected: { type: 'nucleotideMutations', value: new DeletionClass(undefined, undefined, 123) },
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
name: 'should parse nucleotide deletion',
|
|
68
68
|
input: 'nuc1:A123-',
|
|
69
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
69
|
+
expected: { type: 'nucleotideMutations', value: new DeletionClass('nuc1', 'A', 123) },
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: 'should parse nucleotide deletion without valueAtReference',
|
|
73
73
|
input: 'nuc1:123-',
|
|
74
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
74
|
+
expected: { type: 'nucleotideMutations', value: new DeletionClass('nuc1', undefined, 123) },
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
name: 'should parse amino acid deletion',
|
|
78
78
|
input: 'gene1:A123-',
|
|
79
|
-
expected: { type: 'aminoAcidMutations', value: new
|
|
79
|
+
expected: { type: 'aminoAcidMutations', value: new DeletionClass('gene1', 'A', 123) },
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
name: 'should parse amino acid deletion without valueAtReference',
|
|
83
83
|
input: 'gene1:123-',
|
|
84
|
-
expected: { type: 'aminoAcidMutations', value: new
|
|
84
|
+
expected: { type: 'aminoAcidMutations', value: new DeletionClass('gene1', undefined, 123) },
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: 'should return null for deletion with segment not in reference genome',
|
|
@@ -93,35 +93,35 @@ describe('parseMutation', () => {
|
|
|
93
93
|
{
|
|
94
94
|
name: 'should parse nucleotide substitution in single segmented reference genome, when no segment is given',
|
|
95
95
|
input: 'A123T',
|
|
96
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
96
|
+
expected: { type: 'nucleotideMutations', value: new SubstitutionClass(undefined, 'A', 'T', 123) },
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
name: 'should parse substitution without valueAtReference',
|
|
100
100
|
input: '123T',
|
|
101
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
101
|
+
expected: { type: 'nucleotideMutations', value: new SubstitutionClass(undefined, undefined, 'T', 123) },
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
name: 'should parse substitution with neither valueAtReference not substitutionValue',
|
|
105
105
|
input: '123',
|
|
106
106
|
expected: {
|
|
107
107
|
type: 'nucleotideMutations',
|
|
108
|
-
value: new
|
|
108
|
+
value: new SubstitutionClass(undefined, undefined, undefined, 123),
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
name: 'should parse a "no mutation" substitution',
|
|
113
113
|
input: '123.',
|
|
114
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
114
|
+
expected: { type: 'nucleotideMutations', value: new SubstitutionClass(undefined, undefined, '.', 123) },
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
name: 'should parse nucleotide substitution',
|
|
118
118
|
input: 'nuc1:A123T',
|
|
119
|
-
expected: { type: 'nucleotideMutations', value: new
|
|
119
|
+
expected: { type: 'nucleotideMutations', value: new SubstitutionClass('nuc1', 'A', 'T', 123) },
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
name: 'should parse amino acid substitution',
|
|
123
123
|
input: 'gene1:A123T',
|
|
124
|
-
expected: { type: 'aminoAcidMutations', value: new
|
|
124
|
+
expected: { type: 'aminoAcidMutations', value: new SubstitutionClass('gene1', 'A', 'T', 123) },
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
name: 'should return null for substitution with segment not in reference genome',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
2
|
|
|
3
3
|
import { getInsertionsTableData } from './getInsertionsTableData';
|
|
4
|
-
import {
|
|
4
|
+
import { InsertionClass } from '../../utils/mutations';
|
|
5
5
|
|
|
6
6
|
describe('getInsertionsTableData', () => {
|
|
7
7
|
test('should return the correct data', () => {
|
|
8
|
-
const insertion1 = new
|
|
9
|
-
const insertion2 = new
|
|
8
|
+
const insertion1 = new InsertionClass('segment1', 123, 'T');
|
|
9
|
+
const insertion2 = new InsertionClass('segment2', 234, 'AAA');
|
|
10
10
|
const data = [
|
|
11
11
|
{
|
|
12
12
|
type: 'insertion' as const,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
2
|
|
|
3
3
|
import { type BasesData, getMutationsGridData, type MutationsGridDataRow } from './getMutationsGridData';
|
|
4
|
-
import {
|
|
4
|
+
import { DeletionClass, SubstitutionClass } from '../../utils/mutations';
|
|
5
5
|
|
|
6
6
|
describe('getMutationsGridData', () => {
|
|
7
7
|
test('should return the correct data', () => {
|
|
8
8
|
const data = [
|
|
9
9
|
{
|
|
10
10
|
type: 'substitution' as const,
|
|
11
|
-
mutation: new
|
|
11
|
+
mutation: new SubstitutionClass(undefined, 'T', 'C', 123),
|
|
12
12
|
count: 1,
|
|
13
13
|
proportion: 0.9,
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
type: 'substitution' as const,
|
|
17
|
-
mutation: new
|
|
17
|
+
mutation: new SubstitutionClass(undefined, 'T', 'C', 234),
|
|
18
18
|
count: 1,
|
|
19
19
|
proportion: 0.8,
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
type: 'substitution' as const,
|
|
23
|
-
mutation: new
|
|
23
|
+
mutation: new SubstitutionClass(undefined, 'T', 'G', 234),
|
|
24
24
|
count: 1,
|
|
25
25
|
proportion: 0.05,
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
type: 'deletion' as const,
|
|
29
|
-
mutation: new
|
|
29
|
+
mutation: new DeletionClass(undefined, 'T', 234),
|
|
30
30
|
count: 2,
|
|
31
31
|
proportion: 0.1,
|
|
32
32
|
},
|
|
@@ -70,25 +70,25 @@ describe('getMutationsGridData', () => {
|
|
|
70
70
|
const data = [
|
|
71
71
|
{
|
|
72
72
|
type: 'substitution' as const,
|
|
73
|
-
mutation: new
|
|
73
|
+
mutation: new SubstitutionClass(undefined, 'T', 'C', 123),
|
|
74
74
|
count: 1,
|
|
75
75
|
proportion: aboveInterval,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
type: 'substitution' as const,
|
|
79
|
-
mutation: new
|
|
79
|
+
mutation: new SubstitutionClass(undefined, 'T', 'C', 234),
|
|
80
80
|
count: 1,
|
|
81
81
|
proportion: inInterval,
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
type: 'substitution' as const,
|
|
85
|
-
mutation: new
|
|
85
|
+
mutation: new SubstitutionClass(undefined, 'T', 'G', 234),
|
|
86
86
|
count: 1,
|
|
87
87
|
proportion: belowInterval,
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
type: 'deletion' as const,
|
|
91
|
-
mutation: new
|
|
91
|
+
mutation: new DeletionClass(undefined, 'T', 234),
|
|
92
92
|
count: 2,
|
|
93
93
|
proportion: belowInterval,
|
|
94
94
|
},
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
2
|
|
|
3
3
|
import { getMutationsTableData } from './getMutationsTableData';
|
|
4
|
-
import {
|
|
4
|
+
import { DeletionClass, SubstitutionClass } from '../../utils/mutations';
|
|
5
5
|
|
|
6
6
|
describe('getMutationsTableData', () => {
|
|
7
7
|
test('should not filter anything, when proportions are in interval', () => {
|
|
8
8
|
const data = [
|
|
9
9
|
{
|
|
10
10
|
type: 'substitution' as const,
|
|
11
|
-
mutation: new
|
|
11
|
+
mutation: new SubstitutionClass('segment1', 'A', 'T', 123),
|
|
12
12
|
count: 1,
|
|
13
13
|
proportion: 0.1,
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
type: 'deletion' as const,
|
|
17
|
-
mutation: new
|
|
17
|
+
mutation: new DeletionClass('segment2', 'C', 123),
|
|
18
18
|
count: 2,
|
|
19
19
|
proportion: 0.2,
|
|
20
20
|
},
|
|
@@ -32,8 +32,8 @@ describe('getMutationsTableData', () => {
|
|
|
32
32
|
const aboveInterval = 0.95;
|
|
33
33
|
const inInterval = 0.5;
|
|
34
34
|
|
|
35
|
-
const substitutionInInterval = new
|
|
36
|
-
const deletionInInterval = new
|
|
35
|
+
const substitutionInInterval = new SubstitutionClass('segment1', 'A', 'T', 123);
|
|
36
|
+
const deletionInInterval = new DeletionClass('segment2', 'C', 123);
|
|
37
37
|
|
|
38
38
|
const data = [
|
|
39
39
|
{
|
|
@@ -44,7 +44,7 @@ describe('getMutationsTableData', () => {
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
type: 'substitution' as const,
|
|
47
|
-
mutation: new
|
|
47
|
+
mutation: new SubstitutionClass('segment1', 'A', 'T', 234),
|
|
48
48
|
count: 1,
|
|
49
49
|
proportion: belowInterval,
|
|
50
50
|
},
|
|
@@ -56,7 +56,7 @@ describe('getMutationsTableData', () => {
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
type: 'deletion' as const,
|
|
59
|
-
mutation: new
|
|
59
|
+
mutation: new DeletionClass('segment2', 'C', 456),
|
|
60
60
|
count: 2,
|
|
61
61
|
proportion: aboveInterval,
|
|
62
62
|
},
|
|
@@ -2,7 +2,7 @@ import { type FunctionComponent } from 'preact';
|
|
|
2
2
|
|
|
3
3
|
import { getInsertionsTableData } from './getInsertionsTableData';
|
|
4
4
|
import { type InsertionEntry } from '../../types';
|
|
5
|
-
import { type
|
|
5
|
+
import { type InsertionClass } from '../../utils/mutations';
|
|
6
6
|
import { Table } from '../components/table';
|
|
7
7
|
import { sortInsertions } from '../shared/sort/sortInsertions';
|
|
8
8
|
|
|
@@ -17,11 +17,11 @@ export const InsertionsTable: FunctionComponent<InsertionsTableProps> = ({ data,
|
|
|
17
17
|
{
|
|
18
18
|
name: 'Insertion',
|
|
19
19
|
sort: {
|
|
20
|
-
compare: (a:
|
|
20
|
+
compare: (a: InsertionClass, b: InsertionClass) => {
|
|
21
21
|
return sortInsertions(a, b);
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
formatter: (cell:
|
|
24
|
+
formatter: (cell: InsertionClass) => cell.toString(),
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: 'Count',
|
|
@@ -2,7 +2,7 @@ import { type FunctionComponent } from 'preact';
|
|
|
2
2
|
|
|
3
3
|
import { getMutationsTableData } from './getMutationsTableData';
|
|
4
4
|
import { type SubstitutionOrDeletionEntry } from '../../types';
|
|
5
|
-
import { type
|
|
5
|
+
import { type DeletionClass, type SubstitutionClass } from '../../utils/mutations';
|
|
6
6
|
import type { ProportionInterval } from '../components/proportion-selector';
|
|
7
7
|
import { Table } from '../components/table';
|
|
8
8
|
import { sortSubstitutionsAndDeletions } from '../shared/sort/sortSubstitutionsAndDeletions';
|
|
@@ -20,11 +20,11 @@ const MutationsTable: FunctionComponent<MutationsTableProps> = ({ data, proporti
|
|
|
20
20
|
{
|
|
21
21
|
name: 'Mutation',
|
|
22
22
|
sort: {
|
|
23
|
-
compare: (a:
|
|
23
|
+
compare: (a: SubstitutionClass | DeletionClass, b: SubstitutionClass | DeletionClass) => {
|
|
24
24
|
return sortSubstitutionsAndDeletions(a, b);
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
|
-
formatter: (cell:
|
|
27
|
+
formatter: (cell: SubstitutionClass | DeletionClass) => cell.toString(),
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'Type',
|