@genspectrum/dashboard-components 0.5.3 → 0.5.5
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 +322 -0
- package/dist/dashboard-components.js +609 -265
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +78 -0
- package/package.json +1 -1
- package/src/lapisApi/ReferenceGenome.ts +2 -0
- package/src/preact/aggregatedData/aggregate.tsx +2 -14
- package/src/preact/dateRangeSelector/date-range-selector.tsx +2 -14
- package/src/preact/locationFilter/location-filter.tsx +2 -7
- package/src/preact/mutationComparison/mutation-comparison.tsx +2 -10
- package/src/preact/mutationFilter/mutation-filter-info.tsx +117 -0
- package/src/preact/mutationFilter/mutation-filter.tsx +2 -2
- package/src/preact/mutationFilter/sequenceTypeFromSegment.spec.ts +1 -1
- package/src/preact/mutationFilter/sequenceTypeFromSegment.ts +2 -2
- package/src/preact/mutations/mutations.tsx +2 -10
- package/src/preact/numberSequencesOverTime/__mockData__/oneVariantEG.json +1702 -0
- package/src/preact/numberSequencesOverTime/__mockData__/twoVariantsEG.json +1710 -0
- package/src/preact/numberSequencesOverTime/__mockData__/twoVariantsJN1.json +1070 -0
- package/src/preact/numberSequencesOverTime/__mockData__/twoVariantsXBB.json +506 -0
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.spec.ts +75 -0
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +39 -0
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +58 -0
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-table.tsx +32 -0
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +133 -0
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +105 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +11 -20
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +2 -20
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -14
- package/src/preact/textInput/text-input.tsx +2 -2
- package/src/query/queryAggregatedDataOverTime.ts +78 -0
- package/src/query/queryNumberOfSequencesOverTime.spec.ts +195 -0
- package/src/query/queryNumberOfSequencesOverTime.ts +33 -0
- package/src/query/queryPrevalenceOverTime.ts +10 -86
- package/src/utils/sort.ts +9 -0
- package/src/utils/temporalTestHelpers.ts +9 -0
- package/src/utils/utils.ts +7 -0
- package/src/web-components/input/gs-mutation-filter.stories.ts +57 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +232 -0
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +140 -0
- package/src/web-components/visualization/index.ts +1 -0
|
@@ -347,6 +347,7 @@ const getSegmentNames = (referenceGenome, sequenceType) => {
|
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
|
+
const isSingleSegmented = (referenceGenome) => referenceGenome.nucleotideSequences.length === 1;
|
|
350
351
|
const orderByType = z$1.enum(["ascending", "descending"]);
|
|
351
352
|
const orderBy = z$1.object({
|
|
352
353
|
field: z$1.string(),
|
|
@@ -489,14 +490,14 @@ const substitutionsOrDeletionsEndpoint = (lapisUrl, sequenceType) => {
|
|
|
489
490
|
return sequenceType === "amino acid" ? `${lapisUrl}/sample/aminoAcidMutations` : `${lapisUrl}/sample/nucleotideMutations`;
|
|
490
491
|
};
|
|
491
492
|
const referenceGenomeEndpoint = (lapisUrl) => `${lapisUrl}/sample/referenceGenome`;
|
|
492
|
-
var __defProp$
|
|
493
|
-
var __getOwnPropDesc$
|
|
494
|
-
var __decorateClass$
|
|
495
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
493
|
+
var __defProp$b = Object.defineProperty;
|
|
494
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
495
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
496
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
496
497
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
497
498
|
if (decorator = decorators[i2])
|
|
498
499
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
499
|
-
if (kind && result) __defProp$
|
|
500
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
500
501
|
return result;
|
|
501
502
|
};
|
|
502
503
|
let App = class extends LitElement {
|
|
@@ -527,14 +528,14 @@ let App = class extends LitElement {
|
|
|
527
528
|
return this;
|
|
528
529
|
}
|
|
529
530
|
};
|
|
530
|
-
__decorateClass$
|
|
531
|
+
__decorateClass$b([
|
|
531
532
|
provide({ context: lapisContext }),
|
|
532
533
|
n2()
|
|
533
534
|
], App.prototype, "lapis", 2);
|
|
534
|
-
__decorateClass$
|
|
535
|
+
__decorateClass$b([
|
|
535
536
|
provide({ context: referenceGenomeContext })
|
|
536
537
|
], App.prototype, "referenceGenome", 2);
|
|
537
|
-
App = __decorateClass$
|
|
538
|
+
App = __decorateClass$b([
|
|
538
539
|
t$2("gs-app")
|
|
539
540
|
], App);
|
|
540
541
|
var f$1 = 0;
|
|
@@ -1688,24 +1689,13 @@ function useQuery(fetchDataCallback, dependencies = []) {
|
|
|
1688
1689
|
return { data, error, isLoading };
|
|
1689
1690
|
}
|
|
1690
1691
|
const MutationComparison = ({
|
|
1691
|
-
lapisFilters,
|
|
1692
|
-
sequenceType,
|
|
1693
|
-
views,
|
|
1694
1692
|
width,
|
|
1695
1693
|
height,
|
|
1696
1694
|
headline = "Mutation comparison",
|
|
1697
|
-
|
|
1695
|
+
...innerProps
|
|
1698
1696
|
}) => {
|
|
1699
1697
|
const size2 = { height, width };
|
|
1700
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
1701
|
-
MutationComparisonInner,
|
|
1702
|
-
{
|
|
1703
|
-
lapisFilters,
|
|
1704
|
-
sequenceType,
|
|
1705
|
-
views,
|
|
1706
|
-
pageSize
|
|
1707
|
-
}
|
|
1708
|
-
) }) }) });
|
|
1698
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...innerProps }) }) }) });
|
|
1709
1699
|
};
|
|
1710
1700
|
const MutationComparisonInner = ({
|
|
1711
1701
|
lapisFilters,
|
|
@@ -4615,14 +4605,14 @@ input.tab:checked + .tab-content,
|
|
|
4615
4605
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
4616
4606
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
4617
4607
|
}`;
|
|
4618
|
-
var __defProp$
|
|
4619
|
-
var __getOwnPropDesc$
|
|
4620
|
-
var __decorateClass$
|
|
4621
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4608
|
+
var __defProp$a = Object.defineProperty;
|
|
4609
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
4610
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
4611
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
4622
4612
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
4623
4613
|
if (decorator = decorators[i2])
|
|
4624
4614
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4625
|
-
if (kind && result) __defProp$
|
|
4615
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
4626
4616
|
return result;
|
|
4627
4617
|
};
|
|
4628
4618
|
const tailwindElementCss = unsafeCSS(tailwindStyle);
|
|
@@ -4644,10 +4634,10 @@ const _PreactLitAdapter = class _PreactLitAdapter extends ReactiveElement {
|
|
|
4644
4634
|
};
|
|
4645
4635
|
_PreactLitAdapter.styles = [tailwindElementCss, minMaxPercentSliderElementCss];
|
|
4646
4636
|
let PreactLitAdapter = _PreactLitAdapter;
|
|
4647
|
-
__decorateClass$
|
|
4637
|
+
__decorateClass$a([
|
|
4648
4638
|
consume({ context: lapisContext })
|
|
4649
4639
|
], PreactLitAdapter.prototype, "lapis", 2);
|
|
4650
|
-
__decorateClass$
|
|
4640
|
+
__decorateClass$a([
|
|
4651
4641
|
consume({ context: referenceGenomeContext, subscribe: true })
|
|
4652
4642
|
], PreactLitAdapter.prototype, "referenceGenome", 2);
|
|
4653
4643
|
const gridJsElementCss = unsafeCSS(gridJsStyle);
|
|
@@ -4655,14 +4645,14 @@ const _PreactLitAdapterWithGridJsStyles = class _PreactLitAdapterWithGridJsStyle
|
|
|
4655
4645
|
};
|
|
4656
4646
|
_PreactLitAdapterWithGridJsStyles.styles = [...PreactLitAdapter.styles, gridJsElementCss];
|
|
4657
4647
|
let PreactLitAdapterWithGridJsStyles = _PreactLitAdapterWithGridJsStyles;
|
|
4658
|
-
var __defProp$
|
|
4659
|
-
var __getOwnPropDesc$
|
|
4660
|
-
var __decorateClass$
|
|
4661
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4648
|
+
var __defProp$9 = Object.defineProperty;
|
|
4649
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
4650
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
4651
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
4662
4652
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
4663
4653
|
if (decorator = decorators[i2])
|
|
4664
4654
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4665
|
-
if (kind && result) __defProp$
|
|
4655
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
4666
4656
|
return result;
|
|
4667
4657
|
};
|
|
4668
4658
|
let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -4691,28 +4681,28 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
4691
4681
|
);
|
|
4692
4682
|
}
|
|
4693
4683
|
};
|
|
4694
|
-
__decorateClass$
|
|
4684
|
+
__decorateClass$9([
|
|
4695
4685
|
n2({ type: Array })
|
|
4696
4686
|
], MutationComparisonComponent.prototype, "lapisFilters", 2);
|
|
4697
|
-
__decorateClass$
|
|
4687
|
+
__decorateClass$9([
|
|
4698
4688
|
n2({ type: String })
|
|
4699
4689
|
], MutationComparisonComponent.prototype, "sequenceType", 2);
|
|
4700
|
-
__decorateClass$
|
|
4690
|
+
__decorateClass$9([
|
|
4701
4691
|
n2({ type: Array })
|
|
4702
4692
|
], MutationComparisonComponent.prototype, "views", 2);
|
|
4703
|
-
__decorateClass$
|
|
4693
|
+
__decorateClass$9([
|
|
4704
4694
|
n2({ type: String })
|
|
4705
4695
|
], MutationComparisonComponent.prototype, "width", 2);
|
|
4706
|
-
__decorateClass$
|
|
4696
|
+
__decorateClass$9([
|
|
4707
4697
|
n2({ type: String })
|
|
4708
4698
|
], MutationComparisonComponent.prototype, "height", 2);
|
|
4709
|
-
__decorateClass$
|
|
4699
|
+
__decorateClass$9([
|
|
4710
4700
|
n2({ type: String })
|
|
4711
4701
|
], MutationComparisonComponent.prototype, "headline", 2);
|
|
4712
|
-
__decorateClass$
|
|
4702
|
+
__decorateClass$9([
|
|
4713
4703
|
n2({ type: Object })
|
|
4714
4704
|
], MutationComparisonComponent.prototype, "pageSize", 2);
|
|
4715
|
-
MutationComparisonComponent = __decorateClass$
|
|
4705
|
+
MutationComparisonComponent = __decorateClass$9([
|
|
4716
4706
|
t$2("gs-mutation-comparison")
|
|
4717
4707
|
], MutationComparisonComponent);
|
|
4718
4708
|
function getInsertionsTableData(data) {
|
|
@@ -4979,24 +4969,13 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
|
|
|
4979
4969
|
};
|
|
4980
4970
|
}
|
|
4981
4971
|
const Mutations = ({
|
|
4982
|
-
lapisFilter,
|
|
4983
|
-
sequenceType,
|
|
4984
|
-
views,
|
|
4985
4972
|
width,
|
|
4986
4973
|
height,
|
|
4987
4974
|
headline = "Mutations",
|
|
4988
|
-
|
|
4975
|
+
...innerProps
|
|
4989
4976
|
}) => {
|
|
4990
4977
|
const size2 = { height, width };
|
|
4991
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
4992
|
-
MutationsInner,
|
|
4993
|
-
{
|
|
4994
|
-
lapisFilter,
|
|
4995
|
-
sequenceType,
|
|
4996
|
-
views,
|
|
4997
|
-
pageSize
|
|
4998
|
-
}
|
|
4999
|
-
) }) }) });
|
|
4978
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsInner, { ...innerProps }) }) }) });
|
|
5000
4979
|
};
|
|
5001
4980
|
const MutationsInner = ({
|
|
5002
4981
|
lapisFilter,
|
|
@@ -5130,14 +5109,14 @@ const Toolbar$2 = ({
|
|
|
5130
5109
|
/* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for mutations" })
|
|
5131
5110
|
] });
|
|
5132
5111
|
};
|
|
5133
|
-
var __defProp$
|
|
5134
|
-
var __getOwnPropDesc$
|
|
5135
|
-
var __decorateClass$
|
|
5136
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5112
|
+
var __defProp$8 = Object.defineProperty;
|
|
5113
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
5114
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
5115
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
5137
5116
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
5138
5117
|
if (decorator = decorators[i2])
|
|
5139
5118
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5140
|
-
if (kind && result) __defProp$
|
|
5119
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
5141
5120
|
return result;
|
|
5142
5121
|
};
|
|
5143
5122
|
let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -5166,28 +5145,28 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
5166
5145
|
);
|
|
5167
5146
|
}
|
|
5168
5147
|
};
|
|
5169
|
-
__decorateClass$
|
|
5148
|
+
__decorateClass$8([
|
|
5170
5149
|
n2({ type: Object })
|
|
5171
5150
|
], MutationsComponent.prototype, "lapisFilter", 2);
|
|
5172
|
-
__decorateClass$
|
|
5151
|
+
__decorateClass$8([
|
|
5173
5152
|
n2({ type: String })
|
|
5174
5153
|
], MutationsComponent.prototype, "sequenceType", 2);
|
|
5175
|
-
__decorateClass$
|
|
5154
|
+
__decorateClass$8([
|
|
5176
5155
|
n2({ type: Array })
|
|
5177
5156
|
], MutationsComponent.prototype, "views", 2);
|
|
5178
|
-
__decorateClass$
|
|
5157
|
+
__decorateClass$8([
|
|
5179
5158
|
n2({ type: String })
|
|
5180
5159
|
], MutationsComponent.prototype, "width", 2);
|
|
5181
|
-
__decorateClass$
|
|
5160
|
+
__decorateClass$8([
|
|
5182
5161
|
n2({ type: String })
|
|
5183
5162
|
], MutationsComponent.prototype, "height", 2);
|
|
5184
|
-
__decorateClass$
|
|
5163
|
+
__decorateClass$8([
|
|
5185
5164
|
n2({ type: String })
|
|
5186
5165
|
], MutationsComponent.prototype, "headline", 2);
|
|
5187
|
-
__decorateClass$
|
|
5166
|
+
__decorateClass$8([
|
|
5188
5167
|
n2({ type: Object })
|
|
5189
5168
|
], MutationsComponent.prototype, "pageSize", 2);
|
|
5190
|
-
MutationsComponent = __decorateClass$
|
|
5169
|
+
MutationsComponent = __decorateClass$8([
|
|
5191
5170
|
t$2("gs-mutations")
|
|
5192
5171
|
], MutationsComponent);
|
|
5193
5172
|
function getPrevalenceOverTimeTableData(data, granularity) {
|
|
@@ -5203,6 +5182,9 @@ function getPrevalenceOverTimeTableData(data, granularity) {
|
|
|
5203
5182
|
};
|
|
5204
5183
|
});
|
|
5205
5184
|
}
|
|
5185
|
+
function sortNullToBeginningThenByDate(a2, b3) {
|
|
5186
|
+
return a2.dateRange === null ? -1 : b3.dateRange === null ? 1 : a2.dateRange.toString().localeCompare(b3.dateRange.toString());
|
|
5187
|
+
}
|
|
5206
5188
|
const _LogitScale = class _LogitScale extends Scale {
|
|
5207
5189
|
constructor(cfg) {
|
|
5208
5190
|
super(cfg);
|
|
@@ -5332,13 +5314,9 @@ const PrevalenceOverTimeBarChart = ({
|
|
|
5332
5314
|
};
|
|
5333
5315
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
5334
5316
|
};
|
|
5335
|
-
function sortNullToBeginningThenByDate(a2, b3) {
|
|
5336
|
-
return a2.dateRange === null ? -1 : b3.dateRange === null ? 1 : a2.dateRange.toString().localeCompare(b3.dateRange.toString());
|
|
5337
|
-
}
|
|
5338
5317
|
const getDataset$1 = (prevalenceOverTimeVariant, index, confidenceIntervalMethod) => {
|
|
5339
5318
|
return {
|
|
5340
5319
|
borderWidth: 1,
|
|
5341
|
-
pointRadius: 0,
|
|
5342
5320
|
label: prevalenceOverTimeVariant.displayName,
|
|
5343
5321
|
backgroundColor: singleGraphColorRGBAById(index, 0.3),
|
|
5344
5322
|
borderColor: singleGraphColorRGBAById(index),
|
|
@@ -6241,6 +6219,12 @@ function getMinMaxNumber(values) {
|
|
|
6241
6219
|
}
|
|
6242
6220
|
return [min, max];
|
|
6243
6221
|
}
|
|
6222
|
+
function makeArray(arrayOrSingleItem) {
|
|
6223
|
+
if (Array.isArray(arrayOrSingleItem)) {
|
|
6224
|
+
return arrayOrSingleItem;
|
|
6225
|
+
}
|
|
6226
|
+
return [arrayOrSingleItem];
|
|
6227
|
+
}
|
|
6244
6228
|
Chart.register(...registerables, LogitScale);
|
|
6245
6229
|
const PrevalenceOverTimeBubbleChart = ({
|
|
6246
6230
|
data,
|
|
@@ -6470,35 +6454,6 @@ const PrevalenceOverTimeTable = ({ data, granularity, pageSize }) => {
|
|
|
6470
6454
|
};
|
|
6471
6455
|
return /* @__PURE__ */ u$1(Table, { data: getData(data, granularity), columns: getColumns(data), pageSize });
|
|
6472
6456
|
};
|
|
6473
|
-
class DivisionOperator {
|
|
6474
|
-
constructor(numerator, denominator, keyField, valueField, resultField, numeratorField, denominatorField) {
|
|
6475
|
-
this.numerator = numerator;
|
|
6476
|
-
this.denominator = denominator;
|
|
6477
|
-
this.keyField = keyField;
|
|
6478
|
-
this.valueField = valueField;
|
|
6479
|
-
this.resultField = resultField;
|
|
6480
|
-
this.numeratorField = numeratorField;
|
|
6481
|
-
this.denominatorField = denominatorField;
|
|
6482
|
-
}
|
|
6483
|
-
async evaluate(lapis, signal) {
|
|
6484
|
-
const numeratorEvaluated = await this.numerator.evaluate(lapis, signal);
|
|
6485
|
-
const denominatorEvaluated = await this.denominator.evaluate(lapis, signal);
|
|
6486
|
-
const numeratorMap = /* @__PURE__ */ new Map();
|
|
6487
|
-
numeratorEvaluated.content.forEach((row) => {
|
|
6488
|
-
numeratorMap.set(row[this.keyField], row[this.valueField]);
|
|
6489
|
-
});
|
|
6490
|
-
const content = denominatorEvaluated.content.map((row) => {
|
|
6491
|
-
const numeratorValue = numeratorMap.get(row[this.keyField]) ?? 0;
|
|
6492
|
-
return {
|
|
6493
|
-
[this.keyField]: row[this.keyField],
|
|
6494
|
-
[this.numeratorField]: numeratorValue,
|
|
6495
|
-
[this.denominatorField]: row[this.valueField],
|
|
6496
|
-
[this.resultField]: numeratorValue / row[this.valueField]
|
|
6497
|
-
};
|
|
6498
|
-
});
|
|
6499
|
-
return { content };
|
|
6500
|
-
}
|
|
6501
|
-
}
|
|
6502
6457
|
class FetchAggregatedOperator {
|
|
6503
6458
|
constructor(filter, fields) {
|
|
6504
6459
|
this.filter = filter;
|
|
@@ -6631,36 +6586,7 @@ class SlidingOperator {
|
|
|
6631
6586
|
return { content };
|
|
6632
6587
|
}
|
|
6633
6588
|
}
|
|
6634
|
-
function
|
|
6635
|
-
const numeratorFilters = makeArray(numeratorFilter);
|
|
6636
|
-
const denominatorData = fetchAndPrepare(denominatorFilter, granularity, smoothingWindow, lapisDateField);
|
|
6637
|
-
const subQueries = numeratorFilters.map(async (namedLapisFilter) => {
|
|
6638
|
-
const { displayName, lapisFilter } = namedLapisFilter;
|
|
6639
|
-
const numeratorData = fetchAndPrepare(lapisFilter, granularity, smoothingWindow, lapisDateField);
|
|
6640
|
-
const divide = new DivisionOperator(
|
|
6641
|
-
numeratorData,
|
|
6642
|
-
denominatorData,
|
|
6643
|
-
"dateRange",
|
|
6644
|
-
"count",
|
|
6645
|
-
"prevalence",
|
|
6646
|
-
"count",
|
|
6647
|
-
"total"
|
|
6648
|
-
);
|
|
6649
|
-
const dataset = await divide.evaluate(lapis, signal);
|
|
6650
|
-
return {
|
|
6651
|
-
displayName,
|
|
6652
|
-
content: dataset.content
|
|
6653
|
-
};
|
|
6654
|
-
});
|
|
6655
|
-
return Promise.all(subQueries);
|
|
6656
|
-
}
|
|
6657
|
-
function makeArray(arrayOrSingleItem) {
|
|
6658
|
-
if (Array.isArray(arrayOrSingleItem)) {
|
|
6659
|
-
return arrayOrSingleItem;
|
|
6660
|
-
}
|
|
6661
|
-
return [arrayOrSingleItem];
|
|
6662
|
-
}
|
|
6663
|
-
function fetchAndPrepare(filter, granularity, smoothingWindow, lapisDateField) {
|
|
6589
|
+
function queryAggregatedDataOverTime(filter, granularity, smoothingWindow, lapisDateField) {
|
|
6664
6590
|
const fetchData = new FetchAggregatedOperator(filter, [lapisDateField]);
|
|
6665
6591
|
const dataWithFixedDateKey = new RenameFieldOperator(fetchData, lapisDateField, "date");
|
|
6666
6592
|
const mapData = new MapOperator(dataWithFixedDateKey, (d2) => mapDateToGranularityRange(d2, granularity));
|
|
@@ -6713,6 +6639,63 @@ function averageSmoothing(slidingWindow) {
|
|
|
6713
6639
|
const centerIndex = Math.floor(slidingWindow.length / 2);
|
|
6714
6640
|
return { dateRange: slidingWindow[centerIndex].dateRange, count: average };
|
|
6715
6641
|
}
|
|
6642
|
+
class DivisionOperator {
|
|
6643
|
+
constructor(numerator, denominator, keyField, valueField, resultField, numeratorField, denominatorField) {
|
|
6644
|
+
this.numerator = numerator;
|
|
6645
|
+
this.denominator = denominator;
|
|
6646
|
+
this.keyField = keyField;
|
|
6647
|
+
this.valueField = valueField;
|
|
6648
|
+
this.resultField = resultField;
|
|
6649
|
+
this.numeratorField = numeratorField;
|
|
6650
|
+
this.denominatorField = denominatorField;
|
|
6651
|
+
}
|
|
6652
|
+
async evaluate(lapis, signal) {
|
|
6653
|
+
const numeratorEvaluated = await this.numerator.evaluate(lapis, signal);
|
|
6654
|
+
const denominatorEvaluated = await this.denominator.evaluate(lapis, signal);
|
|
6655
|
+
const numeratorMap = /* @__PURE__ */ new Map();
|
|
6656
|
+
numeratorEvaluated.content.forEach((row) => {
|
|
6657
|
+
numeratorMap.set(row[this.keyField], row[this.valueField]);
|
|
6658
|
+
});
|
|
6659
|
+
const content = denominatorEvaluated.content.map((row) => {
|
|
6660
|
+
const numeratorValue = numeratorMap.get(row[this.keyField]) ?? 0;
|
|
6661
|
+
return {
|
|
6662
|
+
[this.keyField]: row[this.keyField],
|
|
6663
|
+
[this.numeratorField]: numeratorValue,
|
|
6664
|
+
[this.denominatorField]: row[this.valueField],
|
|
6665
|
+
[this.resultField]: numeratorValue / row[this.valueField]
|
|
6666
|
+
};
|
|
6667
|
+
});
|
|
6668
|
+
return { content };
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6671
|
+
function queryPrevalenceOverTime(numeratorFilter, denominatorFilter, granularity, smoothingWindow, lapis, lapisDateField, signal) {
|
|
6672
|
+
const numeratorFilters = makeArray(numeratorFilter);
|
|
6673
|
+
const denominatorData = queryAggregatedDataOverTime(
|
|
6674
|
+
denominatorFilter,
|
|
6675
|
+
granularity,
|
|
6676
|
+
smoothingWindow,
|
|
6677
|
+
lapisDateField
|
|
6678
|
+
);
|
|
6679
|
+
const subQueries = numeratorFilters.map(async (namedLapisFilter) => {
|
|
6680
|
+
const { displayName, lapisFilter } = namedLapisFilter;
|
|
6681
|
+
const numeratorData = queryAggregatedDataOverTime(lapisFilter, granularity, smoothingWindow, lapisDateField);
|
|
6682
|
+
const divide = new DivisionOperator(
|
|
6683
|
+
numeratorData,
|
|
6684
|
+
denominatorData,
|
|
6685
|
+
"dateRange",
|
|
6686
|
+
"count",
|
|
6687
|
+
"prevalence",
|
|
6688
|
+
"count",
|
|
6689
|
+
"total"
|
|
6690
|
+
);
|
|
6691
|
+
const dataset = await divide.evaluate(lapis, signal);
|
|
6692
|
+
return {
|
|
6693
|
+
displayName,
|
|
6694
|
+
content: dataset.content
|
|
6695
|
+
};
|
|
6696
|
+
});
|
|
6697
|
+
return Promise.all(subQueries);
|
|
6698
|
+
}
|
|
6716
6699
|
const Select = ({ items, selected, onChange, selectStyle }) => {
|
|
6717
6700
|
return /* @__PURE__ */ u$1("select", { class: `select select-bordered ${selectStyle}`, value: selected, onChange, children: items.map((item) => /* @__PURE__ */ u$1("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value)) });
|
|
6718
6701
|
};
|
|
@@ -6775,34 +6758,13 @@ const ScalingSelector = ({
|
|
|
6775
6758
|
);
|
|
6776
6759
|
};
|
|
6777
6760
|
const PrevalenceOverTime = ({
|
|
6778
|
-
numeratorFilter,
|
|
6779
|
-
denominatorFilter,
|
|
6780
|
-
granularity,
|
|
6781
|
-
smoothingWindow,
|
|
6782
|
-
views,
|
|
6783
|
-
confidenceIntervalMethods,
|
|
6784
6761
|
width,
|
|
6785
6762
|
height,
|
|
6786
6763
|
headline = "Prevalence over time",
|
|
6787
|
-
|
|
6788
|
-
pageSize,
|
|
6789
|
-
yAxisMaxConfig
|
|
6764
|
+
...innerProps
|
|
6790
6765
|
}) => {
|
|
6791
6766
|
const size2 = { height, width };
|
|
6792
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
6793
|
-
PrevalenceOverTimeInner,
|
|
6794
|
-
{
|
|
6795
|
-
numeratorFilter,
|
|
6796
|
-
denominatorFilter,
|
|
6797
|
-
granularity,
|
|
6798
|
-
smoothingWindow,
|
|
6799
|
-
views,
|
|
6800
|
-
confidenceIntervalMethods,
|
|
6801
|
-
lapisDateField,
|
|
6802
|
-
pageSize,
|
|
6803
|
-
yAxisMaxConfig
|
|
6804
|
-
}
|
|
6805
|
-
) }) }) });
|
|
6767
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...innerProps }) }) }) });
|
|
6806
6768
|
};
|
|
6807
6769
|
const PrevalenceOverTimeInner = ({
|
|
6808
6770
|
numeratorFilter,
|
|
@@ -6961,14 +6923,14 @@ const PrevalenceOverTimeInfo = () => {
|
|
|
6961
6923
|
] });
|
|
6962
6924
|
};
|
|
6963
6925
|
const maxInData = (data) => Math.max(...data.flatMap((variant) => variant.content.map((dataPoint) => dataPoint.prevalence)));
|
|
6964
|
-
var __defProp$
|
|
6965
|
-
var __getOwnPropDesc$
|
|
6966
|
-
var __decorateClass$
|
|
6967
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6926
|
+
var __defProp$7 = Object.defineProperty;
|
|
6927
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
6928
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
6929
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
6968
6930
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
6969
6931
|
if (decorator = decorators[i2])
|
|
6970
6932
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6971
|
-
if (kind && result) __defProp$
|
|
6933
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
6972
6934
|
return result;
|
|
6973
6935
|
};
|
|
6974
6936
|
let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -7011,46 +6973,46 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
7011
6973
|
);
|
|
7012
6974
|
}
|
|
7013
6975
|
};
|
|
7014
|
-
__decorateClass$
|
|
6976
|
+
__decorateClass$7([
|
|
7015
6977
|
n2({ type: Object })
|
|
7016
6978
|
], PrevalenceOverTimeComponent.prototype, "numeratorFilter", 2);
|
|
7017
|
-
__decorateClass$
|
|
6979
|
+
__decorateClass$7([
|
|
7018
6980
|
n2({ type: Object })
|
|
7019
6981
|
], PrevalenceOverTimeComponent.prototype, "denominatorFilter", 2);
|
|
7020
|
-
__decorateClass$
|
|
6982
|
+
__decorateClass$7([
|
|
7021
6983
|
n2({ type: String })
|
|
7022
6984
|
], PrevalenceOverTimeComponent.prototype, "granularity", 2);
|
|
7023
|
-
__decorateClass$
|
|
6985
|
+
__decorateClass$7([
|
|
7024
6986
|
n2({ type: Number })
|
|
7025
6987
|
], PrevalenceOverTimeComponent.prototype, "smoothingWindow", 2);
|
|
7026
|
-
__decorateClass$
|
|
6988
|
+
__decorateClass$7([
|
|
7027
6989
|
n2({ type: Array })
|
|
7028
6990
|
], PrevalenceOverTimeComponent.prototype, "views", 2);
|
|
7029
|
-
__decorateClass$
|
|
6991
|
+
__decorateClass$7([
|
|
7030
6992
|
n2({ type: Array })
|
|
7031
6993
|
], PrevalenceOverTimeComponent.prototype, "confidenceIntervalMethods", 2);
|
|
7032
|
-
__decorateClass$
|
|
6994
|
+
__decorateClass$7([
|
|
7033
6995
|
n2({ type: String })
|
|
7034
6996
|
], PrevalenceOverTimeComponent.prototype, "headline", 2);
|
|
7035
|
-
__decorateClass$
|
|
6997
|
+
__decorateClass$7([
|
|
7036
6998
|
n2({ type: String })
|
|
7037
6999
|
], PrevalenceOverTimeComponent.prototype, "width", 2);
|
|
7038
|
-
__decorateClass$
|
|
7000
|
+
__decorateClass$7([
|
|
7039
7001
|
n2({ type: String })
|
|
7040
7002
|
], PrevalenceOverTimeComponent.prototype, "height", 2);
|
|
7041
|
-
__decorateClass$
|
|
7003
|
+
__decorateClass$7([
|
|
7042
7004
|
n2({ type: String })
|
|
7043
7005
|
], PrevalenceOverTimeComponent.prototype, "lapisDateField", 2);
|
|
7044
|
-
__decorateClass$
|
|
7006
|
+
__decorateClass$7([
|
|
7045
7007
|
n2({ type: Object })
|
|
7046
7008
|
], PrevalenceOverTimeComponent.prototype, "pageSize", 2);
|
|
7047
|
-
__decorateClass$
|
|
7009
|
+
__decorateClass$7([
|
|
7048
7010
|
n2({ type: String })
|
|
7049
7011
|
], PrevalenceOverTimeComponent.prototype, "yAxisMaxLinear", 2);
|
|
7050
|
-
__decorateClass$
|
|
7012
|
+
__decorateClass$7([
|
|
7051
7013
|
n2({ type: String })
|
|
7052
7014
|
], PrevalenceOverTimeComponent.prototype, "yAxisMaxLogarithmic", 2);
|
|
7053
|
-
PrevalenceOverTimeComponent = __decorateClass$
|
|
7015
|
+
PrevalenceOverTimeComponent = __decorateClass$7([
|
|
7054
7016
|
t$2("gs-prevalence-over-time")
|
|
7055
7017
|
], PrevalenceOverTimeComponent);
|
|
7056
7018
|
Chart.register(...registerables, LogitScale);
|
|
@@ -7263,28 +7225,13 @@ function toYearMonthDay(d2) {
|
|
|
7263
7225
|
};
|
|
7264
7226
|
}
|
|
7265
7227
|
const RelativeGrowthAdvantage = ({
|
|
7266
|
-
views,
|
|
7267
7228
|
width,
|
|
7268
7229
|
height,
|
|
7269
|
-
numeratorFilter,
|
|
7270
|
-
denominatorFilter,
|
|
7271
|
-
generationTime,
|
|
7272
7230
|
headline = "Relative growth advantage",
|
|
7273
|
-
|
|
7274
|
-
yAxisMaxConfig
|
|
7231
|
+
...innerProps
|
|
7275
7232
|
}) => {
|
|
7276
7233
|
const size2 = { height, width };
|
|
7277
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
7278
|
-
RelativeGrowthAdvantageInner,
|
|
7279
|
-
{
|
|
7280
|
-
views,
|
|
7281
|
-
numeratorFilter,
|
|
7282
|
-
denominatorFilter,
|
|
7283
|
-
generationTime,
|
|
7284
|
-
lapisDateField,
|
|
7285
|
-
yAxisMaxConfig
|
|
7286
|
-
}
|
|
7287
|
-
) }) }) });
|
|
7234
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...innerProps }) }) }) });
|
|
7288
7235
|
};
|
|
7289
7236
|
const RelativeGrowthAdvantageInner = ({
|
|
7290
7237
|
numeratorFilter,
|
|
@@ -7391,14 +7338,14 @@ const RelativeGrowthAdvantageInfo = ({ generationTime }) => {
|
|
|
7391
7338
|
] })
|
|
7392
7339
|
] });
|
|
7393
7340
|
};
|
|
7394
|
-
var __defProp$
|
|
7395
|
-
var __getOwnPropDesc$
|
|
7396
|
-
var __decorateClass$
|
|
7397
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7341
|
+
var __defProp$6 = Object.defineProperty;
|
|
7342
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
7343
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
7344
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
7398
7345
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7399
7346
|
if (decorator = decorators[i2])
|
|
7400
7347
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7401
|
-
if (kind && result) __defProp$
|
|
7348
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
7402
7349
|
return result;
|
|
7403
7350
|
};
|
|
7404
7351
|
let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
|
|
@@ -7435,37 +7382,37 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
|
|
|
7435
7382
|
);
|
|
7436
7383
|
}
|
|
7437
7384
|
};
|
|
7438
|
-
__decorateClass$
|
|
7385
|
+
__decorateClass$6([
|
|
7439
7386
|
n2({ type: Object })
|
|
7440
7387
|
], RelativeGrowthAdvantageComponent.prototype, "numeratorFilter", 2);
|
|
7441
|
-
__decorateClass$
|
|
7388
|
+
__decorateClass$6([
|
|
7442
7389
|
n2({ type: Object })
|
|
7443
7390
|
], RelativeGrowthAdvantageComponent.prototype, "denominatorFilter", 2);
|
|
7444
|
-
__decorateClass$
|
|
7391
|
+
__decorateClass$6([
|
|
7445
7392
|
n2({ type: Number })
|
|
7446
7393
|
], RelativeGrowthAdvantageComponent.prototype, "generationTime", 2);
|
|
7447
|
-
__decorateClass$
|
|
7394
|
+
__decorateClass$6([
|
|
7448
7395
|
n2({ type: Array })
|
|
7449
7396
|
], RelativeGrowthAdvantageComponent.prototype, "views", 2);
|
|
7450
|
-
__decorateClass$
|
|
7397
|
+
__decorateClass$6([
|
|
7451
7398
|
n2({ type: String })
|
|
7452
7399
|
], RelativeGrowthAdvantageComponent.prototype, "headline", 2);
|
|
7453
|
-
__decorateClass$
|
|
7400
|
+
__decorateClass$6([
|
|
7454
7401
|
n2({ type: String })
|
|
7455
7402
|
], RelativeGrowthAdvantageComponent.prototype, "width", 2);
|
|
7456
|
-
__decorateClass$
|
|
7403
|
+
__decorateClass$6([
|
|
7457
7404
|
n2({ type: String })
|
|
7458
7405
|
], RelativeGrowthAdvantageComponent.prototype, "height", 2);
|
|
7459
|
-
__decorateClass$
|
|
7406
|
+
__decorateClass$6([
|
|
7460
7407
|
n2({ type: String })
|
|
7461
7408
|
], RelativeGrowthAdvantageComponent.prototype, "lapisDateField", 2);
|
|
7462
|
-
__decorateClass$
|
|
7409
|
+
__decorateClass$6([
|
|
7463
7410
|
n2({ type: String })
|
|
7464
7411
|
], RelativeGrowthAdvantageComponent.prototype, "yAxisMaxLinear", 2);
|
|
7465
|
-
__decorateClass$
|
|
7412
|
+
__decorateClass$6([
|
|
7466
7413
|
n2({ type: String })
|
|
7467
7414
|
], RelativeGrowthAdvantageComponent.prototype, "yAxisMaxLogarithmic", 2);
|
|
7468
|
-
RelativeGrowthAdvantageComponent = __decorateClass$
|
|
7415
|
+
RelativeGrowthAdvantageComponent = __decorateClass$6([
|
|
7469
7416
|
t$2("gs-relative-growth-advantage")
|
|
7470
7417
|
], RelativeGrowthAdvantageComponent);
|
|
7471
7418
|
const compareAscending = (a2, b3) => {
|
|
@@ -7517,28 +7464,13 @@ const AggregateTable = ({ data, fields, pageSize }) => {
|
|
|
7517
7464
|
return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
|
|
7518
7465
|
};
|
|
7519
7466
|
const Aggregate = ({
|
|
7520
|
-
views,
|
|
7521
7467
|
width,
|
|
7522
7468
|
height,
|
|
7523
7469
|
headline = "Mutations",
|
|
7524
|
-
|
|
7525
|
-
fields,
|
|
7526
|
-
pageSize,
|
|
7527
|
-
initialSortField,
|
|
7528
|
-
initialSortDirection
|
|
7470
|
+
...innerProps
|
|
7529
7471
|
}) => {
|
|
7530
7472
|
const size2 = { height, width };
|
|
7531
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
7532
|
-
AggregateInner,
|
|
7533
|
-
{
|
|
7534
|
-
fields,
|
|
7535
|
-
filter,
|
|
7536
|
-
views,
|
|
7537
|
-
initialSortField,
|
|
7538
|
-
initialSortDirection,
|
|
7539
|
-
pageSize
|
|
7540
|
-
}
|
|
7541
|
-
) }) }) });
|
|
7473
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregateInner, { ...innerProps }) }) }) });
|
|
7542
7474
|
};
|
|
7543
7475
|
const AggregateInner = ({
|
|
7544
7476
|
fields,
|
|
@@ -7582,14 +7514,14 @@ const Toolbar = ({ data }) => {
|
|
|
7582
7514
|
/* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for aggregate" })
|
|
7583
7515
|
] });
|
|
7584
7516
|
};
|
|
7585
|
-
var __defProp$
|
|
7586
|
-
var __getOwnPropDesc$
|
|
7587
|
-
var __decorateClass$
|
|
7588
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7517
|
+
var __defProp$5 = Object.defineProperty;
|
|
7518
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
7519
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
7520
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
7589
7521
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7590
7522
|
if (decorator = decorators[i2])
|
|
7591
7523
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7592
|
-
if (kind && result) __defProp$
|
|
7524
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
7593
7525
|
return result;
|
|
7594
7526
|
};
|
|
7595
7527
|
let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -7622,36 +7554,255 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
7622
7554
|
);
|
|
7623
7555
|
}
|
|
7624
7556
|
};
|
|
7625
|
-
__decorateClass$
|
|
7557
|
+
__decorateClass$5([
|
|
7626
7558
|
n2({ type: Array })
|
|
7627
7559
|
], AggregateComponent.prototype, "fields", 2);
|
|
7628
|
-
__decorateClass$
|
|
7560
|
+
__decorateClass$5([
|
|
7629
7561
|
n2({ type: Array })
|
|
7630
7562
|
], AggregateComponent.prototype, "views", 2);
|
|
7631
|
-
__decorateClass$
|
|
7563
|
+
__decorateClass$5([
|
|
7632
7564
|
n2({ type: Object })
|
|
7633
7565
|
], AggregateComponent.prototype, "filter", 2);
|
|
7634
|
-
__decorateClass$
|
|
7566
|
+
__decorateClass$5([
|
|
7635
7567
|
n2({ type: String })
|
|
7636
7568
|
], AggregateComponent.prototype, "width", 2);
|
|
7637
|
-
__decorateClass$
|
|
7569
|
+
__decorateClass$5([
|
|
7638
7570
|
n2({ type: String })
|
|
7639
7571
|
], AggregateComponent.prototype, "height", 2);
|
|
7640
|
-
__decorateClass$
|
|
7572
|
+
__decorateClass$5([
|
|
7641
7573
|
n2({ type: String })
|
|
7642
7574
|
], AggregateComponent.prototype, "headline", 2);
|
|
7643
|
-
__decorateClass$
|
|
7575
|
+
__decorateClass$5([
|
|
7644
7576
|
n2({ type: String })
|
|
7645
7577
|
], AggregateComponent.prototype, "initialSortField", 2);
|
|
7646
|
-
__decorateClass$
|
|
7578
|
+
__decorateClass$5([
|
|
7647
7579
|
n2({ type: String })
|
|
7648
7580
|
], AggregateComponent.prototype, "initialSortDirection", 2);
|
|
7649
|
-
__decorateClass$
|
|
7581
|
+
__decorateClass$5([
|
|
7650
7582
|
n2({ type: Object })
|
|
7651
7583
|
], AggregateComponent.prototype, "pageSize", 2);
|
|
7652
|
-
AggregateComponent = __decorateClass$
|
|
7584
|
+
AggregateComponent = __decorateClass$5([
|
|
7653
7585
|
t$2("gs-aggregate")
|
|
7654
7586
|
], AggregateComponent);
|
|
7587
|
+
const getNumberOfSequencesOverTimeTableData = (data, dateRangeKey) => {
|
|
7588
|
+
const datasetsWithCountByDate = data.map(({ displayName, content }) => ({
|
|
7589
|
+
displayName,
|
|
7590
|
+
content: new Map(content.map((datum) => {
|
|
7591
|
+
var _a;
|
|
7592
|
+
return [(_a = datum.dateRange) == null ? void 0 : _a.toString(), datum];
|
|
7593
|
+
}))
|
|
7594
|
+
}));
|
|
7595
|
+
const allDateRangesThatOccurInData = datasetsWithCountByDate.map(({ content }) => [...content.values()].map((datum) => datum.dateRange)).reduce((acc, keys) => /* @__PURE__ */ new Set([...acc, ...keys]), /* @__PURE__ */ new Set());
|
|
7596
|
+
const minMax = getMinMaxTemporal(allDateRangesThatOccurInData);
|
|
7597
|
+
if (minMax === null) {
|
|
7598
|
+
return [];
|
|
7599
|
+
}
|
|
7600
|
+
const allDateRanges = generateAllInRange(...minMax);
|
|
7601
|
+
if (allDateRangesThatOccurInData.has(null)) {
|
|
7602
|
+
allDateRanges.unshift(null);
|
|
7603
|
+
}
|
|
7604
|
+
return allDateRanges.map((dateRange) => {
|
|
7605
|
+
return datasetsWithCountByDate.reduce(
|
|
7606
|
+
(acc, dataset) => {
|
|
7607
|
+
var _a;
|
|
7608
|
+
return {
|
|
7609
|
+
...acc,
|
|
7610
|
+
[dataset.displayName]: ((_a = dataset.content.get(dateRange == null ? void 0 : dateRange.toString())) == null ? void 0 : _a.count) ?? 0
|
|
7611
|
+
};
|
|
7612
|
+
},
|
|
7613
|
+
{ [dateRangeKey]: (dateRange == null ? void 0 : dateRange.toString()) ?? "Unknown" }
|
|
7614
|
+
);
|
|
7615
|
+
});
|
|
7616
|
+
};
|
|
7617
|
+
Chart.register(...registerables);
|
|
7618
|
+
const NumberSequencesOverTimeBarChart = ({ data }) => {
|
|
7619
|
+
const config = T(
|
|
7620
|
+
() => ({
|
|
7621
|
+
type: "bar",
|
|
7622
|
+
data: {
|
|
7623
|
+
datasets: getDatasets(data)
|
|
7624
|
+
},
|
|
7625
|
+
options: {
|
|
7626
|
+
maintainAspectRatio: false,
|
|
7627
|
+
animation: false,
|
|
7628
|
+
plugins: {
|
|
7629
|
+
legend: {
|
|
7630
|
+
display: false
|
|
7631
|
+
},
|
|
7632
|
+
tooltip: {
|
|
7633
|
+
mode: "index",
|
|
7634
|
+
intersect: false
|
|
7635
|
+
}
|
|
7636
|
+
}
|
|
7637
|
+
}
|
|
7638
|
+
}),
|
|
7639
|
+
[data]
|
|
7640
|
+
);
|
|
7641
|
+
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
7642
|
+
};
|
|
7643
|
+
const getDatasets = (data) => {
|
|
7644
|
+
const tableData = getNumberOfSequencesOverTimeTableData(data, "date");
|
|
7645
|
+
return data.map(
|
|
7646
|
+
({ displayName }, index) => ({
|
|
7647
|
+
borderWidth: 1,
|
|
7648
|
+
label: displayName,
|
|
7649
|
+
backgroundColor: singleGraphColorRGBAById(index, 0.3),
|
|
7650
|
+
borderColor: singleGraphColorRGBAById(index),
|
|
7651
|
+
data: tableData.map((row) => ({
|
|
7652
|
+
x: row.date,
|
|
7653
|
+
y: row[displayName]
|
|
7654
|
+
}))
|
|
7655
|
+
})
|
|
7656
|
+
);
|
|
7657
|
+
};
|
|
7658
|
+
const NumberSequencesOverTimeTable = ({ data, granularity, pageSize }) => {
|
|
7659
|
+
const columns = [
|
|
7660
|
+
{
|
|
7661
|
+
name: granularity,
|
|
7662
|
+
sort: true
|
|
7663
|
+
},
|
|
7664
|
+
...data.map((dataset) => ({
|
|
7665
|
+
name: dataset.displayName,
|
|
7666
|
+
sort: true
|
|
7667
|
+
}))
|
|
7668
|
+
];
|
|
7669
|
+
const flatTableData = T(() => {
|
|
7670
|
+
const tableData = getNumberOfSequencesOverTimeTableData(data, granularity);
|
|
7671
|
+
return Object.values(tableData).map((row) => Object.values(row));
|
|
7672
|
+
}, [data, granularity]);
|
|
7673
|
+
return /* @__PURE__ */ u$1(Table, { data: flatTableData, columns, pageSize });
|
|
7674
|
+
};
|
|
7675
|
+
async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField, granularity, smoothingWindow) {
|
|
7676
|
+
const lapisFilters = makeArray(lapisFilter);
|
|
7677
|
+
const queries = lapisFilters.map(async ({ displayName, lapisFilter: lapisFilter2 }) => {
|
|
7678
|
+
const { content } = await queryAggregatedDataOverTime(
|
|
7679
|
+
lapisFilter2,
|
|
7680
|
+
granularity,
|
|
7681
|
+
smoothingWindow,
|
|
7682
|
+
lapisDateField
|
|
7683
|
+
).evaluate(lapis);
|
|
7684
|
+
return {
|
|
7685
|
+
displayName,
|
|
7686
|
+
content: content.sort(sortNullToBeginningThenByDate)
|
|
7687
|
+
};
|
|
7688
|
+
});
|
|
7689
|
+
return Promise.all(queries);
|
|
7690
|
+
}
|
|
7691
|
+
const NumberSequencesOverTime = ({ width, height, headline, ...innerProps }) => {
|
|
7692
|
+
const size2 = { height, width };
|
|
7693
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...innerProps }) }) }) });
|
|
7694
|
+
};
|
|
7695
|
+
const NumberSequencesOverTimeInner = ({
|
|
7696
|
+
lapisFilter,
|
|
7697
|
+
granularity,
|
|
7698
|
+
smoothingWindow,
|
|
7699
|
+
lapisDateField,
|
|
7700
|
+
views,
|
|
7701
|
+
pageSize
|
|
7702
|
+
}) => {
|
|
7703
|
+
const lapis = x(LapisUrlContext);
|
|
7704
|
+
const { data, error, isLoading } = useQuery(
|
|
7705
|
+
() => queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField, granularity, smoothingWindow)
|
|
7706
|
+
);
|
|
7707
|
+
if (isLoading) {
|
|
7708
|
+
return /* @__PURE__ */ u$1(LoadingDisplay, {});
|
|
7709
|
+
}
|
|
7710
|
+
if (error !== null) {
|
|
7711
|
+
return /* @__PURE__ */ u$1(ErrorDisplay, { error });
|
|
7712
|
+
}
|
|
7713
|
+
if (data === null) {
|
|
7714
|
+
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
7715
|
+
}
|
|
7716
|
+
return /* @__PURE__ */ u$1(NumberSequencesOverTimeTabs, { views, data, granularity, pageSize });
|
|
7717
|
+
};
|
|
7718
|
+
const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) => {
|
|
7719
|
+
const getTab = (view) => {
|
|
7720
|
+
switch (view) {
|
|
7721
|
+
case "bar":
|
|
7722
|
+
return { title: "Bar", content: /* @__PURE__ */ u$1(NumberSequencesOverTimeBarChart, { data }) };
|
|
7723
|
+
case "line":
|
|
7724
|
+
return { title: "Line", content: /* @__PURE__ */ u$1("div", { children: "not implemented, TODO #317" }) };
|
|
7725
|
+
case "table":
|
|
7726
|
+
return {
|
|
7727
|
+
title: "Table",
|
|
7728
|
+
content: /* @__PURE__ */ u$1(NumberSequencesOverTimeTable, { data, granularity, pageSize })
|
|
7729
|
+
};
|
|
7730
|
+
default:
|
|
7731
|
+
throw new Error(`Unknown view: ${view}`);
|
|
7732
|
+
}
|
|
7733
|
+
};
|
|
7734
|
+
return /* @__PURE__ */ u$1(Tabs, { tabs: views.map((view) => getTab(view)) });
|
|
7735
|
+
};
|
|
7736
|
+
var __defProp$4 = Object.defineProperty;
|
|
7737
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
7738
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
7739
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
7740
|
+
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7741
|
+
if (decorator = decorators[i2])
|
|
7742
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7743
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
7744
|
+
return result;
|
|
7745
|
+
};
|
|
7746
|
+
let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
7747
|
+
constructor() {
|
|
7748
|
+
super(...arguments);
|
|
7749
|
+
this.lapisFilter = { displayName: "", lapisFilter: {} };
|
|
7750
|
+
this.lapisDateField = "date";
|
|
7751
|
+
this.views = ["bar", "line", "table"];
|
|
7752
|
+
this.headline = "Number of sequences of time";
|
|
7753
|
+
this.width = "100%";
|
|
7754
|
+
this.height = "700px";
|
|
7755
|
+
this.granularity = "day";
|
|
7756
|
+
this.smoothingWindow = 0;
|
|
7757
|
+
this.pageSize = false;
|
|
7758
|
+
}
|
|
7759
|
+
render() {
|
|
7760
|
+
return /* @__PURE__ */ u$1(
|
|
7761
|
+
NumberSequencesOverTime,
|
|
7762
|
+
{
|
|
7763
|
+
lapisFilter: this.lapisFilter,
|
|
7764
|
+
lapisDateField: this.lapisDateField,
|
|
7765
|
+
views: this.views,
|
|
7766
|
+
headline: this.headline,
|
|
7767
|
+
width: this.width,
|
|
7768
|
+
height: this.height,
|
|
7769
|
+
granularity: this.granularity,
|
|
7770
|
+
smoothingWindow: this.smoothingWindow,
|
|
7771
|
+
pageSize: this.pageSize
|
|
7772
|
+
}
|
|
7773
|
+
);
|
|
7774
|
+
}
|
|
7775
|
+
};
|
|
7776
|
+
__decorateClass$4([
|
|
7777
|
+
n2({ type: Object })
|
|
7778
|
+
], NumberSequencesOverTimeComponent.prototype, "lapisFilter", 2);
|
|
7779
|
+
__decorateClass$4([
|
|
7780
|
+
n2({ type: String })
|
|
7781
|
+
], NumberSequencesOverTimeComponent.prototype, "lapisDateField", 2);
|
|
7782
|
+
__decorateClass$4([
|
|
7783
|
+
n2({ type: Array })
|
|
7784
|
+
], NumberSequencesOverTimeComponent.prototype, "views", 2);
|
|
7785
|
+
__decorateClass$4([
|
|
7786
|
+
n2({ type: String })
|
|
7787
|
+
], NumberSequencesOverTimeComponent.prototype, "headline", 2);
|
|
7788
|
+
__decorateClass$4([
|
|
7789
|
+
n2({ type: String })
|
|
7790
|
+
], NumberSequencesOverTimeComponent.prototype, "width", 2);
|
|
7791
|
+
__decorateClass$4([
|
|
7792
|
+
n2({ type: String })
|
|
7793
|
+
], NumberSequencesOverTimeComponent.prototype, "height", 2);
|
|
7794
|
+
__decorateClass$4([
|
|
7795
|
+
n2({ type: String })
|
|
7796
|
+
], NumberSequencesOverTimeComponent.prototype, "granularity", 2);
|
|
7797
|
+
__decorateClass$4([
|
|
7798
|
+
n2({ type: Number })
|
|
7799
|
+
], NumberSequencesOverTimeComponent.prototype, "smoothingWindow", 2);
|
|
7800
|
+
__decorateClass$4([
|
|
7801
|
+
n2({ type: Object })
|
|
7802
|
+
], NumberSequencesOverTimeComponent.prototype, "pageSize", 2);
|
|
7803
|
+
NumberSequencesOverTimeComponent = __decorateClass$4([
|
|
7804
|
+
t$2("gs-number-sequences-over-time")
|
|
7805
|
+
], NumberSequencesOverTimeComponent);
|
|
7655
7806
|
const PRESET_VALUE_CUSTOM = "custom";
|
|
7656
7807
|
const PRESET_VALUE_ALL_TIMES = "allTimes";
|
|
7657
7808
|
const PRESET_VALUE_LAST_2_WEEKS = "last2Weeks";
|
|
@@ -7765,26 +7916,11 @@ const toYYYYMMDD = (date) => {
|
|
|
7765
7916
|
return date.toLocaleDateString("en-CA", options2);
|
|
7766
7917
|
};
|
|
7767
7918
|
const DateRangeSelector = ({
|
|
7768
|
-
customSelectOptions,
|
|
7769
|
-
earliestDate = "1900-01-01",
|
|
7770
|
-
initialValue,
|
|
7771
7919
|
width,
|
|
7772
|
-
|
|
7773
|
-
initialDateFrom,
|
|
7774
|
-
initialDateTo
|
|
7920
|
+
...innerProps
|
|
7775
7921
|
}) => {
|
|
7776
7922
|
const size2 = { width, height: "3rem" };
|
|
7777
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1("div", { style: { width }, children: /* @__PURE__ */ u$1(
|
|
7778
|
-
DateRangeSelectorInner,
|
|
7779
|
-
{
|
|
7780
|
-
customSelectOptions,
|
|
7781
|
-
earliestDate,
|
|
7782
|
-
initialValue,
|
|
7783
|
-
dateColumn,
|
|
7784
|
-
initialDateFrom,
|
|
7785
|
-
initialDateTo
|
|
7786
|
-
}
|
|
7787
|
-
) }) });
|
|
7923
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1("div", { style: { width }, children: /* @__PURE__ */ u$1(DateRangeSelectorInner, { ...innerProps }) }) });
|
|
7788
7924
|
};
|
|
7789
7925
|
const DateRangeSelectorInner = ({
|
|
7790
7926
|
customSelectOptions,
|
|
@@ -8030,14 +8166,9 @@ function compareLocationEntries(fields) {
|
|
|
8030
8166
|
return 0;
|
|
8031
8167
|
};
|
|
8032
8168
|
}
|
|
8033
|
-
const LocationFilter = ({
|
|
8034
|
-
width,
|
|
8035
|
-
initialValue,
|
|
8036
|
-
fields,
|
|
8037
|
-
placeholderText
|
|
8038
|
-
}) => {
|
|
8169
|
+
const LocationFilter = ({ width, ...innerProps }) => {
|
|
8039
8170
|
const size2 = { width, height: "3rem" };
|
|
8040
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LocationFilterInner, {
|
|
8171
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LocationFilterInner, { ...innerProps }) }) });
|
|
8041
8172
|
};
|
|
8042
8173
|
const LocationFilterInner = ({ initialValue, fields, placeholderText }) => {
|
|
8043
8174
|
const lapis = x(LapisUrlContext);
|
|
@@ -8155,9 +8286,9 @@ async function fetchAutocompleteList(lapis, field, signal) {
|
|
|
8155
8286
|
const data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
|
|
8156
8287
|
return data.map((item) => item[field]);
|
|
8157
8288
|
}
|
|
8158
|
-
const TextInput = ({ width,
|
|
8289
|
+
const TextInput = ({ width, ...innerProps }) => {
|
|
8159
8290
|
const size2 = { width, height: "3rem" };
|
|
8160
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(TextInputInner, {
|
|
8291
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(TextInputInner, { ...innerProps }) }) });
|
|
8161
8292
|
};
|
|
8162
8293
|
const TextInputInner = ({
|
|
8163
8294
|
lapisField,
|
|
@@ -8266,9 +8397,221 @@ const ReferenceGenomesAwaiter = ({ children }) => {
|
|
|
8266
8397
|
function isNotInitialized(referenceGenome) {
|
|
8267
8398
|
return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
|
|
8268
8399
|
}
|
|
8400
|
+
const MutationFilterInfo = () => {
|
|
8401
|
+
const referenceGenome = x(ReferenceGenomeContext);
|
|
8402
|
+
const firstGene = referenceGenome.genes[0].name;
|
|
8403
|
+
return /* @__PURE__ */ u$1(Info, { height: "80vh", children: [
|
|
8404
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: " Mutation Filter" }),
|
|
8405
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "This component allows you to filter for mutations at specific positions." }),
|
|
8406
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: " Nucleotide Mutations and Insertions" }),
|
|
8407
|
+
isSingleSegmented(referenceGenome) ? /* @__PURE__ */ u$1(SingleSegmentedNucleotideMutationsInfo, {}) : /* @__PURE__ */ u$1(MultiSegmentedNucleotideMutationsInfo, {}),
|
|
8408
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Amino Acid Mutations and Insertions" }),
|
|
8409
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8410
|
+
"An amino acid mutation has the format ",
|
|
8411
|
+
/* @__PURE__ */ u$1("b", { children: "<gene>:<position><base>" }),
|
|
8412
|
+
" or",
|
|
8413
|
+
/* @__PURE__ */ u$1("b", { children: "<gene>:<base_ref><position><base>" }),
|
|
8414
|
+
". A ",
|
|
8415
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
8416
|
+
" can be one of the 20 amino acid codes. It can also be ",
|
|
8417
|
+
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
8418
|
+
" for deletion and ",
|
|
8419
|
+
/* @__PURE__ */ u$1("b", { children: "X" }),
|
|
8420
|
+
" for unknown. Example:",
|
|
8421
|
+
" ",
|
|
8422
|
+
/* @__PURE__ */ u$1("b", { children: "E:57Q" }),
|
|
8423
|
+
"."
|
|
8424
|
+
] }),
|
|
8425
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8426
|
+
"Insertions can be searched for in the same manner, they just need to have ",
|
|
8427
|
+
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
8428
|
+
" appended to the start of the mutation. Example: ",
|
|
8429
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8430
|
+
"ins_",
|
|
8431
|
+
firstGene,
|
|
8432
|
+
":31:N"
|
|
8433
|
+
] }),
|
|
8434
|
+
" would filter for sequences with an insertion of N between positions 31 and 32 in the gene ",
|
|
8435
|
+
firstGene,
|
|
8436
|
+
"."
|
|
8437
|
+
] }),
|
|
8438
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8439
|
+
"This organism has the following genes: ",
|
|
8440
|
+
referenceGenome.genes.map((gene) => gene.name).join(", "),
|
|
8441
|
+
"."
|
|
8442
|
+
] }),
|
|
8443
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Insertion Wildcards" }),
|
|
8444
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8445
|
+
"This component supports insertion queries that contain wildcards ",
|
|
8446
|
+
/* @__PURE__ */ u$1("b", { children: "?" }),
|
|
8447
|
+
". For example",
|
|
8448
|
+
" ",
|
|
8449
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8450
|
+
"ins_",
|
|
8451
|
+
firstGene,
|
|
8452
|
+
":214:?EP?"
|
|
8453
|
+
] }),
|
|
8454
|
+
" will match all cases where segment ",
|
|
8455
|
+
/* @__PURE__ */ u$1("b", { children: firstGene }),
|
|
8456
|
+
" has an insertion of ",
|
|
8457
|
+
/* @__PURE__ */ u$1("b", { children: "EP" }),
|
|
8458
|
+
" between the positions ",
|
|
8459
|
+
/* @__PURE__ */ u$1("b", { children: "214" }),
|
|
8460
|
+
" and ",
|
|
8461
|
+
/* @__PURE__ */ u$1("b", { children: "215" }),
|
|
8462
|
+
" but also an insertion of other amino acids which include the ",
|
|
8463
|
+
/* @__PURE__ */ u$1("b", { children: "EP" }),
|
|
8464
|
+
", e.g. the insertion ",
|
|
8465
|
+
/* @__PURE__ */ u$1("b", { children: "EPE" }),
|
|
8466
|
+
" will be matched."
|
|
8467
|
+
] }),
|
|
8468
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8469
|
+
"You can also use wildcards to match any insertion at a given position. For example",
|
|
8470
|
+
" ",
|
|
8471
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8472
|
+
"ins_",
|
|
8473
|
+
firstGene,
|
|
8474
|
+
":214:?"
|
|
8475
|
+
] }),
|
|
8476
|
+
" match any (but at least one) insertion between the positions 214 and 215."
|
|
8477
|
+
] }),
|
|
8478
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Multiple Mutations" }),
|
|
8479
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "Multiple mutation filters can be provided by adding one mutation after the other." }),
|
|
8480
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Any Mutation" }),
|
|
8481
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8482
|
+
"To filter for any mutation at a given position you can omit the ",
|
|
8483
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
8484
|
+
". Example:",
|
|
8485
|
+
" ",
|
|
8486
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8487
|
+
firstGene,
|
|
8488
|
+
":20"
|
|
8489
|
+
] }),
|
|
8490
|
+
"."
|
|
8491
|
+
] }),
|
|
8492
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "No Mutation" }),
|
|
8493
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8494
|
+
"You can write a ",
|
|
8495
|
+
/* @__PURE__ */ u$1("b", { children: "." }),
|
|
8496
|
+
" for the ",
|
|
8497
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
8498
|
+
" to filter for sequences for which it is confirmed that no mutation occurred, i.e. has the same base as the reference genome at the specified position."
|
|
8499
|
+
] })
|
|
8500
|
+
] });
|
|
8501
|
+
};
|
|
8502
|
+
const SingleSegmentedNucleotideMutationsInfo = () => {
|
|
8503
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
8504
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8505
|
+
"This organism is single-segmented. Thus, nucleotide mutations have the format",
|
|
8506
|
+
" ",
|
|
8507
|
+
/* @__PURE__ */ u$1("b", { children: "<position><base>" }),
|
|
8508
|
+
" or ",
|
|
8509
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref><position><base>" }),
|
|
8510
|
+
". The",
|
|
8511
|
+
" ",
|
|
8512
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
8513
|
+
" is the reference base at the position. It is optional. A ",
|
|
8514
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
8515
|
+
" can be one of the four nucleotides ",
|
|
8516
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
8517
|
+
", ",
|
|
8518
|
+
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
8519
|
+
", ",
|
|
8520
|
+
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
8521
|
+
", and ",
|
|
8522
|
+
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
8523
|
+
". It can also be ",
|
|
8524
|
+
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
8525
|
+
" for deletion and ",
|
|
8526
|
+
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
8527
|
+
" for unknown. For example if the reference sequence is ",
|
|
8528
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
8529
|
+
" at position",
|
|
8530
|
+
" ",
|
|
8531
|
+
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
8532
|
+
" both: ",
|
|
8533
|
+
/* @__PURE__ */ u$1("b", { children: "23T" }),
|
|
8534
|
+
" and ",
|
|
8535
|
+
/* @__PURE__ */ u$1("b", { children: "A23T" }),
|
|
8536
|
+
" will yield the same results."
|
|
8537
|
+
] }),
|
|
8538
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8539
|
+
"Insertions can be searched for in the same manner, they just need to have ",
|
|
8540
|
+
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
8541
|
+
" appended to the start of the mutation. Example: ",
|
|
8542
|
+
/* @__PURE__ */ u$1("b", { children: "ins_1046:A" }),
|
|
8543
|
+
" would filter for sequences with an insertion of A between the positions 1046 and 1047 in the nucleotide sequence."
|
|
8544
|
+
] })
|
|
8545
|
+
] });
|
|
8546
|
+
};
|
|
8547
|
+
const MultiSegmentedNucleotideMutationsInfo = () => {
|
|
8548
|
+
const referenceGenome = x(ReferenceGenomeContext);
|
|
8549
|
+
const firstSegment = referenceGenome.nucleotideSequences[0].name;
|
|
8550
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
8551
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8552
|
+
"This organism is multi-segmented. Thus, nucleotide mutations have the format",
|
|
8553
|
+
" ",
|
|
8554
|
+
/* @__PURE__ */ u$1("b", { children: "<segment>:<position><base>" }),
|
|
8555
|
+
" or",
|
|
8556
|
+
" ",
|
|
8557
|
+
/* @__PURE__ */ u$1("b", { children: "<segment>:<base_ref><position><base>" }),
|
|
8558
|
+
". ",
|
|
8559
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
8560
|
+
" is the reference base at the position. It is optional. A ",
|
|
8561
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
8562
|
+
" can be one of the four nucleotides",
|
|
8563
|
+
" ",
|
|
8564
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
8565
|
+
", ",
|
|
8566
|
+
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
8567
|
+
", ",
|
|
8568
|
+
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
8569
|
+
", and ",
|
|
8570
|
+
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
8571
|
+
". It can also be ",
|
|
8572
|
+
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
8573
|
+
" for deletion and ",
|
|
8574
|
+
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
8575
|
+
" for unknown. For example if the reference sequence is ",
|
|
8576
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
8577
|
+
" at position ",
|
|
8578
|
+
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
8579
|
+
" both:",
|
|
8580
|
+
" ",
|
|
8581
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8582
|
+
firstSegment,
|
|
8583
|
+
":23T"
|
|
8584
|
+
] }),
|
|
8585
|
+
" and ",
|
|
8586
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8587
|
+
firstSegment,
|
|
8588
|
+
":A23T"
|
|
8589
|
+
] }),
|
|
8590
|
+
" will yield the same results."
|
|
8591
|
+
] }),
|
|
8592
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8593
|
+
"Insertions can be searched for in the same manner, they just need to have ",
|
|
8594
|
+
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
8595
|
+
" appended to the start of the mutation. Example: ",
|
|
8596
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
8597
|
+
"ins_",
|
|
8598
|
+
firstSegment,
|
|
8599
|
+
":10462:A"
|
|
8600
|
+
] }),
|
|
8601
|
+
"."
|
|
8602
|
+
] }),
|
|
8603
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8604
|
+
"This organism has the following segments:",
|
|
8605
|
+
" ",
|
|
8606
|
+
referenceGenome.nucleotideSequences.map((gene) => gene.name).join(", "),
|
|
8607
|
+
"."
|
|
8608
|
+
] }),
|
|
8609
|
+
" "
|
|
8610
|
+
] });
|
|
8611
|
+
};
|
|
8269
8612
|
const sequenceTypeFromSegment = (possibleSegment, referenceGenome) => {
|
|
8270
8613
|
if (possibleSegment === void 0) {
|
|
8271
|
-
return referenceGenome
|
|
8614
|
+
return isSingleSegmented(referenceGenome) ? "nucleotide" : void 0;
|
|
8272
8615
|
}
|
|
8273
8616
|
if (referenceGenome.nucleotideSequences.some((sequence) => sequence.name === possibleSegment)) {
|
|
8274
8617
|
return "nucleotide";
|
|
@@ -8388,7 +8731,7 @@ const MutationFilterInner = ({ initialValue }) => {
|
|
|
8388
8731
|
setIsError(false);
|
|
8389
8732
|
};
|
|
8390
8733
|
return /* @__PURE__ */ u$1("form", { className: "w-full border boder-gray-300 rounded-md relative", onSubmit: handleSubmit, ref: formRef, children: [
|
|
8391
|
-
/* @__PURE__ */ u$1("div", { className: "absolute -top-3 -right-3", children: /* @__PURE__ */ u$1(
|
|
8734
|
+
/* @__PURE__ */ u$1("div", { className: "absolute -top-3 -right-3", children: /* @__PURE__ */ u$1(MutationFilterInfo, {}) }),
|
|
8392
8735
|
/* @__PURE__ */ u$1("div", { className: "w-full flex p-2 flex-wrap items-center", children: [
|
|
8393
8736
|
/* @__PURE__ */ u$1(
|
|
8394
8737
|
SelectedMutationDisplay,
|
|
@@ -8614,6 +8957,7 @@ export {
|
|
|
8614
8957
|
MutationComparisonComponent,
|
|
8615
8958
|
MutationFilterComponent,
|
|
8616
8959
|
MutationsComponent,
|
|
8960
|
+
NumberSequencesOverTimeComponent,
|
|
8617
8961
|
PrevalenceOverTimeComponent,
|
|
8618
8962
|
RelativeGrowthAdvantageComponent,
|
|
8619
8963
|
TextInputComponent
|