@genspectrum/dashboard-components 0.13.6 → 0.13.7

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.
Files changed (36) hide show
  1. package/custom-elements.json +28 -28
  2. package/dist/components.d.ts +19 -21
  3. package/dist/components.js +348 -231
  4. package/dist/components.js.map +1 -1
  5. package/dist/style.css +20 -5
  6. package/dist/util.d.ts +18 -18
  7. package/package.json +1 -1
  8. package/src/preact/components/tabs.tsx +3 -5
  9. package/src/preact/mutationFilter/ExampleMutation.tsx +68 -0
  10. package/src/preact/mutationFilter/mutation-filter-info.tsx +179 -112
  11. package/src/preact/mutationFilter/mutation-filter.tsx +10 -5
  12. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +26 -4
  13. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +2 -6
  14. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
  15. package/src/web-components/{app.stories.ts → gs-app.stories.ts} +1 -1
  16. package/src/web-components/{app.ts → gs-app.ts} +2 -2
  17. package/src/web-components/index.ts +1 -1
  18. package/src/web-components/input/gs-date-range-selector.stories.ts +1 -1
  19. package/src/web-components/input/gs-lineage-filter.stories.ts +1 -1
  20. package/src/web-components/input/gs-location-filter.stories.ts +1 -1
  21. package/src/web-components/input/gs-mutation-filter.stories.ts +2 -2
  22. package/src/web-components/input/gs-text-input.stories.ts +1 -1
  23. package/src/web-components/visualization/gs-aggregate.stories.ts +1 -1
  24. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +1 -1
  25. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +1 -1
  26. package/src/web-components/visualization/gs-mutations.stories.ts +1 -1
  27. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +1 -1
  28. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +1 -1
  29. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +1 -1
  30. package/src/web-components/visualization/gs-sequences-by-location.stories.ts +1 -1
  31. package/src/web-components/visualization/gs-statistics.stories.ts +1 -1
  32. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +4 -1
  33. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +6 -2
  34. package/standalone-bundle/dashboard-components.js +5073 -5014
  35. package/standalone-bundle/dashboard-components.js.map +1 -1
  36. package/standalone-bundle/style.css +1 -1
@@ -550,7 +550,7 @@ var __decorateClass$g = (decorators, target, key, kind) => {
550
550
  return result;
551
551
  };
552
552
  const lapisUrlSchema = z$2.string().url();
553
- let App = class extends LitElement {
553
+ let AppComponent = class extends LitElement {
554
554
  constructor() {
555
555
  super(...arguments);
556
556
  this.lapis = "";
@@ -585,13 +585,13 @@ let App = class extends LitElement {
585
585
  __decorateClass$g([
586
586
  provide({ context: lapisContext }),
587
587
  n$1()
588
- ], App.prototype, "lapis", 2);
588
+ ], AppComponent.prototype, "lapis", 2);
589
589
  __decorateClass$g([
590
590
  provide({ context: referenceGenomeContext })
591
- ], App.prototype, "referenceGenome", 2);
592
- App = __decorateClass$g([
591
+ ], AppComponent.prototype, "referenceGenome", 2);
592
+ AppComponent = __decorateClass$g([
593
593
  t$3("gs-app")
594
- ], App);
594
+ ], AppComponent);
595
595
  function GsAppError(error) {
596
596
  return html` <div class="m-2 w-full alert alert-error">Error: ${error}</div>`;
597
597
  }
@@ -2041,13 +2041,13 @@ function useDisplayedSegments(sequenceType) {
2041
2041
  return h(displayedSegments);
2042
2042
  }
2043
2043
  const Tabs = ({ tabs, toolbar }) => {
2044
- var _a, _b;
2044
+ var _a;
2045
2045
  const [activeTab, setActiveTab] = h((_a = tabs[0]) == null ? void 0 : _a.title);
2046
2046
  const tabElements = /* @__PURE__ */ u$1("div", { className: "flex flex-row flex-wrap", children: tabs.map((tab) => {
2047
2047
  return /* @__PURE__ */ u$1(
2048
2048
  "button",
2049
2049
  {
2050
- className: `px-4 py-2 text-sm font-medium leading-5 transition-colors duration-150 ${activeTab === tab.title ? "border-b-2 border-gray-400" : "text-gray-600 hover:bg-gray-100 hover:text-gray-700"}`,
2050
+ className: `px-4 py-2 text-sm font-medium leading-5 transition-colors duration-150 ${activeTab === tab.title ? "border-b-2 border-gray-500" : "border-b border-gray-300 text-gray-600 hover:bg-gray-100 hover:text-gray-700"}`,
2051
2051
  onClick: () => {
2052
2052
  setActiveTab(tab.title);
2053
2053
  },
@@ -2062,13 +2062,7 @@ const Tabs = ({ tabs, toolbar }) => {
2062
2062
  tabElements,
2063
2063
  toolbar && /* @__PURE__ */ u$1("div", { className: "py-2 flex flex-wrap gap-y-1", children: toolbarElement })
2064
2064
  ] }),
2065
- /* @__PURE__ */ u$1(
2066
- "div",
2067
- {
2068
- className: `p-2 flex-grow overflow-scroll border-2 border-gray-100 rounded-b-md rounded-tr-md ${activeTab === ((_b = tabs[0]) == null ? void 0 : _b.title) ? "" : "rounded-tl-md"}`,
2069
- children: tabs.map((tab) => /* @__PURE__ */ u$1("div", { className: "h-full", hidden: activeTab !== tab.title, children: tab.content }, tab.title))
2070
- }
2071
- )
2065
+ /* @__PURE__ */ u$1("div", { className: `p-2 flex-grow overflow-scroll border-2 border-gray-100 rounded-b-md rounded-tr-md`, children: tabs.map((tab) => /* @__PURE__ */ u$1("div", { className: "h-full", hidden: activeTab !== tab.title, children: tab.content }, tab.title)) })
2072
2066
  ] });
2073
2067
  };
2074
2068
  function useQuery(fetchDataCallback, dependencies) {
@@ -5196,6 +5190,9 @@ input.tab:checked + .tab-content,
5196
5190
  .gap-y-1 {
5197
5191
  row-gap: 0.25rem;
5198
5192
  }
5193
+ .overflow-visible {
5194
+ overflow: visible;
5195
+ }
5199
5196
  .overflow-scroll {
5200
5197
  overflow: scroll;
5201
5198
  }
@@ -5205,6 +5202,9 @@ input.tab:checked + .tab-content,
5205
5202
  .whitespace-nowrap {
5206
5203
  white-space: nowrap;
5207
5204
  }
5205
+ .text-nowrap {
5206
+ text-wrap: nowrap;
5207
+ }
5208
5208
  .break-words {
5209
5209
  overflow-wrap: break-word;
5210
5210
  }
@@ -5224,9 +5224,6 @@ input.tab:checked + .tab-content,
5224
5224
  border-bottom-right-radius: 0.375rem;
5225
5225
  border-bottom-left-radius: 0.375rem;
5226
5226
  }
5227
- .rounded-tl-md {
5228
- border-top-left-radius: 0.375rem;
5229
- }
5230
5227
  .rounded-tr-md {
5231
5228
  border-top-right-radius: 0.375rem;
5232
5229
  }
@@ -5236,6 +5233,9 @@ input.tab:checked + .tab-content,
5236
5233
  .border-2 {
5237
5234
  border-width: 2px;
5238
5235
  }
5236
+ .border-b {
5237
+ border-bottom-width: 1px;
5238
+ }
5239
5239
  .border-b-2 {
5240
5240
  border-bottom-width: 2px;
5241
5241
  }
@@ -5251,9 +5251,9 @@ input.tab:checked + .tab-content,
5251
5251
  --tw-border-opacity: 1;
5252
5252
  border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
5253
5253
  }
5254
- .border-gray-400 {
5254
+ .border-gray-500 {
5255
5255
  --tw-border-opacity: 1;
5256
- border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));
5256
+ border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));
5257
5257
  }
5258
5258
  .border-slate-500 {
5259
5259
  --tw-border-opacity: 1;
@@ -5354,6 +5354,9 @@ input.tab:checked + .tab-content,
5354
5354
  .font-medium {
5355
5355
  font-weight: 500;
5356
5356
  }
5357
+ .font-semibold {
5358
+ font-weight: 600;
5359
+ }
5357
5360
  .leading-5 {
5358
5361
  line-height: 1.25rem;
5359
5362
  }
@@ -5500,6 +5503,12 @@ input.tab:checked + .tab-content,
5500
5503
  visibility: visible;
5501
5504
  }
5502
5505
  }
5506
+ @container (min-width: 6rem) {
5507
+
5508
+ .\\@\\[6rem\\]\\:visible {
5509
+ visibility: visible;
5510
+ }
5511
+ }
5503
5512
  @media (min-width: 640px) {
5504
5513
 
5505
5514
  .sm\\:max-w-5xl {
@@ -9519,48 +9528,69 @@ const MutationsOverTimeGrid = ({
9519
9528
  gridTemplateRows: `repeat(${shownMutations.length}, 24px)`,
9520
9529
  gridTemplateColumns: `${MUTATION_CELL_WIDTH_REM}rem repeat(${dates.length}, minmax(0.05rem, 1fr))`
9521
9530
  },
9522
- children: shownMutations.map((mutation, rowIndex) => {
9523
- return /* @__PURE__ */ u$1(Fragment, { children: [
9524
- /* @__PURE__ */ u$1(
9525
- "div",
9526
- {
9527
- style: { gridRowStart: rowIndex + 1, gridColumnStart: 1 },
9528
- children: /* @__PURE__ */ u$1(MutationCell, { mutation })
9529
- },
9530
- `mutation-${mutation.toString()}`
9531
- ),
9532
- dates.map((date, columnIndex) => {
9533
- const value = data.get(mutation, date) ?? null;
9534
- const tooltipPosition = getTooltipPosition(
9535
- rowIndex,
9536
- shownMutations.length,
9537
- columnIndex,
9538
- dates.length
9539
- );
9540
- return /* @__PURE__ */ u$1(
9531
+ className: "text-center",
9532
+ children: [
9533
+ dates.map((date, columnIndex) => /* @__PURE__ */ u$1(
9534
+ "div",
9535
+ {
9536
+ className: "@container font-semibold",
9537
+ style: { gridRowStart: 1, gridColumnStart: columnIndex + 2 },
9538
+ children: /* @__PURE__ */ u$1("p", { ...styleGridHeader(columnIndex, dates), children: date.dateString })
9539
+ },
9540
+ date.dateString
9541
+ )),
9542
+ shownMutations.map((mutation, rowIndex) => {
9543
+ return /* @__PURE__ */ u$1(Fragment, { children: [
9544
+ /* @__PURE__ */ u$1(
9541
9545
  "div",
9542
9546
  {
9543
- style: { gridRowStart: rowIndex + 1, gridColumnStart: columnIndex + 2 },
9544
- children: /* @__PURE__ */ u$1(
9545
- ProportionCell,
9546
- {
9547
- value,
9548
- date,
9549
- mutation,
9550
- tooltipPosition,
9551
- colorScale
9552
- }
9553
- )
9547
+ style: { gridRowStart: rowIndex + 2, gridColumnStart: 1 },
9548
+ children: /* @__PURE__ */ u$1(MutationCell, { mutation })
9554
9549
  },
9555
- `${mutation.toString()}-${date.toString()}`
9556
- );
9557
- })
9558
- ] }, `fragment-${mutation.toString()}`);
9559
- })
9550
+ `mutation-${mutation.toString()}`
9551
+ ),
9552
+ dates.map((date, columnIndex) => {
9553
+ const value = data.get(mutation, date) ?? null;
9554
+ const tooltipPosition = getTooltipPosition(
9555
+ rowIndex,
9556
+ shownMutations.length,
9557
+ columnIndex,
9558
+ dates.length
9559
+ );
9560
+ return /* @__PURE__ */ u$1(
9561
+ "div",
9562
+ {
9563
+ style: { gridRowStart: rowIndex + 2, gridColumnStart: columnIndex + 2 },
9564
+ children: /* @__PURE__ */ u$1(
9565
+ ProportionCell,
9566
+ {
9567
+ value,
9568
+ date,
9569
+ mutation,
9570
+ tooltipPosition,
9571
+ colorScale
9572
+ }
9573
+ )
9574
+ },
9575
+ `${mutation.toString()}-${date.toString()}`
9576
+ );
9577
+ })
9578
+ ] }, `fragment-${mutation.toString()}`);
9579
+ })
9580
+ ]
9560
9581
  }
9561
9582
  )
9562
9583
  ] });
9563
9584
  };
9585
+ function styleGridHeader(columnIndex, dates) {
9586
+ if (columnIndex === 0) {
9587
+ return { className: "overflow-visible text-nowrap" };
9588
+ }
9589
+ if (columnIndex === dates.length - 1) {
9590
+ return { className: "overflow-visible text-nowrap", style: { direction: "rtl" } };
9591
+ }
9592
+ return { className: "invisible @[6rem]:visible" };
9593
+ }
9564
9594
  function getTooltipPosition(rowIndex, rows, columnIndex, columns) {
9565
9595
  const tooltipX = rowIndex < rows / 2 || rowIndex < 6 ? "bottom" : "top";
9566
9596
  const tooltipY = columnIndex < columns / 2 ? "start" : "end";
@@ -9597,7 +9627,7 @@ const ProportionCell = ({ value, mutation, date, tooltipPosition, colorScale })
9597
9627
  backgroundColor: getColorWithingScale(value == null ? void 0 : value.proportion, colorScale),
9598
9628
  color: getTextColorForScale(value == null ? void 0 : value.proportion, colorScale)
9599
9629
  },
9600
- className: `w-full h-full text-center hover:font-bold text-xs group @container`,
9630
+ className: `w-full h-full hover:font-bold text-xs group @container`,
9601
9631
  children: /* @__PURE__ */ u$1("span", { className: "invisible @[2rem]:visible", children: value === null ? "" : formatProportion(value.proportion, 0) })
9602
9632
  }
9603
9633
  ) }) });
@@ -9609,7 +9639,7 @@ const timeIntervalDisplay = (date) => {
9609
9639
  return `${date.firstDay.toString()} - ${date.lastDay.toString()}`;
9610
9640
  };
9611
9641
  const MutationCell = ({ mutation }) => {
9612
- return /* @__PURE__ */ u$1("div", { className: "text-center", children: mutation.code });
9642
+ return /* @__PURE__ */ u$1("div", { children: mutation.code });
9613
9643
  };
9614
9644
  const ColorScaleSelectorDropdown = ({
9615
9645
  colorScale,
@@ -11225,7 +11255,7 @@ const wastewaterMutationOverTimeSchema = z$2.object({
11225
11255
  sequenceType: sequenceTypeSchema,
11226
11256
  width: z$2.string(),
11227
11257
  height: z$2.string(),
11228
- maxNumberOfGridRows: z$2.number().optional()
11258
+ maxNumberOfGridRows: z$2.number()
11229
11259
  });
11230
11260
  const WastewaterMutationsOverTime = (componentProps) => {
11231
11261
  const { width, height } = componentProps;
@@ -15073,48 +15103,218 @@ const ReferenceGenomesAwaiter = ({ children }) => {
15073
15103
  function isNotInitialized(referenceGenome) {
15074
15104
  return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
15075
15105
  }
15076
- const MutationFilterInfo = () => {
15106
+ const ExampleMutation = ({ sequenceType, mutationType }) => {
15077
15107
  const referenceGenome = x$1(ReferenceGenomeContext);
15078
- const firstGene = referenceGenome.genes[0].name;
15108
+ return /* @__PURE__ */ u$1("b", { children: getExampleMutation(referenceGenome, sequenceType, mutationType) });
15109
+ };
15110
+ function getExampleMutation(referenceGenome, sequenceType, mutationType) {
15111
+ switch (sequenceType) {
15112
+ case "amino acid": {
15113
+ if (referenceGenome.genes.length === 0) {
15114
+ return "";
15115
+ }
15116
+ const firstGene = referenceGenome.genes[0].name;
15117
+ switch (mutationType) {
15118
+ case "substitution":
15119
+ return `${firstGene}:57Q`;
15120
+ case "insertion":
15121
+ return `ins_${firstGene}:31:N`;
15122
+ }
15123
+ }
15124
+ // Issue of linter https://github.com/typescript-eslint/typescript-eslint/issues/3455
15125
+ // eslint-disable-next-line no-fallthrough
15126
+ case "nucleotide": {
15127
+ switch (referenceGenome.nucleotideSequences.length) {
15128
+ case 0: {
15129
+ return "";
15130
+ }
15131
+ case 1: {
15132
+ switch (mutationType) {
15133
+ case "substitution":
15134
+ return "23T";
15135
+ case "insertion":
15136
+ return "ins_1046:A";
15137
+ }
15138
+ }
15139
+ // Issue of linter https://github.com/typescript-eslint/typescript-eslint/issues/3455
15140
+ // eslint-disable-next-line no-fallthrough
15141
+ default: {
15142
+ const firstSegment = referenceGenome.nucleotideSequences[0].name;
15143
+ switch (mutationType) {
15144
+ case "substitution":
15145
+ return `${firstSegment}:23T`;
15146
+ case "insertion":
15147
+ return `ins_${firstSegment}:10462:A`;
15148
+ }
15149
+ }
15150
+ }
15151
+ }
15152
+ }
15153
+ }
15154
+ const MutationFilterInfo = () => {
15079
15155
  return /* @__PURE__ */ u$1(Info, { children: [
15080
15156
  /* @__PURE__ */ u$1(InfoHeadline1, { children: " Mutation Filter" }),
15081
15157
  /* @__PURE__ */ u$1(InfoParagraph, { children: "This component allows you to filter for mutations at specific positions." }),
15158
+ /* @__PURE__ */ u$1(QuickStart, {}),
15159
+ /* @__PURE__ */ u$1(NucleotideMutationsInfo, {}),
15160
+ /* @__PURE__ */ u$1(AminoAcidMutationsInfo, {}),
15161
+ /* @__PURE__ */ u$1(InsertionWildcards, {}),
15162
+ /* @__PURE__ */ u$1(MultipleMutations, {}),
15163
+ /* @__PURE__ */ u$1(AnyMutation, {}),
15164
+ /* @__PURE__ */ u$1(NoMutation, {})
15165
+ ] });
15166
+ };
15167
+ const QuickStart = () => {
15168
+ const referenceGenome = x$1(ReferenceGenomeContext);
15169
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15082
15170
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Quickstart" }),
15083
15171
  /* @__PURE__ */ u$1(InfoParagraph, { children: /* @__PURE__ */ u$1("ul", { className: "list-disc list-inside", children: [
15084
- /* @__PURE__ */ u$1("li", { children: [
15172
+ referenceGenome.nucleotideSequences.length > 0 && /* @__PURE__ */ u$1("li", { children: [
15085
15173
  "Filter for nucleotide mutations:",
15086
15174
  " ",
15087
15175
  /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "substitution", sequenceType: "nucleotide" })
15088
15176
  ] }),
15089
- /* @__PURE__ */ u$1("li", { children: [
15177
+ referenceGenome.genes.length > 0 && /* @__PURE__ */ u$1("li", { children: [
15090
15178
  "Filter for amino acid mutations:",
15091
15179
  " ",
15092
- /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" })
15180
+ /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "substitution", sequenceType: "amino acid" })
15093
15181
  ] }),
15094
- /* @__PURE__ */ u$1("li", { children: [
15182
+ referenceGenome.nucleotideSequences.length > 0 && /* @__PURE__ */ u$1("li", { children: [
15095
15183
  "Filter for nucleotide insertions:",
15096
15184
  " ",
15097
- /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "substitution", sequenceType: "amino acid" })
15185
+ /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" })
15098
15186
  ] }),
15099
- /* @__PURE__ */ u$1("li", { children: [
15187
+ referenceGenome.genes.length > 0 && /* @__PURE__ */ u$1("li", { children: [
15100
15188
  "Filter for amino acid insertions:",
15101
15189
  " ",
15102
15190
  /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "amino acid" })
15103
15191
  ] })
15104
15192
  ] }) }),
15105
- !isSingleSegmented(referenceGenome) && /* @__PURE__ */ u$1(InfoParagraph, { children: [
15193
+ referenceGenome.nucleotideSequences.length > 1 ? /* @__PURE__ */ u$1(InfoParagraph, { children: [
15106
15194
  "This organism has the following segments:",
15107
15195
  " ",
15108
15196
  referenceGenome.nucleotideSequences.map((gene) => gene.name).join(", "),
15109
15197
  "."
15110
- ] }),
15111
- /* @__PURE__ */ u$1(InfoParagraph, { children: [
15198
+ ] }) : /* @__PURE__ */ u$1(InfoParagraph, { children: "This organism doesn't support nucleotide sequences." }),
15199
+ referenceGenome.genes.length !== 0 ? /* @__PURE__ */ u$1(InfoParagraph, { children: [
15112
15200
  "This organism has the following genes: ",
15113
15201
  referenceGenome.genes.map((gene) => gene.name).join(", "),
15114
15202
  "."
15115
- ] }),
15203
+ ] }) : /* @__PURE__ */ u$1(InfoParagraph, { children: "This organism doesn't support amino acid sequences." })
15204
+ ] });
15205
+ };
15206
+ const NucleotideMutationsInfo = () => {
15207
+ const referenceGenome = x$1(ReferenceGenomeContext);
15208
+ if (referenceGenome.nucleotideSequences.length === 0) {
15209
+ return null;
15210
+ }
15211
+ if (isSingleSegmented(referenceGenome)) {
15212
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15213
+ /* @__PURE__ */ u$1(InfoHeadline2, { children: "Nucleotide Mutations and Insertions" }),
15214
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
15215
+ "This organism is single-segmented. Thus, nucleotide mutations have the format",
15216
+ " ",
15217
+ /* @__PURE__ */ u$1("b", { children: "<position><base>" }),
15218
+ " or ",
15219
+ /* @__PURE__ */ u$1("b", { children: "<base_ref><position><base>" }),
15220
+ ". The",
15221
+ " ",
15222
+ /* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
15223
+ " is the reference base at the position. It is optional. A ",
15224
+ /* @__PURE__ */ u$1("b", { children: "<base>" }),
15225
+ " ",
15226
+ "can be one of the four nucleotides ",
15227
+ /* @__PURE__ */ u$1("b", { children: "A" }),
15228
+ ", ",
15229
+ /* @__PURE__ */ u$1("b", { children: "T" }),
15230
+ ", ",
15231
+ /* @__PURE__ */ u$1("b", { children: "C" }),
15232
+ ", and ",
15233
+ /* @__PURE__ */ u$1("b", { children: "G" }),
15234
+ ". It can also be",
15235
+ " ",
15236
+ /* @__PURE__ */ u$1("b", { children: "-" }),
15237
+ " for deletion and ",
15238
+ /* @__PURE__ */ u$1("b", { children: "N" }),
15239
+ " for unknown. For example if the reference sequence is ",
15240
+ /* @__PURE__ */ u$1("b", { children: "A" }),
15241
+ " at position ",
15242
+ /* @__PURE__ */ u$1("b", { children: "23" }),
15243
+ " both: ",
15244
+ /* @__PURE__ */ u$1("b", { children: "23T" }),
15245
+ " and ",
15246
+ /* @__PURE__ */ u$1("b", { children: "A23T" }),
15247
+ " will yield the same results."
15248
+ ] }),
15249
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
15250
+ "Insertions can be searched for in the same manner, they just need to have ",
15251
+ /* @__PURE__ */ u$1("b", { children: "ins_" }),
15252
+ " appended to the start of the mutation. Example: ",
15253
+ /* @__PURE__ */ u$1("b", { children: "ins_1046:A" }),
15254
+ " would filter for sequences with an insertion of A between the positions 1046 and 1047 in the nucleotide sequence."
15255
+ ] })
15256
+ ] });
15257
+ }
15258
+ const firstSegment = referenceGenome.nucleotideSequences[0].name;
15259
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15116
15260
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Nucleotide Mutations and Insertions" }),
15117
- isSingleSegmented(referenceGenome) ? /* @__PURE__ */ u$1(SingleSegmentedNucleotideMutationsInfo, {}) : /* @__PURE__ */ u$1(MultiSegmentedNucleotideMutationsInfo, {}),
15261
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
15262
+ "This organism is multi-segmented. Thus, nucleotide mutations have the format",
15263
+ " ",
15264
+ /* @__PURE__ */ u$1("b", { children: "<segment>:<position><base>" }),
15265
+ " or",
15266
+ " ",
15267
+ /* @__PURE__ */ u$1("b", { children: "<segment>:<base_ref><position><base>" }),
15268
+ ". ",
15269
+ /* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
15270
+ " is the reference base at the position. It is optional. A ",
15271
+ /* @__PURE__ */ u$1("b", { children: "<base>" }),
15272
+ " can be one of the four nucleotides",
15273
+ " ",
15274
+ /* @__PURE__ */ u$1("b", { children: "A" }),
15275
+ ", ",
15276
+ /* @__PURE__ */ u$1("b", { children: "T" }),
15277
+ ", ",
15278
+ /* @__PURE__ */ u$1("b", { children: "C" }),
15279
+ ", and ",
15280
+ /* @__PURE__ */ u$1("b", { children: "G" }),
15281
+ ". It can also be ",
15282
+ /* @__PURE__ */ u$1("b", { children: "-" }),
15283
+ " for deletion and ",
15284
+ /* @__PURE__ */ u$1("b", { children: "N" }),
15285
+ " for unknown. For example if the reference sequence is ",
15286
+ /* @__PURE__ */ u$1("b", { children: "A" }),
15287
+ " at position ",
15288
+ /* @__PURE__ */ u$1("b", { children: "23" }),
15289
+ " both:",
15290
+ " ",
15291
+ /* @__PURE__ */ u$1("b", { children: [
15292
+ firstSegment,
15293
+ ":23T"
15294
+ ] }),
15295
+ " and ",
15296
+ /* @__PURE__ */ u$1("b", { children: [
15297
+ firstSegment,
15298
+ ":A23T"
15299
+ ] }),
15300
+ " will yield the same results."
15301
+ ] }),
15302
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
15303
+ "Insertions can be searched for in the same manner, they just need to have ",
15304
+ /* @__PURE__ */ u$1("b", { children: "ins_" }),
15305
+ " appended to the start of the mutation. Example: ",
15306
+ /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" }),
15307
+ "."
15308
+ ] })
15309
+ ] });
15310
+ };
15311
+ const AminoAcidMutationsInfo = () => {
15312
+ const referenceGenome = x$1(ReferenceGenomeContext);
15313
+ if (referenceGenome.genes.length === 0) {
15314
+ return null;
15315
+ }
15316
+ const firstGene = referenceGenome.genes[0].name;
15317
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15118
15318
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Amino Acid Mutations and Insertions" }),
15119
15319
  /* @__PURE__ */ u$1(InfoParagraph, { children: [
15120
15320
  "An amino acid mutation has the format ",
@@ -15144,30 +15344,46 @@ const MutationFilterInfo = () => {
15144
15344
  " would filter for sequences with an insertion of N between positions 31 and 32 in the gene ",
15145
15345
  firstGene,
15146
15346
  "."
15147
- ] }),
15347
+ ] })
15348
+ ] });
15349
+ };
15350
+ const InsertionWildcards = () => {
15351
+ const referenceGenome = x$1(ReferenceGenomeContext);
15352
+ if (referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0) {
15353
+ return null;
15354
+ }
15355
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15148
15356
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Insertion Wildcards" }),
15149
15357
  /* @__PURE__ */ u$1(InfoParagraph, { children: [
15150
- "This component supports insertion queries that contain wildcards ",
15358
+ "This component supports nucleotide and amino acid insertion queries that contain wildcards ",
15151
15359
  /* @__PURE__ */ u$1("b", { children: "?" }),
15152
15360
  ". For example",
15153
15361
  " ",
15154
15362
  /* @__PURE__ */ u$1("b", { children: [
15155
15363
  "ins_",
15156
- firstGene,
15157
- ":214:?EP?"
15364
+ exampleSegmentString(referenceGenome),
15365
+ "214:?",
15366
+ exampleWildcardInsertion(referenceGenome),
15367
+ "?"
15158
15368
  ] }),
15159
- " will match all cases where segment ",
15160
- /* @__PURE__ */ u$1("b", { children: firstGene }),
15161
- " has an insertion of ",
15162
- /* @__PURE__ */ u$1("b", { children: "EP" }),
15369
+ " ",
15370
+ "will match all cases where segment ",
15371
+ /* @__PURE__ */ u$1("b", { children: exampleSegment(referenceGenome) }),
15372
+ " has an insertion of",
15373
+ " ",
15374
+ /* @__PURE__ */ u$1("b", { children: exampleWildcardInsertion(referenceGenome) }),
15163
15375
  " between the positions ",
15164
15376
  /* @__PURE__ */ u$1("b", { children: "214" }),
15165
15377
  " and ",
15166
15378
  /* @__PURE__ */ u$1("b", { children: "215" }),
15167
15379
  " but also an insertion of other amino acids which include the ",
15168
15380
  /* @__PURE__ */ u$1("b", { children: "EP" }),
15169
- ", e.g. the insertion ",
15170
- /* @__PURE__ */ u$1("b", { children: "EPE" }),
15381
+ ", e.g. the insertion",
15382
+ " ",
15383
+ /* @__PURE__ */ u$1("b", { children: [
15384
+ exampleWildcardInsertion(referenceGenome),
15385
+ "T"
15386
+ ] }),
15171
15387
  " will be matched."
15172
15388
  ] }),
15173
15389
  /* @__PURE__ */ u$1(InfoParagraph, { children: [
@@ -15175,13 +15391,47 @@ const MutationFilterInfo = () => {
15175
15391
  " ",
15176
15392
  /* @__PURE__ */ u$1("b", { children: [
15177
15393
  "ins_",
15178
- firstGene,
15179
- ":214:?"
15394
+ exampleSegmentString(referenceGenome),
15395
+ "214:?"
15180
15396
  ] }),
15181
15397
  " match any (but at least one) insertion between the positions 214 and 215."
15182
- ] }),
15398
+ ] })
15399
+ ] });
15400
+ };
15401
+ const exampleSegmentString = (referenceGenome) => {
15402
+ const segment = exampleSegment(referenceGenome);
15403
+ if (segment === "") {
15404
+ return "";
15405
+ }
15406
+ return `${segment}:`;
15407
+ };
15408
+ const exampleSegment = (referenceGenome) => {
15409
+ if (referenceGenome.genes.length > 0) {
15410
+ return `${referenceGenome.genes[0].name}`;
15411
+ }
15412
+ if (referenceGenome.nucleotideSequences.length > 1) {
15413
+ return `${referenceGenome.nucleotideSequences[0].name}`;
15414
+ }
15415
+ return "";
15416
+ };
15417
+ const exampleWildcardInsertion = (referenceGenome) => {
15418
+ if (referenceGenome.genes.length > 0) {
15419
+ return "EP";
15420
+ }
15421
+ if (referenceGenome.nucleotideSequences.length > 0) {
15422
+ return "CG";
15423
+ }
15424
+ return "";
15425
+ };
15426
+ const MultipleMutations = () => {
15427
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15183
15428
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Multiple Mutations" }),
15184
- /* @__PURE__ */ u$1(InfoParagraph, { children: "Multiple mutation filters can be provided by adding one mutation after the other." }),
15429
+ /* @__PURE__ */ u$1(InfoParagraph, { children: "Multiple mutation filters can be provided by adding one mutation after the other." })
15430
+ ] });
15431
+ };
15432
+ const AnyMutation = () => {
15433
+ const referenceGenome = x$1(ReferenceGenomeContext);
15434
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15185
15435
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "Any Mutation" }),
15186
15436
  /* @__PURE__ */ u$1(InfoParagraph, { children: [
15187
15437
  "To filter for any mutation at a given position you can omit the ",
@@ -15189,11 +15439,15 @@ const MutationFilterInfo = () => {
15189
15439
  ". Example:",
15190
15440
  " ",
15191
15441
  /* @__PURE__ */ u$1("b", { children: [
15192
- firstGene,
15193
- ":20"
15442
+ exampleSegmentString(referenceGenome),
15443
+ "20"
15194
15444
  ] }),
15195
15445
  "."
15196
- ] }),
15446
+ ] })
15447
+ ] });
15448
+ };
15449
+ const NoMutation = () => {
15450
+ return /* @__PURE__ */ u$1(Fragment, { children: [
15197
15451
  /* @__PURE__ */ u$1(InfoHeadline2, { children: "No Mutation" }),
15198
15452
  /* @__PURE__ */ u$1(InfoParagraph, { children: [
15199
15453
  "You can write a ",
@@ -15204,146 +15458,6 @@ const MutationFilterInfo = () => {
15204
15458
  ] })
15205
15459
  ] });
15206
15460
  };
15207
- const SingleSegmentedNucleotideMutationsInfo = () => {
15208
- return /* @__PURE__ */ u$1(Fragment, { children: [
15209
- /* @__PURE__ */ u$1(InfoParagraph, { children: [
15210
- "This organism is single-segmented. Thus, nucleotide mutations have the format",
15211
- " ",
15212
- /* @__PURE__ */ u$1("b", { children: "<position><base>" }),
15213
- " or ",
15214
- /* @__PURE__ */ u$1("b", { children: "<base_ref><position><base>" }),
15215
- ". The",
15216
- " ",
15217
- /* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
15218
- " is the reference base at the position. It is optional. A ",
15219
- /* @__PURE__ */ u$1("b", { children: "<base>" }),
15220
- " can be one of the four nucleotides ",
15221
- /* @__PURE__ */ u$1("b", { children: "A" }),
15222
- ", ",
15223
- /* @__PURE__ */ u$1("b", { children: "T" }),
15224
- ", ",
15225
- /* @__PURE__ */ u$1("b", { children: "C" }),
15226
- ", and ",
15227
- /* @__PURE__ */ u$1("b", { children: "G" }),
15228
- ". It can also be ",
15229
- /* @__PURE__ */ u$1("b", { children: "-" }),
15230
- " for deletion and ",
15231
- /* @__PURE__ */ u$1("b", { children: "N" }),
15232
- " for unknown. For example if the reference sequence is ",
15233
- /* @__PURE__ */ u$1("b", { children: "A" }),
15234
- " at position",
15235
- " ",
15236
- /* @__PURE__ */ u$1("b", { children: "23" }),
15237
- " both: ",
15238
- /* @__PURE__ */ u$1("b", { children: "23T" }),
15239
- " and ",
15240
- /* @__PURE__ */ u$1("b", { children: "A23T" }),
15241
- " will yield the same results."
15242
- ] }),
15243
- /* @__PURE__ */ u$1(InfoParagraph, { children: [
15244
- "Insertions can be searched for in the same manner, they just need to have ",
15245
- /* @__PURE__ */ u$1("b", { children: "ins_" }),
15246
- " appended to the start of the mutation. Example: ",
15247
- /* @__PURE__ */ u$1("b", { children: "ins_1046:A" }),
15248
- " would filter for sequences with an insertion of A between the positions 1046 and 1047 in the nucleotide sequence."
15249
- ] })
15250
- ] });
15251
- };
15252
- const MultiSegmentedNucleotideMutationsInfo = () => {
15253
- const referenceGenome = x$1(ReferenceGenomeContext);
15254
- const firstSegment = referenceGenome.nucleotideSequences[0].name;
15255
- return /* @__PURE__ */ u$1(Fragment, { children: [
15256
- /* @__PURE__ */ u$1(InfoParagraph, { children: [
15257
- "This organism is multi-segmented. Thus, nucleotide mutations have the format",
15258
- " ",
15259
- /* @__PURE__ */ u$1("b", { children: "<segment>:<position><base>" }),
15260
- " or",
15261
- " ",
15262
- /* @__PURE__ */ u$1("b", { children: "<segment>:<base_ref><position><base>" }),
15263
- ". ",
15264
- /* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
15265
- " is the reference base at the position. It is optional. A ",
15266
- /* @__PURE__ */ u$1("b", { children: "<base>" }),
15267
- " can be one of the four nucleotides",
15268
- " ",
15269
- /* @__PURE__ */ u$1("b", { children: "A" }),
15270
- ", ",
15271
- /* @__PURE__ */ u$1("b", { children: "T" }),
15272
- ", ",
15273
- /* @__PURE__ */ u$1("b", { children: "C" }),
15274
- ", and ",
15275
- /* @__PURE__ */ u$1("b", { children: "G" }),
15276
- ". It can also be ",
15277
- /* @__PURE__ */ u$1("b", { children: "-" }),
15278
- " for deletion and ",
15279
- /* @__PURE__ */ u$1("b", { children: "N" }),
15280
- " for unknown. For example if the reference sequence is ",
15281
- /* @__PURE__ */ u$1("b", { children: "A" }),
15282
- " at position ",
15283
- /* @__PURE__ */ u$1("b", { children: "23" }),
15284
- " both:",
15285
- " ",
15286
- /* @__PURE__ */ u$1("b", { children: [
15287
- firstSegment,
15288
- ":23T"
15289
- ] }),
15290
- " and ",
15291
- /* @__PURE__ */ u$1("b", { children: [
15292
- firstSegment,
15293
- ":A23T"
15294
- ] }),
15295
- " will yield the same results."
15296
- ] }),
15297
- /* @__PURE__ */ u$1(InfoParagraph, { children: [
15298
- "Insertions can be searched for in the same manner, they just need to have ",
15299
- /* @__PURE__ */ u$1("b", { children: "ins_" }),
15300
- " appended to the start of the mutation. Example: ",
15301
- /* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" }),
15302
- "."
15303
- ] })
15304
- ] });
15305
- };
15306
- const ExampleMutation = ({ sequenceType, mutationType }) => {
15307
- const referenceGenome = x$1(ReferenceGenomeContext);
15308
- const firstSegment = referenceGenome.nucleotideSequences[0].name;
15309
- const firstGene = referenceGenome.genes[0].name;
15310
- if (sequenceType === "amino acid") {
15311
- switch (mutationType) {
15312
- case "substitution":
15313
- return /* @__PURE__ */ u$1("b", { children: [
15314
- firstGene,
15315
- ":57Q"
15316
- ] });
15317
- case "insertion":
15318
- return /* @__PURE__ */ u$1("b", { children: [
15319
- "ins_",
15320
- firstGene,
15321
- ":31:N"
15322
- ] });
15323
- }
15324
- }
15325
- if (isSingleSegmented(referenceGenome)) {
15326
- switch (mutationType) {
15327
- case "substitution":
15328
- return /* @__PURE__ */ u$1("b", { children: "23T" });
15329
- case "insertion":
15330
- return /* @__PURE__ */ u$1("b", { children: "ins_1046:A" });
15331
- }
15332
- }
15333
- switch (mutationType) {
15334
- case "substitution":
15335
- return /* @__PURE__ */ u$1("b", { children: [
15336
- firstSegment,
15337
- ":23T"
15338
- ] });
15339
- case "insertion":
15340
- return /* @__PURE__ */ u$1("b", { children: [
15341
- "ins_",
15342
- firstSegment,
15343
- ":10462:A"
15344
- ] });
15345
- }
15346
- };
15347
15461
  const sequenceTypeFromSegment = (possibleSegment, referenceGenome) => {
15348
15462
  if (possibleSegment === void 0) {
15349
15463
  return isSingleSegmented(referenceGenome) ? "nucleotide" : void 0;
@@ -15587,9 +15701,12 @@ const MutationFilterSelector = ({ referenceGenome, setSelectedFilters, selectedF
15587
15701
  ] });
15588
15702
  };
15589
15703
  function getPlaceholder(referenceGenome) {
15590
- const segmentPrefix = referenceGenome.nucleotideSequences.length > 1 ? `${referenceGenome.nucleotideSequences[0].name}:` : "";
15591
- const firstGene = referenceGenome.genes[0].name;
15592
- return `Enter a mutation (e.g. ${segmentPrefix}A123T, ins_${segmentPrefix}123:AT, ${firstGene}:M123E, ins_${firstGene}:123:ME)`;
15704
+ const nucleotideSubstitution = getExampleMutation(referenceGenome, "nucleotide", "substitution");
15705
+ const nucleotideInsertion = getExampleMutation(referenceGenome, "nucleotide", "insertion");
15706
+ const aminoAcidSubstitution = getExampleMutation(referenceGenome, "amino acid", "substitution");
15707
+ const aminoAcidInsertion = getExampleMutation(referenceGenome, "amino acid", "insertion");
15708
+ const exampleMutations = [nucleotideSubstitution, nucleotideInsertion, aminoAcidSubstitution, aminoAcidInsertion].filter((example) => example !== "").join(", ");
15709
+ return `Enter a mutation (e.g. ${exampleMutations})`;
15593
15710
  }
15594
15711
  const backgroundColor = {
15595
15712
  aminoAcidMutations: singleGraphColorRGBByName("teal", 0.4),
@@ -15811,7 +15928,7 @@ LineageFilterComponent = __decorateClass([
15811
15928
  ], LineageFilterComponent);
15812
15929
  export {
15813
15930
  AggregateComponent,
15814
- App,
15931
+ AppComponent,
15815
15932
  DateRangeSelectorComponent,
15816
15933
  LineageFilterComponent,
15817
15934
  LocationFilterComponent,