@genspectrum/dashboard-components 0.6.9 → 0.6.10
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/custom-elements.json +3 -3
- package/dist/dashboard-components.js +141 -19
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +2 -2
- package/dist/style.css +31 -0
- package/package.json +4 -1
- package/src/preact/aggregatedData/aggregate.tsx +2 -0
- package/src/preact/components/chart.tsx +14 -1
- package/src/preact/components/fullscreen.tsx +57 -0
- package/src/preact/components/resize-container.tsx +5 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +2 -0
- package/src/preact/mutations/mutations.tsx +2 -0
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json +4726 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json +11143 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json +9154 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +66 -22
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +16 -7
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +17 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +28 -4
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +2 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +2 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -0
- package/src/query/queryMutationsOverTime.ts +10 -1
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +51 -1
|
@@ -61,38 +61,82 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
describe('filterProportion', () => {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const belowFilter = 0.1;
|
|
65
|
+
const atFilterMin = 0.2;
|
|
66
|
+
const inFilter = 0.5;
|
|
67
|
+
const atFilterMax = 0.9;
|
|
68
|
+
const aboveFilter = 0.99;
|
|
69
|
+
const proportionInterval = { min: atFilterMin, max: atFilterMax };
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const proportionInterval = { min: 0.2, max: 0.9 };
|
|
71
|
+
const someSubstitution = new Substitution('someSegment', 'A', 'T', 123);
|
|
72
|
+
const someOtherMutation = new Substitution('someOtherSegment', 'A', 'G', 9);
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
data
|
|
73
|
-
data.set(someSubstitution, yearMonthDay('2021-02-02'), aboveFilter);
|
|
74
|
+
it('should remove mutations where overall proportion is below filter', () => {
|
|
75
|
+
const data = getMutationOverTimeData();
|
|
74
76
|
|
|
75
|
-
filterProportion(data, proportionInterval);
|
|
77
|
+
filterProportion(data, getOverallMutationData(belowFilter), proportionInterval);
|
|
76
78
|
|
|
77
|
-
expect(data.getAsArray({ count: 0, proportion: 0 })
|
|
79
|
+
expect(data.getAsArray({ count: 0, proportion: 0 })).to.toHaveLength(0);
|
|
78
80
|
});
|
|
79
81
|
|
|
80
|
-
it('should
|
|
81
|
-
const data =
|
|
82
|
+
it('should remove mutations where overall proportion is above filter', () => {
|
|
83
|
+
const data = getMutationOverTimeData();
|
|
84
|
+
|
|
85
|
+
filterProportion(data, getOverallMutationData(aboveFilter), proportionInterval);
|
|
86
|
+
|
|
87
|
+
expect(data.getAsArray({ count: 0, proportion: 0 })).to.toHaveLength(0);
|
|
88
|
+
});
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
const inFilter = { count: 5, proportion: 0.5 };
|
|
86
|
-
const proportionInterval = { min: 0.2, max: 0.9 };
|
|
90
|
+
it('should remove mutations where overall proportion is missing', () => {
|
|
91
|
+
const data = getMutationOverTimeData();
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
data.set(someSubstitution, yearMonthDay('2021-01-01'), belowFilter);
|
|
90
|
-
data.set(someSubstitution, yearMonthDay('2021-02-02'), aboveFilter);
|
|
91
|
-
data.set(someSubstitution, yearMonthDay('2021-03-03'), inFilter);
|
|
93
|
+
filterProportion(data, getOverallMutationData(aboveFilter, someOtherMutation), proportionInterval);
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
expect(data.getAsArray({ count: 0, proportion: 0 })).to.toHaveLength(0);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should not remove mutation where overall proportion is at lower border of filter', () => {
|
|
99
|
+
const data = getMutationOverTimeData();
|
|
100
|
+
|
|
101
|
+
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
94
102
|
|
|
95
|
-
expect(data.getRow(someSubstitution, { count: 0, proportion: 0 })
|
|
103
|
+
expect(data.getRow(someSubstitution, { count: 0, proportion: 0 })).to.toHaveLength(2);
|
|
96
104
|
});
|
|
105
|
+
|
|
106
|
+
it('should not remove mutation where overall proportion is within filter', () => {
|
|
107
|
+
const data = getMutationOverTimeData();
|
|
108
|
+
|
|
109
|
+
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
110
|
+
|
|
111
|
+
expect(data.getRow(someSubstitution, { count: 0, proportion: 0 })).to.toHaveLength(2);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('should not remove mutation where overall proportion is at upper border of filter', () => {
|
|
115
|
+
const data = getMutationOverTimeData();
|
|
116
|
+
|
|
117
|
+
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
118
|
+
|
|
119
|
+
expect(data.getRow(someSubstitution, { count: 0, proportion: 0 })).to.toHaveLength(2);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
function getMutationOverTimeData() {
|
|
123
|
+
const data = new Map2d<Substitution | Deletion, Temporal, MutationOverTimeMutationValue>();
|
|
124
|
+
data.set(someSubstitution, yearMonthDay('2021-01-01'), { count: 1, proportion: 0.1 });
|
|
125
|
+
data.set(someSubstitution, yearMonthDay('2021-02-02'), { count: 99, proportion: 0.99 });
|
|
126
|
+
return data;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getOverallMutationData(proportion: number = 0.1, mutation: Substitution = someSubstitution) {
|
|
130
|
+
return {
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: 'substitution' as const,
|
|
134
|
+
count: -1,
|
|
135
|
+
mutation,
|
|
136
|
+
proportion,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
97
141
|
});
|
|
98
142
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type Dataset } from '../../operator/Dataset';
|
|
1
2
|
import { type MutationOverTimeDataGroupedByMutation } from '../../query/queryMutationsOverTime';
|
|
3
|
+
import { type DeletionEntry, type SubstitutionEntry } from '../../types';
|
|
2
4
|
import type { DisplayedSegment } from '../components/SegmentSelector';
|
|
3
5
|
import type { DisplayedMutationType } from '../components/mutation-type-selector';
|
|
4
6
|
|
|
5
7
|
export function getFilteredMutationOverTimeData(
|
|
6
8
|
data: MutationOverTimeDataGroupedByMutation,
|
|
9
|
+
overallMutationData: Dataset<SubstitutionEntry | DeletionEntry>,
|
|
7
10
|
displayedSegments: DisplayedSegment[],
|
|
8
11
|
displayedMutationTypes: DisplayedMutationType[],
|
|
9
12
|
proportionInterval: { min: number; max: number },
|
|
@@ -11,7 +14,7 @@ export function getFilteredMutationOverTimeData(
|
|
|
11
14
|
const filteredData = data.copy();
|
|
12
15
|
filterDisplayedSegments(displayedSegments, filteredData);
|
|
13
16
|
filterMutationTypes(displayedMutationTypes, filteredData);
|
|
14
|
-
filterProportion(filteredData, proportionInterval);
|
|
17
|
+
filterProportion(filteredData, overallMutationData, proportionInterval);
|
|
15
18
|
|
|
16
19
|
return filteredData;
|
|
17
20
|
}
|
|
@@ -48,18 +51,24 @@ export function filterMutationTypes(
|
|
|
48
51
|
|
|
49
52
|
export function filterProportion(
|
|
50
53
|
data: MutationOverTimeDataGroupedByMutation,
|
|
54
|
+
overallMutationData: Dataset<SubstitutionEntry | DeletionEntry>,
|
|
51
55
|
proportionInterval: {
|
|
52
56
|
min: number;
|
|
53
57
|
max: number;
|
|
54
58
|
},
|
|
55
59
|
) {
|
|
60
|
+
const overallProportionsByMutation = overallMutationData.content.reduce(
|
|
61
|
+
(acc, { mutation, proportion }) => ({
|
|
62
|
+
...acc,
|
|
63
|
+
[mutation.toString()]: proportion,
|
|
64
|
+
}),
|
|
65
|
+
{} as Record<string, number>,
|
|
66
|
+
);
|
|
67
|
+
|
|
56
68
|
data.getFirstAxisKeys().forEach((mutation) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(value) => value.proportion >= proportionInterval.min && value.proportion <= proportionInterval.max,
|
|
61
|
-
)
|
|
62
|
-
) {
|
|
69
|
+
const overallProportion = overallProportionsByMutation[mutation.toString()] || -1;
|
|
70
|
+
|
|
71
|
+
if (overallProportion < proportionInterval.min || overallProportion > proportionInterval.max) {
|
|
63
72
|
data.deleteRow(mutation);
|
|
64
73
|
}
|
|
65
74
|
});
|
|
@@ -14,6 +14,7 @@ import nucleotideMutation_tooManyMutations from './__mockData__/nucleotideMutati
|
|
|
14
14
|
import { MutationsOverTime, type MutationsOverTimeProps } from './mutations-over-time';
|
|
15
15
|
import { AGGREGATED_ENDPOINT, LAPIS_URL, NUCLEOTIDE_MUTATIONS_ENDPOINT } from '../../constants';
|
|
16
16
|
import referenceGenome from '../../lapisApi/__mockData__/referenceGenome.json';
|
|
17
|
+
import nucleotideMutations_byMonthOverall from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json';
|
|
17
18
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
18
19
|
import { ReferenceGenomeContext } from '../ReferenceGenomeContext';
|
|
19
20
|
|
|
@@ -90,6 +91,22 @@ export const Default: StoryObj<MutationsOverTimeProps> = {
|
|
|
90
91
|
body: aggregated_date,
|
|
91
92
|
},
|
|
92
93
|
},
|
|
94
|
+
{
|
|
95
|
+
matcher: {
|
|
96
|
+
name: 'nucleotideMutations_overall',
|
|
97
|
+
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
98
|
+
body: {
|
|
99
|
+
pangoLineage: 'JN.1*',
|
|
100
|
+
dateFrom: '2024-01-15',
|
|
101
|
+
dateTo: '2024-07-10',
|
|
102
|
+
minProportion: 0.001,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
response: {
|
|
106
|
+
status: 200,
|
|
107
|
+
body: nucleotideMutations_byMonthOverall,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
93
110
|
{
|
|
94
111
|
matcher: {
|
|
95
112
|
name: 'nucleotideMutations_01',
|
|
@@ -3,11 +3,19 @@ import { type Dispatch, type StateUpdater, useContext, useMemo, useState } from
|
|
|
3
3
|
|
|
4
4
|
import { getFilteredMutationOverTimeData } from './getFilteredMutationsOverTimeData';
|
|
5
5
|
import MutationsOverTimeGrid from './mutations-over-time-grid';
|
|
6
|
+
import { type Dataset } from '../../operator/Dataset';
|
|
6
7
|
import {
|
|
7
8
|
type MutationOverTimeDataGroupedByMutation,
|
|
8
9
|
queryMutationsOverTimeData,
|
|
10
|
+
queryOverallMutationData,
|
|
9
11
|
} from '../../query/queryMutationsOverTime';
|
|
10
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
type DeletionEntry,
|
|
14
|
+
type LapisFilter,
|
|
15
|
+
type SequenceType,
|
|
16
|
+
type SubstitutionEntry,
|
|
17
|
+
type TemporalGranularity,
|
|
18
|
+
} from '../../types';
|
|
11
19
|
import { compareTemporal } from '../../utils/temporal';
|
|
12
20
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
13
21
|
import { type DisplayedSegment, SegmentSelector, useDisplayedSegments } from '../components/SegmentSelector';
|
|
@@ -16,6 +24,7 @@ import { ColorScaleSelectorDropdown } from '../components/color-scale-selector-d
|
|
|
16
24
|
import { CsvDownloadButton } from '../components/csv-download-button';
|
|
17
25
|
import { ErrorBoundary } from '../components/error-boundary';
|
|
18
26
|
import { ErrorDisplay } from '../components/error-display';
|
|
27
|
+
import { Fullscreen } from '../components/fullscreen';
|
|
19
28
|
import Info from '../components/info';
|
|
20
29
|
import { LoadingDisplay } from '../components/loading-display';
|
|
21
30
|
import { type DisplayedMutationType, MutationTypeSelector } from '../components/mutation-type-selector';
|
|
@@ -63,7 +72,11 @@ export const MutationsOverTimeInner: FunctionComponent<MutationsOverTimeInnerPro
|
|
|
63
72
|
}) => {
|
|
64
73
|
const lapis = useContext(LapisUrlContext);
|
|
65
74
|
const { data, error, isLoading } = useQuery(async () => {
|
|
66
|
-
|
|
75
|
+
const [mutationOverTimeData, overallMutationData] = await Promise.all([
|
|
76
|
+
queryMutationsOverTimeData(lapisFilter, sequenceType, lapis, lapisDateField, granularity),
|
|
77
|
+
queryOverallMutationData(lapisFilter, sequenceType, lapis),
|
|
78
|
+
]);
|
|
79
|
+
return { mutationOverTimeData, overallMutationData };
|
|
67
80
|
}, [lapisFilter, sequenceType, lapis, granularity, lapisDateField]);
|
|
68
81
|
|
|
69
82
|
if (isLoading) {
|
|
@@ -78,19 +91,28 @@ export const MutationsOverTimeInner: FunctionComponent<MutationsOverTimeInnerPro
|
|
|
78
91
|
return <NoDataDisplay />;
|
|
79
92
|
}
|
|
80
93
|
|
|
81
|
-
return
|
|
94
|
+
return (
|
|
95
|
+
<MutationsOverTimeTabs
|
|
96
|
+
overallMutationData={data.overallMutationData}
|
|
97
|
+
mutationOverTimeData={data.mutationOverTimeData}
|
|
98
|
+
sequenceType={sequenceType}
|
|
99
|
+
views={views}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
82
102
|
};
|
|
83
103
|
|
|
84
104
|
type MutationOverTimeTabsProps = {
|
|
85
105
|
mutationOverTimeData: MutationOverTimeDataGroupedByMutation;
|
|
86
106
|
sequenceType: SequenceType;
|
|
87
107
|
views: View[];
|
|
108
|
+
overallMutationData: Dataset<SubstitutionEntry | DeletionEntry>;
|
|
88
109
|
};
|
|
89
110
|
|
|
90
111
|
const MutationsOverTimeTabs: FunctionComponent<MutationOverTimeTabsProps> = ({
|
|
91
112
|
mutationOverTimeData,
|
|
92
113
|
sequenceType,
|
|
93
114
|
views,
|
|
115
|
+
overallMutationData,
|
|
94
116
|
}) => {
|
|
95
117
|
const [proportionInterval, setProportionInterval] = useState({ min: 0.05, max: 0.9 });
|
|
96
118
|
const [colorScale, setColorScale] = useState<ColorScale>({ min: 0, max: 1, color: 'indigo' });
|
|
@@ -105,11 +127,12 @@ const MutationsOverTimeTabs: FunctionComponent<MutationOverTimeTabsProps> = ({
|
|
|
105
127
|
() =>
|
|
106
128
|
getFilteredMutationOverTimeData(
|
|
107
129
|
mutationOverTimeData,
|
|
130
|
+
overallMutationData,
|
|
108
131
|
displayedSegments,
|
|
109
132
|
displayedMutationTypes,
|
|
110
133
|
proportionInterval,
|
|
111
134
|
),
|
|
112
|
-
[mutationOverTimeData, displayedSegments, displayedMutationTypes, proportionInterval],
|
|
135
|
+
[mutationOverTimeData, overallMutationData, displayedSegments, displayedMutationTypes, proportionInterval],
|
|
113
136
|
);
|
|
114
137
|
|
|
115
138
|
const getTab = (view: View) => {
|
|
@@ -188,6 +211,7 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
|
|
|
188
211
|
filename='mutations_over_time.csv'
|
|
189
212
|
/>
|
|
190
213
|
<Info>Info for mutations over time</Info>
|
|
214
|
+
<Fullscreen />
|
|
191
215
|
</>
|
|
192
216
|
);
|
|
193
217
|
};
|
|
@@ -13,6 +13,7 @@ import { LapisUrlContext } from '../LapisUrlContext';
|
|
|
13
13
|
import { CsvDownloadButton } from '../components/csv-download-button';
|
|
14
14
|
import { ErrorBoundary } from '../components/error-boundary';
|
|
15
15
|
import { ErrorDisplay } from '../components/error-display';
|
|
16
|
+
import { Fullscreen } from '../components/fullscreen';
|
|
16
17
|
import Info, { InfoHeadline1, InfoParagraph } from '../components/info';
|
|
17
18
|
import { LoadingDisplay } from '../components/loading-display';
|
|
18
19
|
import { NoDataDisplay } from '../components/no-data-display';
|
|
@@ -151,6 +152,7 @@ const Toolbar = ({ activeTab, data, granularity, yAxisScaleType, setYAxisScaleTy
|
|
|
151
152
|
filename='number_of_sequences_over_time.csv'
|
|
152
153
|
/>
|
|
153
154
|
<NumberSequencesOverTimeInfo />
|
|
155
|
+
<Fullscreen />
|
|
154
156
|
</>
|
|
155
157
|
);
|
|
156
158
|
};
|
|
@@ -13,6 +13,7 @@ import { ConfidenceIntervalSelector } from '../components/confidence-interval-se
|
|
|
13
13
|
import { CsvDownloadButton } from '../components/csv-download-button';
|
|
14
14
|
import { ErrorBoundary } from '../components/error-boundary';
|
|
15
15
|
import { ErrorDisplay } from '../components/error-display';
|
|
16
|
+
import { Fullscreen } from '../components/fullscreen';
|
|
16
17
|
import Info, { InfoHeadline1, InfoParagraph } from '../components/info';
|
|
17
18
|
import { LoadingDisplay } from '../components/loading-display';
|
|
18
19
|
import { NoDataDisplay } from '../components/no-data-display';
|
|
@@ -230,6 +231,7 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
|
|
|
230
231
|
/>
|
|
231
232
|
|
|
232
233
|
<PrevalenceOverTimeInfo />
|
|
234
|
+
<Fullscreen />
|
|
233
235
|
</>
|
|
234
236
|
);
|
|
235
237
|
};
|
|
@@ -10,6 +10,7 @@ import { type LapisFilter } from '../../types';
|
|
|
10
10
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
11
11
|
import { ErrorBoundary } from '../components/error-boundary';
|
|
12
12
|
import { ErrorDisplay } from '../components/error-display';
|
|
13
|
+
import { Fullscreen } from '../components/fullscreen';
|
|
13
14
|
import Info, { InfoHeadline1, InfoHeadline2, InfoLink, InfoParagraph } from '../components/info';
|
|
14
15
|
import { LoadingDisplay } from '../components/loading-display';
|
|
15
16
|
import { NoDataDisplay } from '../components/no-data-display';
|
|
@@ -156,6 +157,7 @@ const RelativeGrowthAdvantageToolbar: FunctionComponent<RelativeGrowthAdvantageT
|
|
|
156
157
|
<>
|
|
157
158
|
<ScalingSelector yAxisScaleType={yAxisScaleType} setYAxisScaleType={setYAxisScaleType} />
|
|
158
159
|
<RelativeGrowthAdvantageInfo generationTime={generationTime} />
|
|
160
|
+
<Fullscreen />
|
|
159
161
|
</>
|
|
160
162
|
);
|
|
161
163
|
};
|
|
@@ -36,9 +36,18 @@ export type MutationOverTimeDataGroupedByMutation = Map2d<
|
|
|
36
36
|
|
|
37
37
|
const MAX_NUMBER_OF_GRID_COLUMNS = 200;
|
|
38
38
|
|
|
39
|
+
export async function queryOverallMutationData(
|
|
40
|
+
lapisFilter: LapisFilter,
|
|
41
|
+
sequenceType: SequenceType,
|
|
42
|
+
lapis: string,
|
|
43
|
+
signal?: AbortSignal,
|
|
44
|
+
) {
|
|
45
|
+
return fetchAndPrepareSubstitutionsOrDeletions(lapisFilter, sequenceType).evaluate(lapis, signal);
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
export async function queryMutationsOverTimeData(
|
|
40
49
|
lapisFilter: LapisFilter,
|
|
41
|
-
sequenceType:
|
|
50
|
+
sequenceType: SequenceType,
|
|
42
51
|
lapis: string,
|
|
43
52
|
lapisDateField: string,
|
|
44
53
|
granularity: TemporalGranularity,
|
|
@@ -20,6 +20,7 @@ import aminoAcidMutations_23_01_2024 from '../../preact/mutationsOverTime/__mock
|
|
|
20
20
|
import aminoAcidMutations_24_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json';
|
|
21
21
|
import aminoAcidMutations_25_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json';
|
|
22
22
|
import aminoAcidMutations_26_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json';
|
|
23
|
+
import aminoAcidMutations_byDayOverall from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json';
|
|
23
24
|
import nucleotideMutation_01 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json';
|
|
24
25
|
import nucleotideMutation_02 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json';
|
|
25
26
|
import nucleotideMutation_03 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json';
|
|
@@ -27,6 +28,8 @@ import nucleotideMutation_04 from '../../preact/mutationsOverTime/__mockData__/n
|
|
|
27
28
|
import nucleotideMutation_05 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json';
|
|
28
29
|
import nucleotideMutation_06 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json';
|
|
29
30
|
import nucleotideMutation_07 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json';
|
|
31
|
+
import nucleotideMutations_byMonthOverall from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json';
|
|
32
|
+
import nucleotideMutations_byWeekOverall from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json';
|
|
30
33
|
import nucleotideMutation_week3 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json';
|
|
31
34
|
import nucleotideMutation_week4 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json';
|
|
32
35
|
import nucleotideMutation_week5 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json';
|
|
@@ -38,7 +41,6 @@ const codeExample = String.raw`
|
|
|
38
41
|
lapisFilter='{ "pangoLineage": "JN.1*", "dateFrom": "2024-01-15", "dateTo": "2024-07-10" }'
|
|
39
42
|
sequenceType="nucleotide"
|
|
40
43
|
views='["grid"]'
|
|
41
|
-
headline="Mutations over time"
|
|
42
44
|
width='100%'
|
|
43
45
|
height='700px'
|
|
44
46
|
granularity="month"
|
|
@@ -124,6 +126,22 @@ export const ByMonth: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
124
126
|
body: aggregated_date,
|
|
125
127
|
},
|
|
126
128
|
},
|
|
129
|
+
{
|
|
130
|
+
matcher: {
|
|
131
|
+
name: 'nucleotideMutations_overall',
|
|
132
|
+
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
133
|
+
body: {
|
|
134
|
+
pangoLineage: 'JN.1*',
|
|
135
|
+
dateFrom: '2024-01-15',
|
|
136
|
+
dateTo: '2024-07-10',
|
|
137
|
+
minProportion: 0.001,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
response: {
|
|
141
|
+
status: 200,
|
|
142
|
+
body: nucleotideMutations_byMonthOverall,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
127
145
|
{
|
|
128
146
|
matcher: {
|
|
129
147
|
name: 'nucleotideMutations_01',
|
|
@@ -268,6 +286,22 @@ export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
268
286
|
body: aggregated_byWeek,
|
|
269
287
|
},
|
|
270
288
|
},
|
|
289
|
+
{
|
|
290
|
+
matcher: {
|
|
291
|
+
name: 'nucleotideMutation_overall',
|
|
292
|
+
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
293
|
+
body: {
|
|
294
|
+
pangoLineage: 'JN.1*',
|
|
295
|
+
dateFrom: '2024-01-15',
|
|
296
|
+
dateTo: '2024-02-11',
|
|
297
|
+
minProportion: 0.001,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
response: {
|
|
301
|
+
status: 200,
|
|
302
|
+
body: nucleotideMutations_byWeekOverall,
|
|
303
|
+
},
|
|
304
|
+
},
|
|
271
305
|
{
|
|
272
306
|
matcher: {
|
|
273
307
|
name: 'nucleotideMutation_week3',
|
|
@@ -359,6 +393,22 @@ export const AminoAcidMutationsByDay: StoryObj<Required<MutationsOverTimeProps>>
|
|
|
359
393
|
body: aggregated_byDay,
|
|
360
394
|
},
|
|
361
395
|
},
|
|
396
|
+
{
|
|
397
|
+
matcher: {
|
|
398
|
+
name: 'aminoAcidMutations_overall',
|
|
399
|
+
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
400
|
+
body: {
|
|
401
|
+
pangoLineage: 'JN.1*',
|
|
402
|
+
dateFrom: '2024-01-20',
|
|
403
|
+
dateTo: '2024-01-26',
|
|
404
|
+
minProportion: 0.001,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
response: {
|
|
408
|
+
status: 200,
|
|
409
|
+
body: aminoAcidMutations_byDayOverall,
|
|
410
|
+
},
|
|
411
|
+
},
|
|
362
412
|
{
|
|
363
413
|
matcher: {
|
|
364
414
|
name: 'aminoAcidMutations_20_01_2024',
|