@platforma-sdk/ui-vue 1.41.17 → 1.42.0
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/.turbo/turbo-build.log +36 -71
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +3 -3
- package/dist/components/PlMultiSequenceAlignment/Legend.vue.d.ts +2 -2
- package/dist/components/PlMultiSequenceAlignment/Legend.vue.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Legend.vue2.js +11 -11
- package/dist/components/PlMultiSequenceAlignment/Legend.vue3.js +8 -8
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue.d.ts +12 -6
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js +80 -65
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js +14 -12
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts +36 -1
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js +146 -111
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue.d.ts +2 -0
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js +71 -68
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/chemical-properties.d.ts +42 -6
- package/dist/components/PlMultiSequenceAlignment/chemical-properties.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/chemical-properties.js +96 -130
- package/dist/components/PlMultiSequenceAlignment/chemical-properties.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/data.d.ts +3 -9
- package/dist/components/PlMultiSequenceAlignment/data.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/data.js +198 -212
- package/dist/components/PlMultiSequenceAlignment/data.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/markup.d.ts +7 -5
- package/dist/components/PlMultiSequenceAlignment/markup.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/markup.js +47 -26
- package/dist/components/PlMultiSequenceAlignment/markup.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/types.d.ts +1 -1
- package/dist/components/PlMultiSequenceAlignment/types.d.ts.map +1 -1
- package/dist/lib/ui/uikit/dist/components/DataTable/TableComponent.vue.js +2 -4
- package/dist/lib/ui/uikit/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/DataTable/index.js +2 -2
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/createGridlines.js +6 -8
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/createGridlines.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/createLabels.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/createSvgContainer.js +5 -7
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/createSvgContainer.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/drawBins.js +3 -5
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/drawBins.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/histogram.js +19 -21
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/histogram.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlChartHistogram/normalizeBins.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlPureSlideModal.vue.js +2 -4
- package/dist/lib/ui/uikit/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/lib/ui/uikit/dist/index.js +78 -80
- package/dist/lib/ui/uikit/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/lib/model/common/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js +7 -7
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js +9 -9
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js +51 -55
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js +111 -165
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js +1 -1
- package/dist/sdk/model/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/components/PlMultiSequenceAlignment/Legend.vue +4 -3
- package/src/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue +66 -46
- package/src/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue +85 -34
- package/src/components/PlMultiSequenceAlignment/README.md +10 -8
- package/src/components/PlMultiSequenceAlignment/Toolbar.vue +4 -1
- package/src/components/PlMultiSequenceAlignment/chemical-properties.ts +154 -161
- package/src/components/PlMultiSequenceAlignment/data.ts +65 -85
- package/src/components/PlMultiSequenceAlignment/markup.ts +47 -15
- package/src/components/PlMultiSequenceAlignment/types.ts +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js +0 -65
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js +0 -7
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js +0 -24
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js +0 -38
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js +0 -14
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js +0 -11
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js +0 -63
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js +0 -19
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js +0 -6
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js +0 -10
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js +0 -29
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js +0 -50
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js +0 -39
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js +0 -19
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js +0 -19
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js +0 -15
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js +0 -16
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js +0 -17
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js +0 -13
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js +0 -66
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js +0 -12
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js +0 -14
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js +0 -22
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js +0 -14
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js +0 -86
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js +0 -15
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js +0 -19
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js +0 -9
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js +0 -46
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js +0 -24
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js +0 -19
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js +0 -24
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js +0 -20
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js +0 -57
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js.map +0 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js +0 -44
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chemical-properties.js","sources":["../../../src/components/PlMultiSequenceAlignment/chemical-properties.ts"],"sourcesContent":["import type { ColorMap, ResidueCounts } from './types';\n\nexport const chemicalPropertiesColorMap: ColorMap = {\n hydrophobic: {\n label: 'Hydrophobic',\n color: '#99CCFF',\n },\n positiveCharge: {\n label: 'Positive Charged',\n color: '#FFA2A3',\n },\n negativeCharge: {\n label: 'Negative Charged',\n color: '#C1ADFF',\n },\n polar: {\n label: 'Polar',\n color: '#99E099',\n },\n cysteine: {\n label: 'Cysteines',\n color: '#FAAAFA',\n },\n glycine: {\n label: 'Glycines',\n color: '#F7BC5D',\n },\n proline: {\n label: 'Prolines',\n color: '#FFFF8F',\n },\n aromatic: {\n label: 'Aromatic',\n color: '#A2F5FA',\n },\n};\n\nexport type ChemicalCategory = keyof typeof chemicalPropertiesColorMap;\n\nexport function colorizeSequencesByChemicalProperties(\n { sequences, residueCounts, colorMap }: {\n sequences: string[];\n residueCounts: ResidueCounts;\n colorMap: ColorMap;\n },\n): Promise<Blob> {\n const canvas = new OffscreenCanvas(\n sequences[0]?.length ?? 0,\n sequences.length,\n );\n const context = canvas.getContext('2d')!;\n const chemicalProperties = getAlignmentChemicalProperties({\n residueCounts,\n rowCount: sequences.length,\n });\n for (const [rowIndex, sequence] of sequences.entries()) {\n for (const [columnIndex, residue] of sequence.split('').entries()) {\n const category = chemicalProperties\n .at(columnIndex)\n ?.find(({ residues }) => residues.includes(residue))\n ?.category;\n if (!category) continue;\n const color = colorMap[category]?.color;\n if (!color) continue;\n context.fillStyle = colorMap[category].color;\n context.fillRect(columnIndex, rowIndex, 1, 1);\n }\n }\n return canvas.convertToBlob();\n}\n\nconst getAlignmentChemicalProperties = (\n { residueCounts, rowCount }: {\n residueCounts: ResidueCounts;\n rowCount: number;\n },\n): ColumnChemicalProperties[] =>\n // for every column in a residue counts table\n // (e.g. table = [{ A: 3, R: 5, Q: 1}, { E: 4, T: 2 }, ...])\n residueCounts.map((column) => (\n // find all matching criterion\n categoryCriterion\n .filter(({ rules }) =>\n // by matching at least one rule\n rules.some(({ groups, threshold }) =>\n // where at least one residue group\n groups.some((group) => {\n // combined\n const groupCount = group.split('').reduce(\n (acc, residue) => acc + (column[residue] ?? 0),\n 0,\n );\n // is above the required threshold\n return groupCount > rowCount * threshold;\n }),\n ),\n )\n .map(({ residues, category }) => ({ residues, category }))\n ));\n\ntype ColumnChemicalProperties = {\n residues: string;\n category: ChemicalCategory;\n}[];\n\n/** @see {@link https://www.jalview.org/help/html/colourSchemes/clustal.html} */\nconst categoryCriterion: Criteria[] = [\n {\n residues: 'ACILMFWV',\n category: 'hydrophobic',\n rules: [\n { groups: ['WLVIMAFCYHP'], threshold: 0.6 },\n ],\n },\n {\n residues: 'KR',\n category: 'positiveCharge',\n rules: [\n { groups: ['KR'], threshold: 0.6 },\n { groups: [...'KRQ'], threshold: 0.8 },\n ],\n },\n {\n residues: 'E',\n category: 'negativeCharge',\n rules: [\n { groups: ['KR'], threshold: 0.6 },\n { groups: ['QE'], threshold: 0.5 },\n { groups: ['ED'], threshold: 0.5 },\n { groups: [...'EQD'], threshold: 0.85 },\n ],\n },\n {\n residues: 'D',\n category: 'negativeCharge',\n rules: [\n { groups: ['KR'], threshold: 0.6 },\n { groups: [...'DEN'], threshold: 0.85 },\n { groups: ['ED'], threshold: 0.5 },\n ],\n },\n {\n residues: 'N',\n category: 'polar',\n rules: [\n { groups: ['N'], threshold: 0.5 },\n { groups: [...'ND'], threshold: 0.85 },\n ],\n },\n {\n residues: 'Q',\n category: 'polar',\n rules: [\n { groups: ['KR'], threshold: 0.6 },\n { groups: ['QE'], threshold: 0.5 },\n { groups: [...'QTKR'], threshold: 0.85 },\n ],\n },\n {\n residues: 'ST',\n category: 'polar',\n rules: [\n { groups: ['WLVIMAFCYHP'], threshold: 0.6 },\n { groups: ['TS'], threshold: 0.5 },\n { groups: [...'ST'], threshold: 0.85 },\n ],\n },\n {\n residues: 'C',\n category: 'cysteine',\n rules: [\n { groups: ['C'], threshold: 0.85 },\n ],\n },\n {\n residues: 'G',\n category: 'glycine',\n rules: [\n { groups: ['G'], threshold: 0 },\n ],\n },\n {\n residues: 'P',\n category: 'proline',\n rules: [\n { groups: ['P'], threshold: 0 },\n ],\n },\n {\n residues: 'HY',\n category: 'aromatic',\n rules: [\n { groups: ['WLVIMAFCYHP'], threshold: 0.6 },\n { groups: [...'WYACPQFHILMV'], threshold: 0.85 },\n ],\n },\n];\n\ntype Criteria = {\n residues: string;\n category: ChemicalCategory;\n rules: {\n groups: string[];\n threshold: number;\n }[];\n};\n"],"names":["chemicalPropertiesColorMap","colorizeSequencesByChemicalProperties","sequences","residueCounts","colorMap","_a","_b","_c","_d","canvas","context","chemicalProperties","getAlignmentChemicalProperties","rowIndex","sequence","columnIndex","residue","category","residues","rowCount","column","categoryCriterion","rules","groups","threshold","group","acc"],"mappings":"AAEO,MAAMA,IAAuC;AAAA,EAClD,aAAa;AAAA,IACX,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX;AAIO,SAASC,EACd,EAAE,WAAAC,GAAW,eAAAC,GAAe,UAAAC,KAKb;AA3CV,MAAAC,GAAAC,GAAAC,GAAAC;AA4CL,QAAMC,IAAS,IAAI;AAAA,MACjBJ,IAAAH,EAAU,CAAC,MAAX,gBAAAG,EAAc,WAAU;AAAA,IACxBH,EAAU;AAAA,EACZ,GACMQ,IAAUD,EAAO,WAAW,IAAI,GAChCE,IAAqBC,EAA+B;AAAA,IACxD,eAAAT;AAAA,IACA,UAAUD,EAAU;AAAA,EAAA,CACrB;AACD,aAAW,CAACW,GAAUC,CAAQ,KAAKZ,EAAU;AAChC,eAAA,CAACa,GAAaC,CAAO,KAAKF,EAAS,MAAM,EAAE,EAAE,WAAW;AACjE,YAAMG,KAAWV,KAAAD,IAAAK,EACd,GAAGI,CAAW,MADA,gBAAAT,EAEb,KAAK,CAAC,EAAE,UAAAY,EAAe,MAAAA,EAAS,SAASF,CAAO,OAFnC,gBAAAT,EAGb;AAGJ,MAFI,CAACU,KAED,GADUT,IAAAJ,EAASa,CAAQ,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AAW,KAAK;AAAA,IAAA;AAAA,EAErC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,MACL,EAAE,QAAQ,CAAC,GAAG,GAAG,WAAW,EAAE;AAAA,IAAA;AAAA,EAElC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,MACL,EAAE,QAAQ,CAAC,GAAG,GAAG,WAAW,EAAE;AAAA,IAAA;AAAA,EAElC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,MACL,EAAE,QAAQ,CAAC,aAAa,GAAG,WAAW,IAAI;AAAA,MAC1C,EAAE,QAAQ,CAAC,GAAG,cAAc,GAAG,WAAW,KAAK;AAAA,IAAA;AAAA,EACjD;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"chemical-properties.js","sources":["../../../src/components/PlMultiSequenceAlignment/chemical-properties.ts"],"sourcesContent":["import type { HighlightLegend, ResidueCounts } from './types';\n\nexport function highlightByChemicalProperties(\n { sequences, residueCounts }: {\n sequences: string[];\n residueCounts: ResidueCounts;\n },\n): { blob: Blob; legend: HighlightLegend } {\n const lines: {\n category: ChemicalCategory;\n column: number;\n start: number;\n length: number;\n }[] = [];\n const chemicalProperties = getAlignmentChemicalProperties({\n residueCounts,\n rowCount: sequences.length,\n });\n const width = sequences.at(0)?.length ?? 0;\n const height = sequences.length;\n for (let column = 0; column < width; column += 1) {\n for (let row = 0; row < height; row += 1) {\n const residue = sequences[row][column];\n const category = chemicalProperties\n .at(column)\n ?.find(({ residues }) => residues.includes(residue))\n ?.category;\n if (!category) continue;\n const lastLine = lines.at(-1);\n if (\n lastLine\n && lastLine.category === category\n && lastLine.column === column\n && lastLine.start + lastLine.length === row\n ) {\n lastLine.length += 1;\n } else {\n lines.push({ category, column, start: row, length: 1 });\n }\n }\n }\n const linesByCategory = Map.groupBy(lines, ({ category }) => category);\n const blob = new Blob(\n (function*() {\n const viewBox = `0 0 ${width * 2} ${height}`;\n yield `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${viewBox}\" stroke-width=\"2\" preserveAspectRatio=\"none\">`;\n for (const [category, lines] of linesByCategory) {\n const color = chemicalPropertiesColorScheme[category]?.color;\n if (!color) continue;\n yield `<path stroke=\"${color}\" d=\"`;\n let x = 0, y = 0;\n for (const { column, start, length } of lines) {\n yield `m${column * 2 + 1 - x},${start - y}v${length}`;\n x = column * 2 + 1;\n y = start + length;\n }\n yield '\"/>';\n }\n yield '</svg>';\n })().toArray(),\n { type: 'image/svg+xml' },\n );\n const legend = Object.fromEntries(\n Object.entries(chemicalPropertiesColorScheme)\n .filter(([color]) => linesByCategory.has(color as ChemicalCategory)),\n );\n return { blob, legend };\n}\n\nconst getAlignmentChemicalProperties = (\n { residueCounts, rowCount }: {\n residueCounts: ResidueCounts;\n rowCount: number;\n },\n): ColumnChemicalProperties[] =>\n residueCounts.map((column) => {\n const matchedRules = new Set<string>();\n return categoryCriterion.filter(({ residues, rules }) =>\n residues.split('').some((residue) => residue in column)\n && (!rules || rules.split('').map((ruleName) =>\n [ruleName, ruleDefinitions[ruleName as RuleName]] as const,\n ).some(([ruleName, { residues, threshold }]) => {\n if (matchedRules.has(ruleName)) return true;\n const groupCount = residues.split('')\n .reduce((acc, residue) => acc + (column[residue] ?? 0), 0);\n const matches = groupCount >= rowCount * threshold;\n if (matches) matchedRules.add(ruleName);\n return matches;\n })),\n );\n });\n\ntype ColumnChemicalProperties = {\n residues: string;\n category: ChemicalCategory;\n}[];\n\nconst chemicalPropertiesColorScheme = {\n hydrophobic: {\n label: 'Hydrophobic',\n color: '#99CCFF',\n },\n positiveCharge: {\n label: 'Positive Charged',\n color: '#FFA2A3',\n },\n negativeCharge: {\n label: 'Negative Charged',\n color: '#C1ADFF',\n },\n polar: {\n label: 'Polar',\n color: '#99E099',\n },\n cysteine: {\n label: 'Cysteines',\n color: '#FAAAFA',\n },\n glycine: {\n label: 'Glycines',\n color: '#F7BC5D',\n },\n proline: {\n label: 'Prolines',\n color: '#FFFF8F',\n },\n aromatic: {\n label: 'Aromatic',\n color: '#A2F5FA',\n },\n} satisfies HighlightLegend;\n\nexport type ChemicalCategory = keyof typeof chemicalPropertiesColorScheme;\n\n/*\n * Below taken mostly from\n * https://www.rbvi.ucsf.edu/chimera/1.2065/docs/ContributedSoftware/multalignviewer/colprot.par}\n */\n\nconst ruleDefinitions = {\n '%': { residues: 'WLVIMAFCYHP', threshold: 0.6 },\n '#': { residues: 'WLVIMAFCYHP', threshold: 0.8 },\n '-': { residues: 'ED', threshold: 0.5 },\n '+': { residues: 'KR', threshold: 0.6 },\n 'g': { residues: 'G', threshold: 0.5 },\n 'n': { residues: 'N', threshold: 0.5 },\n 'q': { residues: 'QE', threshold: 0.5 },\n 'p': { residues: 'P', threshold: 0.5 },\n 't': { residues: 'TS', threshold: 0.5 },\n 'A': { residues: 'A', threshold: 0.85 },\n 'C': { residues: 'C', threshold: 0.85 },\n 'D': { residues: 'D', threshold: 0.85 },\n 'E': { residues: 'E', threshold: 0.85 },\n 'F': { residues: 'F', threshold: 0.85 },\n 'G': { residues: 'G', threshold: 0.85 },\n 'H': { residues: 'H', threshold: 0.85 },\n 'I': { residues: 'I', threshold: 0.85 },\n 'K': { residues: 'K', threshold: 0.85 },\n 'L': { residues: 'L', threshold: 0.85 },\n 'M': { residues: 'M', threshold: 0.85 },\n 'N': { residues: 'N', threshold: 0.85 },\n 'P': { residues: 'P', threshold: 0.85 },\n 'Q': { residues: 'Q', threshold: 0.85 },\n 'R': { residues: 'R', threshold: 0.85 },\n 'S': { residues: 'S', threshold: 0.85 },\n 'T': { residues: 'T', threshold: 0.85 },\n 'V': { residues: 'V', threshold: 0.85 },\n 'W': { residues: 'W', threshold: 0.85 },\n 'Y': { residues: 'Y', threshold: 0.85 },\n};\n\ntype RuleName = keyof typeof ruleDefinitions;\n\nconst categoryCriterion: Criteria[] = [\n { residues: 'G', category: 'glycine', rules: '' },\n { residues: 'P', category: 'proline', rules: '' },\n { residues: 'T', category: 'polar', rules: 'tST%#' },\n { residues: 'S', category: 'polar', rules: 'tST#' },\n { residues: 'N', category: 'polar', rules: 'nND' },\n { residues: 'Q', category: 'polar', rules: 'qQE+KR' },\n // criteria below has to go before the other criteria for C,\n // otherwise it will never match\n { residues: 'C', category: 'cysteine', rules: 'C' },\n { residues: 'WLVIMF', category: 'hydrophobic', rules: '%#ACFHILMVWYPp' },\n // below there was an 's' rule too,\n // but no definition of such rule was provided\n { residues: 'A', category: 'hydrophobic', rules: '%#ACFHILMVWYPpTSG' },\n { residues: 'C', category: 'hydrophobic', rules: '%#AFHILMVWYSPp' },\n { residues: 'HY', category: 'aromatic', rules: '%#ACFHILMVWYPp' },\n { residues: 'E', category: 'negativeCharge', rules: '-DEqQ' },\n { residues: 'D', category: 'negativeCharge', rules: '-DEnN' },\n { residues: 'KR', category: 'positiveCharge', rules: '+KRQ' },\n];\n\ntype Criteria = {\n residues: string;\n category: ChemicalCategory;\n rules: string;\n};\n"],"names":["highlightByChemicalProperties","sequences","residueCounts","_a","_b","_c","lines","chemicalProperties","getAlignmentChemicalProperties","width","height","column","row","residue","category","residues","lastLine","linesByCategory","blob","color","chemicalPropertiesColorScheme","x","y","start","length","legend","rowCount","matchedRules","categoryCriterion","rules","ruleName","ruleDefinitions","threshold","matches","acc"],"mappings":"AAEO,SAASA,EACd,EAAE,WAAAC,GAAW,eAAAC,KAI4B;AALpC,MAAAC,GAAAC,GAAAC;AAML,QAAMC,IAKA,CAAC,GACDC,IAAqBC,EAA+B;AAAA,IACxD,eAAAN;AAAA,IACA,UAAUD,EAAU;AAAA,EAAA,CACrB,GACKQ,MAAQN,IAAAF,EAAU,GAAG,CAAC,MAAd,gBAAAE,EAAiB,WAAU,GACnCO,IAAST,EAAU;AACzB,WAASU,IAAS,GAAGA,IAASF,GAAOE,KAAU;AAC7C,aAASC,IAAM,GAAGA,IAAMF,GAAQE,KAAO,GAAG;AACxC,YAA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ption, PlMultiSequenceAlignmentSettings, PlSelectionModel, PObjectId, PTableColumnId } from '@platforma-sdk/model';
|
|
3
|
-
import {
|
|
4
|
-
import { ColorMap, ResidueCounts } from './types';
|
|
3
|
+
import { HighlightLegend, ResidueCounts } from './types';
|
|
5
4
|
export declare const sequenceLimit = 1000;
|
|
6
5
|
export declare const useSequenceColumnsOptions: (paramsGetter: () => {
|
|
7
6
|
pFrame: PFrameHandle | undefined;
|
|
@@ -31,7 +30,6 @@ export declare const useMultipleAlignmentData: (paramsGetter: () => {
|
|
|
31
30
|
pframe: PFrameHandle | undefined;
|
|
32
31
|
sequenceColumnIds: PObjectId[] | undefined;
|
|
33
32
|
labelColumnIds: PTableColumnId[] | undefined;
|
|
34
|
-
markupColumnId: PObjectId | undefined;
|
|
35
33
|
selection: PlSelectionModel | undefined;
|
|
36
34
|
colorScheme: PlMultiSequenceAlignmentColorSchemeOption;
|
|
37
35
|
alignmentParams: PlMultiSequenceAlignmentSettings["alignmentParams"];
|
|
@@ -43,15 +41,11 @@ export declare const useMultipleAlignmentData: (paramsGetter: () => {
|
|
|
43
41
|
type MultipleAlignmentData = {
|
|
44
42
|
sequences: string[];
|
|
45
43
|
sequenceNames: string[];
|
|
46
|
-
|
|
44
|
+
labelRows: string[][];
|
|
47
45
|
residueCounts: ResidueCounts;
|
|
48
|
-
markup?: {
|
|
49
|
-
labels: Record<string, string>;
|
|
50
|
-
data: Markup[];
|
|
51
|
-
};
|
|
52
46
|
highlightImage?: {
|
|
53
47
|
blob: Blob;
|
|
54
|
-
|
|
48
|
+
legend: HighlightLegend;
|
|
55
49
|
};
|
|
56
50
|
exceedsLimit: boolean;
|
|
57
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/components/PlMultiSequenceAlignment/data.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAaL,KAA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S,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,eAAe,CAAC;KACzB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,mBAAmB,CAAC,CAAC,IAAI;IAC5B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,CAAC,EAAE,CAAC;CACf,CAAC"}
|
|
@@ -1,293 +1,279 @@
|
|
|
1
|
-
import { isJsonEqual as
|
|
2
|
-
import { getRawPlatformaInstance as
|
|
3
|
-
import { ref as
|
|
4
|
-
import {
|
|
5
|
-
import { parseMarkup as
|
|
6
|
-
import { multiSequenceAlignment as
|
|
7
|
-
import { getResidueCounts as
|
|
8
|
-
import { ensureError as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
|
|
13
|
-
),
|
|
14
|
-
|
|
15
|
-
),
|
|
16
|
-
|
|
1
|
+
import { isJsonEqual as J } from "../../lib/util/helpers/dist/index.js";
|
|
2
|
+
import { getRawPlatformaInstance as z, isLabelColumn as N, isLinkerColumn as W, createRowSelectionColumn as X } from "../../sdk/model/dist/index.js";
|
|
3
|
+
import { ref as M, watch as G } from "vue";
|
|
4
|
+
import { highlightByChemicalProperties as H } from "./chemical-properties.js";
|
|
5
|
+
import { parseMarkup as K, markupAlignedSequence as Q, highlightByMarkup as Y } from "./markup.js";
|
|
6
|
+
import { multiSequenceAlignment as Z } from "./multi-sequence-alignment.js";
|
|
7
|
+
import { getResidueCounts as nn } from "./residue-counts.js";
|
|
8
|
+
import { ensureError as tn, canonicalizeJson as A, getAxisId as E, parseJson as D, matchAxisId as en, pTableValue as O } from "../../lib/model/common/dist/index.js";
|
|
9
|
+
const S = () => z().pFrameDriver, q = 1e3, gn = C(
|
|
10
|
+
an
|
|
11
|
+
), hn = C(
|
|
12
|
+
on
|
|
13
|
+
), wn = C(
|
|
14
|
+
rn
|
|
15
|
+
), bn = C(
|
|
16
|
+
sn
|
|
17
17
|
);
|
|
18
|
-
async function
|
|
18
|
+
async function an({
|
|
19
19
|
pFrame: c,
|
|
20
|
-
sequenceColumnPredicate:
|
|
20
|
+
sequenceColumnPredicate: e
|
|
21
21
|
}) {
|
|
22
22
|
if (!c) return;
|
|
23
|
-
const
|
|
23
|
+
const t = (await S().listColumns(c)).values().filter((o) => e(o)).map(({ spec: o, columnId: u }) => {
|
|
24
24
|
var m;
|
|
25
25
|
return {
|
|
26
|
-
label: ((m =
|
|
27
|
-
value:
|
|
26
|
+
label: ((m = o.annotations) == null ? void 0 : m["pl7.app/label"]) ?? "Unlabelled column",
|
|
27
|
+
value: u
|
|
28
28
|
};
|
|
29
|
-
}),
|
|
30
|
-
return { options:
|
|
29
|
+
}).toArray(), l = t.map(({ value: o }) => o);
|
|
30
|
+
return { options: t, defaults: l };
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function on({
|
|
33
33
|
pFrame: c,
|
|
34
|
-
sequenceColumnIds:
|
|
34
|
+
sequenceColumnIds: e
|
|
35
35
|
}) {
|
|
36
|
-
var f,
|
|
37
|
-
if (!c || !
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
var f, h, b;
|
|
37
|
+
if (!c || !e) return;
|
|
38
|
+
const y = S(), p = await y.listColumns(c), t = /* @__PURE__ */ new Map(), l = new Map(
|
|
39
|
+
e.values().flatMap((i) => {
|
|
40
|
+
const d = p.find(({ columnId: a }) => a === i);
|
|
41
|
+
if (!d)
|
|
42
|
+
throw new Error(`Couldn't find sequence column (ID: \`${i}\`).`);
|
|
43
|
+
return d.spec.axesSpec.values().map((a) => [A(E(a)), a]);
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
for (const [i, d] of l.entries()) {
|
|
47
|
+
const a = D(i), g = p.find(
|
|
48
|
+
({ spec: v }) => N(v) && en(a, E(v.axesSpec[0]))
|
|
47
49
|
);
|
|
48
|
-
|
|
49
|
-
g ? A({ type: "column", id: g.columnId }) : A({ type: "axis", id:
|
|
50
|
-
((f = g == null ? void 0 : g.spec.annotations) == null ? void 0 : f["pl7.app/label"]) ?? ((
|
|
50
|
+
t.set(
|
|
51
|
+
g ? A({ type: "column", id: g.columnId }) : A({ type: "axis", id: a }),
|
|
52
|
+
((f = g == null ? void 0 : g.spec.annotations) == null ? void 0 : f["pl7.app/label"]) ?? ((h = d.annotations) == null ? void 0 : h["pl7.app/label"]) ?? "Unlabelled axis"
|
|
51
53
|
);
|
|
52
54
|
}
|
|
53
|
-
const { hits:
|
|
55
|
+
const { hits: o } = await y.findColumns(c, {
|
|
54
56
|
columnFilter: {},
|
|
55
|
-
compatibleWith:
|
|
56
|
-
s.keys(),
|
|
57
|
-
(r) => D(r)
|
|
58
|
-
),
|
|
57
|
+
compatibleWith: l.keys().map((i) => D(i)).toArray(),
|
|
59
58
|
strictlyCompatible: !1
|
|
60
59
|
});
|
|
61
|
-
for (const { columnId:
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
((
|
|
60
|
+
for (const { columnId: i, spec: d } of o) {
|
|
61
|
+
const a = A({ type: "column", id: i });
|
|
62
|
+
t.has(a) || t.set(
|
|
63
|
+
a,
|
|
64
|
+
((b = d.annotations) == null ? void 0 : b["pl7.app/label"]) ?? "Unlabelled column"
|
|
66
65
|
);
|
|
67
66
|
}
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}).map(({ value: r }) => r);
|
|
75
|
-
return { options: p, defaults: m };
|
|
67
|
+
const u = t.entries().map(([i, d]) => ({ label: d, value: D(i) })).toArray(), m = u.values().filter(({ value: i }) => {
|
|
68
|
+
if (i.type === "axis") return !0;
|
|
69
|
+
const d = p.find(({ columnId: a }) => a === i.id);
|
|
70
|
+
return d && N(d.spec);
|
|
71
|
+
}).map(({ value: i }) => i).toArray();
|
|
72
|
+
return { options: u, defaults: m };
|
|
76
73
|
}
|
|
77
|
-
async function
|
|
74
|
+
async function rn({
|
|
78
75
|
pFrame: c,
|
|
79
|
-
sequenceColumnIds:
|
|
76
|
+
sequenceColumnIds: e
|
|
80
77
|
}) {
|
|
81
|
-
if (!c || (
|
|
82
|
-
const
|
|
83
|
-
(
|
|
78
|
+
if (!c || (e == null ? void 0 : e.length) !== 1) return;
|
|
79
|
+
const p = await S().listColumns(c), t = p.find(
|
|
80
|
+
(l) => l.columnId === e[0]
|
|
84
81
|
);
|
|
85
|
-
if (!
|
|
82
|
+
if (!t)
|
|
86
83
|
throw new Error(
|
|
87
|
-
`Couldn't find sequence column (ID: \`${
|
|
84
|
+
`Couldn't find sequence column (ID: \`${e[0]}\`).`
|
|
88
85
|
);
|
|
89
|
-
return
|
|
90
|
-
(
|
|
91
|
-
var
|
|
92
|
-
return ((
|
|
86
|
+
return p.values().filter(
|
|
87
|
+
(l) => {
|
|
88
|
+
var o;
|
|
89
|
+
return ((o = l.spec.annotations) == null ? void 0 : o["pl7.app/sequence/isAnnotation"]) === "true" && J(t.spec.axesSpec, l.spec.axesSpec) && Object.entries(t.spec.domain ?? {}).every(([u, m]) => {
|
|
93
90
|
var f;
|
|
94
|
-
return ((f =
|
|
91
|
+
return ((f = l.spec.domain) == null ? void 0 : f[u]) === m;
|
|
95
92
|
});
|
|
96
93
|
}
|
|
97
|
-
).map(({ columnId:
|
|
98
|
-
var
|
|
94
|
+
).map(({ columnId: l, spec: o }) => {
|
|
95
|
+
var u;
|
|
99
96
|
return {
|
|
100
|
-
value:
|
|
101
|
-
label: ((
|
|
97
|
+
value: l,
|
|
98
|
+
label: ((u = o.annotations) == null ? void 0 : u["pl7.app/label"]) ?? "Unlabelled column"
|
|
102
99
|
};
|
|
103
|
-
});
|
|
100
|
+
}).toArray();
|
|
104
101
|
}
|
|
105
|
-
async function
|
|
102
|
+
async function sn({
|
|
106
103
|
pframe: c,
|
|
107
|
-
sequenceColumnIds:
|
|
108
|
-
labelColumnIds:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
alignmentParams: i
|
|
104
|
+
sequenceColumnIds: e,
|
|
105
|
+
labelColumnIds: y,
|
|
106
|
+
selection: p,
|
|
107
|
+
colorScheme: t,
|
|
108
|
+
alignmentParams: l
|
|
113
109
|
}) {
|
|
114
|
-
var $,
|
|
115
|
-
if (!c || !(
|
|
116
|
-
const
|
|
117
|
-
let
|
|
110
|
+
var $, F;
|
|
111
|
+
if (!c || !(e != null && e.length) || !y) return;
|
|
112
|
+
const o = S(), u = await o.listColumns(c), m = u.filter((n) => W(n.spec)), f = X({ selection: p });
|
|
113
|
+
let h = {
|
|
118
114
|
type: "inner",
|
|
119
|
-
entries:
|
|
115
|
+
entries: e.map((n) => ({
|
|
120
116
|
type: "column",
|
|
121
|
-
column:
|
|
117
|
+
column: n
|
|
122
118
|
}))
|
|
123
119
|
};
|
|
124
|
-
|
|
120
|
+
m.length > 0 && (h = {
|
|
125
121
|
type: "outer",
|
|
126
|
-
primary:
|
|
127
|
-
secondary:
|
|
122
|
+
primary: h,
|
|
123
|
+
secondary: m.map(({ columnId: n }) => ({
|
|
128
124
|
type: "column",
|
|
129
|
-
column:
|
|
125
|
+
column: n
|
|
130
126
|
}))
|
|
131
|
-
}),
|
|
127
|
+
}), f && (h = {
|
|
132
128
|
type: "inner",
|
|
133
129
|
entries: [
|
|
134
|
-
|
|
130
|
+
h,
|
|
135
131
|
{
|
|
136
132
|
type: "inlineColumn",
|
|
137
|
-
column:
|
|
133
|
+
column: f
|
|
138
134
|
}
|
|
139
135
|
]
|
|
140
136
|
});
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
new Set(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
137
|
+
const b = y.flatMap((n) => n.type !== "column" ? [] : { type: "column", column: n.id });
|
|
138
|
+
t.type === "markup" && b.push({ type: "column", column: t.columnId });
|
|
139
|
+
const i = Array.from(
|
|
140
|
+
new Set(
|
|
141
|
+
e.values().flatMap((n) => {
|
|
142
|
+
const r = u.find(({ columnId: s }) => s === n);
|
|
143
|
+
if (!r)
|
|
144
|
+
throw new Error(`Couldn't find sequence column (ID: ${n})`);
|
|
145
|
+
return r.spec.axesSpec.map((s) => A(E(s)));
|
|
146
|
+
})
|
|
147
|
+
)
|
|
148
|
+
).sort().map((n) => ({
|
|
149
|
+
column: { type: "axis", id: D(n) },
|
|
152
150
|
ascending: !0,
|
|
153
151
|
naAndAbsentAreLeastValues: !0
|
|
154
|
-
})),
|
|
152
|
+
})), d = {
|
|
155
153
|
src: {
|
|
156
154
|
type: "outer",
|
|
157
|
-
primary:
|
|
158
|
-
secondary:
|
|
155
|
+
primary: h,
|
|
156
|
+
secondary: b
|
|
159
157
|
},
|
|
160
158
|
filters: [],
|
|
161
|
-
sorting:
|
|
162
|
-
},
|
|
159
|
+
sorting: i
|
|
160
|
+
}, a = await o.calculateTableData(
|
|
163
161
|
c,
|
|
164
|
-
JSON.parse(JSON.stringify(
|
|
162
|
+
JSON.parse(JSON.stringify(d)),
|
|
165
163
|
{
|
|
166
164
|
offset: 0,
|
|
167
165
|
// +1 is a hack to check whether the selection is over the limit
|
|
168
|
-
length:
|
|
166
|
+
length: q + 1
|
|
169
167
|
}
|
|
170
168
|
);
|
|
171
|
-
let
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
if (!
|
|
176
|
-
throw new Error(`Couldn't find sequence column (ID: \`${
|
|
177
|
-
return
|
|
178
|
-
}),
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
182
|
-
if (
|
|
183
|
-
return
|
|
169
|
+
let g = (a == null ? void 0 : a[0].data.data.length) ?? 0, v = !1;
|
|
170
|
+
g > q && (g = q, v = !0);
|
|
171
|
+
const L = e.map((n) => {
|
|
172
|
+
const r = a.find(({ spec: s }) => s.id === n);
|
|
173
|
+
if (!r)
|
|
174
|
+
throw new Error(`Couldn't find sequence column (ID: \`${n}\`).`);
|
|
175
|
+
return r;
|
|
176
|
+
}), _ = y.map((n) => {
|
|
177
|
+
const r = a.find(({ spec: s }) => {
|
|
178
|
+
if (n.type === "axis" && s.type === "axis")
|
|
179
|
+
return J(n.id, s.id);
|
|
180
|
+
if (n.type === "column" && s.type === "column")
|
|
181
|
+
return n.id === s.id;
|
|
184
182
|
});
|
|
185
|
-
if (!
|
|
186
|
-
throw new Error(`Couldn't find label column (ID: \`${
|
|
187
|
-
return
|
|
188
|
-
}),
|
|
189
|
-
|
|
190
|
-
(
|
|
183
|
+
if (!r)
|
|
184
|
+
throw new Error(`Couldn't find label column (ID: \`${n}\`).`);
|
|
185
|
+
return r;
|
|
186
|
+
}), j = await Promise.all(
|
|
187
|
+
L.map(
|
|
188
|
+
(n) => Z(
|
|
191
189
|
Array.from(
|
|
192
|
-
{ length:
|
|
193
|
-
(
|
|
194
|
-
var
|
|
195
|
-
return ((
|
|
190
|
+
{ length: g },
|
|
191
|
+
(r, s) => {
|
|
192
|
+
var w;
|
|
193
|
+
return ((w = O(n.data, s, { na: "", absent: "" })) == null ? void 0 : w.toString()) ?? "";
|
|
196
194
|
}
|
|
197
195
|
),
|
|
198
|
-
|
|
196
|
+
l
|
|
199
197
|
)
|
|
200
198
|
)
|
|
201
|
-
),
|
|
202
|
-
{ length:
|
|
203
|
-
(
|
|
204
|
-
),
|
|
205
|
-
(
|
|
206
|
-
var
|
|
207
|
-
return ((
|
|
199
|
+
), P = Array.from(
|
|
200
|
+
{ length: g },
|
|
201
|
+
(n, r) => j.map((s) => s[r])
|
|
202
|
+
), B = L.map(
|
|
203
|
+
(n) => {
|
|
204
|
+
var r;
|
|
205
|
+
return ((r = n.spec.spec.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled column";
|
|
208
206
|
}
|
|
209
|
-
),
|
|
210
|
-
{ length:
|
|
211
|
-
(
|
|
212
|
-
(
|
|
213
|
-
var
|
|
214
|
-
return ((
|
|
207
|
+
), T = Array.from(
|
|
208
|
+
{ length: g },
|
|
209
|
+
(n, r) => _.map(
|
|
210
|
+
(s) => {
|
|
211
|
+
var w;
|
|
212
|
+
return ((w = O(s.data, r, { na: "", absent: "" })) == null ? void 0 : w.toString()) ?? "";
|
|
215
213
|
}
|
|
216
214
|
)
|
|
217
|
-
),
|
|
218
|
-
sequences:
|
|
219
|
-
sequenceNames:
|
|
220
|
-
|
|
221
|
-
exceedsLimit:
|
|
222
|
-
residueCounts:
|
|
215
|
+
), x = P.map((n) => n.join(" ")), R = nn(x), k = {
|
|
216
|
+
sequences: x,
|
|
217
|
+
sequenceNames: B,
|
|
218
|
+
labelRows: T,
|
|
219
|
+
exceedsLimit: v,
|
|
220
|
+
residueCounts: R
|
|
223
221
|
};
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
222
|
+
if (t.type === "chemical-properties")
|
|
223
|
+
k.highlightImage = H({
|
|
224
|
+
sequences: x,
|
|
225
|
+
residueCounts: R
|
|
226
|
+
});
|
|
227
|
+
else if (t.type === "markup") {
|
|
228
|
+
const n = a.find(
|
|
229
|
+
({ spec: w }) => w.id === t.columnId
|
|
230
|
+
);
|
|
231
|
+
if (!n)
|
|
232
|
+
throw new Error(
|
|
233
|
+
`Couldn't find markup column (ID: \`${t.columnId}\`).`
|
|
234
|
+
);
|
|
235
|
+
const r = Array.from(
|
|
236
|
+
{ length: g },
|
|
237
|
+
(w, I) => {
|
|
238
|
+
var U;
|
|
239
|
+
const V = K(
|
|
240
|
+
((U = O(n.data, I, { na: "", absent: "" })) == null ? void 0 : U.toString()) ?? ""
|
|
233
241
|
);
|
|
234
|
-
return
|
|
242
|
+
return Q(P[I][0], V);
|
|
235
243
|
}
|
|
244
|
+
), s = JSON.parse(
|
|
245
|
+
(($ = n.spec.spec.annotations) == null ? void 0 : $["pl7.app/sequence/annotation/mapping"]) ?? "{}"
|
|
236
246
|
);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
blob: await ee({
|
|
243
|
-
sequences: v,
|
|
244
|
-
residueCounts: U,
|
|
245
|
-
colorMap: e
|
|
246
|
-
}),
|
|
247
|
-
colorMap: e
|
|
248
|
-
};
|
|
249
|
-
} else if (s.type === "markup") {
|
|
250
|
-
const e = Object.fromEntries(
|
|
251
|
-
Object.entries(
|
|
252
|
-
((j = S.markup) == null ? void 0 : j.labels) ?? {}
|
|
253
|
-
).map(([n, o], h) => [
|
|
254
|
-
n,
|
|
255
|
-
{ label: o, color: T[h % T.length] }
|
|
256
|
-
])
|
|
257
|
-
);
|
|
258
|
-
S.highlightImage = {
|
|
259
|
-
blob: await oe({
|
|
260
|
-
markupRows: ((N = S.markup) == null ? void 0 : N.data) ?? [],
|
|
261
|
-
colorMap: e,
|
|
262
|
-
columnCount: ((_ = v.at(0)) == null ? void 0 : _.length) ?? 0
|
|
263
|
-
}),
|
|
264
|
-
colorMap: e
|
|
265
|
-
};
|
|
247
|
+
k.highlightImage = Y({
|
|
248
|
+
markupRows: r,
|
|
249
|
+
columnCount: ((F = x.at(0)) == null ? void 0 : F.length) ?? 0,
|
|
250
|
+
labels: s
|
|
251
|
+
});
|
|
266
252
|
}
|
|
267
|
-
return
|
|
253
|
+
return k;
|
|
268
254
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
let
|
|
272
|
-
return (
|
|
273
|
-
if (
|
|
274
|
-
const m =
|
|
255
|
+
function C(c) {
|
|
256
|
+
const e = M(), y = M(!0), p = M();
|
|
257
|
+
let t;
|
|
258
|
+
return (l) => (G(l, async (o, u) => {
|
|
259
|
+
if (J(o, u)) return;
|
|
260
|
+
const m = t = Symbol();
|
|
275
261
|
try {
|
|
276
|
-
|
|
277
|
-
const f = await c(
|
|
278
|
-
m ===
|
|
262
|
+
p.value = void 0, y.value = !0;
|
|
263
|
+
const f = await c(o);
|
|
264
|
+
m === t && (e.value = f);
|
|
279
265
|
} catch (f) {
|
|
280
|
-
console.error(f), m ===
|
|
266
|
+
console.error(f), m === t && (p.value = tn(f));
|
|
281
267
|
} finally {
|
|
282
|
-
m ===
|
|
268
|
+
m === t && (y.value = !1);
|
|
283
269
|
}
|
|
284
|
-
}, { immediate: !0 }), { data:
|
|
270
|
+
}, { immediate: !0 }), { data: e, isLoading: y, error: p });
|
|
285
271
|
}
|
|
286
272
|
export {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
273
|
+
q as sequenceLimit,
|
|
274
|
+
hn as useLabelColumnsOptions,
|
|
275
|
+
wn as useMarkupColumnsOptions,
|
|
276
|
+
bn as useMultipleAlignmentData,
|
|
277
|
+
gn as useSequenceColumnsOptions
|
|
292
278
|
};
|
|
293
279
|
//# sourceMappingURL=data.js.map
|