@teselagen/ove 0.7.1 → 0.7.2

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 (34) hide show
  1. package/DigestTool/DigestTool.d.ts +1 -1
  2. package/Menlo.ttf +0 -0
  3. package/Monaco.ttf +0 -0
  4. package/helperComponents/PropertiesDialog/index.d.ts +2 -7
  5. package/html2canvas.esm--JN4fLQL.mjs +7891 -0
  6. package/html2canvas.esm-B7d7VJmQ.js +7891 -0
  7. package/html2canvas.esm-GLpiTZLt.cjs +7891 -0
  8. package/html2canvas.esm-GLpiTZLt.js +7891 -0
  9. package/html2canvas.esm-nFNn58sx.js +7891 -0
  10. package/html2canvas.esm-nFNn58sx.mjs +7891 -0
  11. package/index.cjs.js +6534 -536
  12. package/index.es.js +6523 -525
  13. package/index.umd.js +6523 -516
  14. package/package.json +2 -2
  15. package/src/AutoAnnotate.js +1 -0
  16. package/src/CircularView/Labels/index.js +1 -15
  17. package/src/CircularView/index.js +3 -4
  18. package/src/CreateAnnotationsPage.js +1 -1
  19. package/src/DigestTool/DigestTool.js +78 -75
  20. package/src/GlobalDialogUtils.js +1 -0
  21. package/src/Reflex/reflex-styles.css +10 -10
  22. package/src/RowItem/CutsiteSelectionLayers.js +1 -1
  23. package/src/RowItem/SelectionLayer/index.js +2 -2
  24. package/src/RowItem/Sequence.js +0 -1
  25. package/src/RowItem/Translations/Translation.js +1 -0
  26. package/src/RowItem/index.js +0 -1
  27. package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +126 -135
  28. package/src/helperComponents/PropertiesDialog/SingleEnzymeCutsiteInfo.js +59 -51
  29. package/src/helperComponents/PropertiesDialog/index.js +115 -114
  30. package/src/helperComponents/RemoveDuplicates/index.js +144 -160
  31. package/src/utils/useFormValue.js +7 -0
  32. package/src/withEditorInteractions/index.js +8 -7
  33. package/style.css +39 -15
  34. package/utils/useFormValue.d.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@teselagen/sequence-utils": "0.3.27",
14
14
  "@teselagen/range-utils": "0.3.7",
15
- "@teselagen/ui": "0.7.1",
15
+ "@teselagen/ui": "0.7.6",
16
16
  "@teselagen/file-utils": "0.3.16",
17
17
  "@teselagen/bounce-loader": "0.3.11",
18
18
  "@teselagen/bio-parsers": "0.4.22",
@@ -257,6 +257,7 @@ FRT GAAGTTCCTATTCTCTAGAAAGTATAGGAACTTC misc_recomb orchid pink 0 0`,
257
257
  <div>
258
258
  <DataTable
259
259
  isInfinite
260
+ formName={"customAnnsTable"}
260
261
  schema={
261
262
  annotationType === "feature"
262
263
  ? customAnnsSchema
@@ -416,23 +416,9 @@ function LabelLine(pointArray, options) {
416
416
  });
417
417
  return (
418
418
  <React.Fragment key="labelLine">
419
- {/* <polyline
420
- {...{
421
- key: "polyline-short",
422
- points,
423
- stroke: "black",
424
- fill: "none",
425
- strokeWidth: 1,
426
- // style: {
427
- // opacity: 0.2
428
- // },
429
- className: "veLabelLine",
430
- ...options
431
- }}
432
- /> */}
433
419
  <polyline
420
+ key="polyline-long"
434
421
  {...{
435
- key: "polyline-long",
436
422
  points,
437
423
  stroke: "black",
438
424
  fill: "none",
@@ -597,12 +597,11 @@ export function CircularView(props) {
597
597
  ) {
598
598
  return (
599
599
  <SelectionLayer
600
- key={index}
600
+ key={"veCircularViewSelectionLayer" + index}
601
601
  {...{
602
602
  index,
603
603
  isDraggable: true,
604
604
  isProtein,
605
- key: "veCircularViewSelectionLayer" + index,
606
605
  selectionLayer,
607
606
  onRightClicked: selectionLayer.isSearchLayer
608
607
  ? searchLayerRightClicked
@@ -635,13 +634,13 @@ export function CircularView(props) {
635
634
  //only render if there is no selection layer
636
635
  return (
637
636
  <Caret
637
+ key="veCircularViewCaret"
638
638
  {...{
639
639
  caretPosition,
640
640
  sequenceLength,
641
641
  isProtein,
642
642
  innerRadius,
643
- outerRadius: radius,
644
- key: "veCircularViewCaret"
643
+ outerRadius: radius
645
644
  }}
646
645
  />
647
646
  );
@@ -48,7 +48,7 @@ export default compose(
48
48
  }))}
49
49
  withCheckboxes
50
50
  schema={annotationType === "feature" ? schemaFeatures : schemaOther}
51
- ></DataTable>
51
+ />
52
52
  </div>
53
53
  <DialogFooter
54
54
  hideModal={hideDialog}
@@ -1,13 +1,8 @@
1
- // import uniqid from "shortid";
2
- // import Ladder from "./Ladder";
3
- import { compose, withProps } from "recompose";
4
- // import selectionLayer from "../redux/selectionLayer";
5
- import React, { useState } from "react";
6
- import { DataTable } from "@teselagen/ui";
1
+ import React, { useMemo, useState } from "react";
2
+ import { DataTable, useStableReference } from "@teselagen/ui";
7
3
  import { getCutsiteType, getVirtualDigest } from "@teselagen/sequence-utils";
8
4
  import CutsiteFilter from "../CutsiteFilter";
9
5
  import Ladder from "./Ladder";
10
- // import getCutsiteType from "./getCutsiteType";
11
6
  import {
12
7
  Tabs,
13
8
  Tab,
@@ -22,23 +17,91 @@ import { pick } from "lodash-es";
22
17
 
23
18
  const MAX_DIGEST_CUTSITES = 50;
24
19
  const MAX_PARTIAL_DIGEST_CUTSITES = 10;
20
+ const onSingleSelectRow = ({ onFragmentSelect }) => {
21
+ onFragmentSelect();
22
+ };
25
23
 
26
24
  export const DigestTool = props => {
27
25
  const [selectedTab, setSelectedTab] = useState("virtualDigest");
28
26
  const {
29
27
  editorName,
30
- // height = 100,
31
28
  dimensions = {},
32
- lanes,
33
29
  digestTool: { selectedFragment, computePartialDigest },
34
30
  onDigestSave,
35
- computePartialDigestDisabled,
36
- computeDigestDisabled,
37
31
  updateComputePartialDigest,
38
32
  boxHeight,
39
33
  digestLaneRightClicked,
40
- ladders
34
+ ladders,
35
+ sequenceData,
36
+ sequenceLength,
37
+ selectionLayerUpdate: _selectionLayerUpdate,
38
+ updateSelectedFragment
41
39
  } = props;
40
+
41
+ const isCircular = sequenceData.circular;
42
+ const cutsites = sequenceData.cutsites;
43
+ const computePartialDigestDisabled =
44
+ cutsites.length > MAX_PARTIAL_DIGEST_CUTSITES;
45
+ const computeDigestDisabled = cutsites.length > MAX_DIGEST_CUTSITES;
46
+ // The selection layer update function is memoized to prevent re-renders
47
+ // It changes triggered by the DataTables below
48
+ const selectionLayerUpdate = useStableReference(_selectionLayerUpdate);
49
+
50
+ // This useMemo might not be necessary once if we figure out
51
+ // why the DataTables below triggers a re-render outside of them.
52
+ const lanes = useMemo(() => {
53
+ const { fragments } = getVirtualDigest({
54
+ cutsites,
55
+ sequenceLength,
56
+ isCircular,
57
+ computePartialDigest,
58
+ computePartialDigestDisabled,
59
+ computeDigestDisabled
60
+ });
61
+ const _lanes = [
62
+ fragments.map(f => ({
63
+ ...f,
64
+ onFragmentSelect: () => {
65
+ selectionLayerUpdate.current({
66
+ start: f.start,
67
+ end: f.end,
68
+ name: f.name
69
+ });
70
+ updateSelectedFragment(f.Intentid);
71
+ }
72
+ }))
73
+ ];
74
+ return _lanes;
75
+ }, [
76
+ computeDigestDisabled,
77
+ computePartialDigest,
78
+ computePartialDigestDisabled,
79
+ cutsites,
80
+ isCircular,
81
+ selectionLayerUpdate,
82
+ sequenceLength,
83
+ updateSelectedFragment
84
+ ]);
85
+
86
+ // Same comment as above
87
+ const digestInfoLanes = useMemo(
88
+ () =>
89
+ lanes[0].map(({ id, cut1, cut2, start, end, size, ...rest }) => {
90
+ return {
91
+ ...rest,
92
+ id,
93
+ start,
94
+ end,
95
+ length: size,
96
+ leftCutter: cut1.restrictionEnzyme.name,
97
+ rightCutter: cut2.restrictionEnzyme.name,
98
+ leftOverhang: getCutsiteType(cut1.restrictionEnzyme),
99
+ rightOverhang: getCutsiteType(cut2.restrictionEnzyme)
100
+ };
101
+ }),
102
+ [lanes]
103
+ );
104
+
42
105
  return (
43
106
  <div
44
107
  style={{
@@ -137,25 +200,9 @@ export const DigestTool = props => {
137
200
  maxHeight={400}
138
201
  // noFooter
139
202
  withSearch={false}
140
- onSingleRowSelect={({ onFragmentSelect }) => {
141
- onFragmentSelect();
142
- }}
203
+ onSingleRowSelect={onSingleSelectRow}
143
204
  formName="digestInfoTable"
144
- entities={lanes[0].map(
145
- ({ id, cut1, cut2, start, end, size, ...rest }) => {
146
- return {
147
- ...rest,
148
- id,
149
- start,
150
- end,
151
- length: size,
152
- leftCutter: cut1.restrictionEnzyme.name,
153
- rightCutter: cut2.restrictionEnzyme.name,
154
- leftOverhang: getCutsiteType(cut1.restrictionEnzyme),
155
- rightOverhang: getCutsiteType(cut2.restrictionEnzyme)
156
- };
157
- }
158
- )}
205
+ entities={digestInfoLanes}
159
206
  schema={schema}
160
207
  />
161
208
  }
@@ -178,48 +225,4 @@ const schema = {
178
225
  ]
179
226
  };
180
227
 
181
- export default compose(
182
- withEditorInteractions,
183
- withProps(
184
- ({
185
- sequenceData,
186
- sequenceLength,
187
- selectionLayerUpdate,
188
- updateSelectedFragment,
189
- digestTool: { computePartialDigest }
190
- }) => {
191
- const isCircular = sequenceData.circular;
192
- const cutsites = sequenceData.cutsites;
193
- const computePartialDigestDisabled =
194
- cutsites.length > MAX_PARTIAL_DIGEST_CUTSITES;
195
- const computeDigestDisabled = cutsites.length > MAX_DIGEST_CUTSITES;
196
-
197
- const { fragments, overlappingEnzymes } = getVirtualDigest({
198
- cutsites,
199
- sequenceLength,
200
- isCircular,
201
- computePartialDigest,
202
- computePartialDigestDisabled,
203
- computeDigestDisabled
204
- });
205
- return {
206
- computePartialDigestDisabled,
207
- computeDigestDisabled,
208
- lanes: [
209
- fragments.map(f => ({
210
- ...f,
211
- onFragmentSelect: () => {
212
- selectionLayerUpdate({
213
- start: f.start,
214
- end: f.end,
215
- name: f.name
216
- });
217
- updateSelectedFragment(f.Intentid);
218
- }
219
- }))
220
- ],
221
- overlappingEnzymes
222
- };
223
- }
224
- )
225
- )(DigestTool);
228
+ export default withEditorInteractions(DigestTool);
@@ -43,6 +43,7 @@ export function hideDialog() {
43
43
  delete dialogHolder.CustomModalComponent;
44
44
  delete dialogHolder.props;
45
45
  delete dialogHolder.overrideName;
46
+ delete dialogHolder.editorName;
46
47
  dialogHolder.setUniqKeyToForceRerender();
47
48
  }
48
49
 
@@ -34,19 +34,19 @@
34
34
  }
35
35
 
36
36
  .reflex-layout > .reflex-splitter {
37
- background-color: #f5f8fa;
37
+ background-color: #f1f1f1;
38
38
  z-index: 100;
39
39
  }
40
40
 
41
41
  .reflex-layout > .reflex-splitter.active,
42
42
  .reflex-layout > .reflex-splitter:hover {
43
- background-color: #f5f8fa;
43
+ background-color: #cccccc;
44
44
  transition: all 1s ease;
45
45
  }
46
46
 
47
47
  .reflex-layout.horizontal > .reflex-splitter {
48
- border-bottom: 1px solid #f5f8fa;
49
- border-top: 1px solid #f5f8fa;
48
+ border-bottom: 1px solid #f1f1f1;
49
+ border-top: 1px solid #f1f1f1;
50
50
  cursor: row-resize;
51
51
  width: 100%;
52
52
  height: 2px;
@@ -54,13 +54,13 @@
54
54
 
55
55
  .reflex-layout.horizontal > .reflex-splitter:hover,
56
56
  .reflex-layout.horizontal > .reflex-splitter.active {
57
- border-bottom: 1px solid #f5f8fa;
58
- border-top: 1px solid #f5f8fa;
57
+ border-bottom: 1px solid #cccccc;
58
+ border-top: 1px solid #cccccc;
59
59
  }
60
60
 
61
61
  .reflex-layout.vertical > .reflex-splitter {
62
- border-right: 1px solid #f5f8fa;
63
- border-left: 1px solid #f5f8fa;
62
+ border-right: 1px solid #f1f1f1;
63
+ border-left: 1px solid #f1f1f1;
64
64
  cursor: col-resize;
65
65
  height: 95%;
66
66
  width: 2px;
@@ -73,8 +73,8 @@
73
73
 
74
74
  .reflex-layout.vertical > .reflex-splitter:hover,
75
75
  .reflex-layout.vertical > .reflex-splitter.active {
76
- border-right: 1px solid #f5f8fa;
77
- border-left: 1px solid #f5f8fa;
76
+ border-right: 1px solid #cccccc;
77
+ border-left: 1px solid #cccccc;
78
78
  }
79
79
 
80
80
  .reflex-layout > .reflex-splitter.reflex-thin {
@@ -26,10 +26,10 @@ export const CutsiteSelectionLayers = connectToEditor(
26
26
  layer.start > -1 && (
27
27
  <SelectionLayer
28
28
  hideTitle
29
+ key={"restrictionSiteRange" + index}
29
30
  {...annotationCommonProps}
30
31
  {...{
31
32
  id: cutsite.id,
32
- key: "restrictionSiteRange" + index,
33
33
  height: showReverseSequence ? sequenceHeight * 2 : sequenceHeight,
34
34
  regions: [layer],
35
35
  row: alignmentData
@@ -105,6 +105,7 @@ function SelectionLayer(props) {
105
105
  caretSvgs = [
106
106
  overlap.start === start && (
107
107
  <Caret
108
+ key={key + "caret1"}
108
109
  {...{
109
110
  leftMargin,
110
111
  onClick: _onClick || preventDefaultStopPropagation,
@@ -115,7 +116,6 @@ function SelectionLayer(props) {
115
116
  getGaps,
116
117
  isDraggable,
117
118
  ignoreGaps,
118
- key: key + "caret1",
119
119
  sequenceLength,
120
120
  className:
121
121
  classNameToPass +
@@ -127,6 +127,7 @@ function SelectionLayer(props) {
127
127
  ),
128
128
  overlap.end === end && (
129
129
  <Caret
130
+ key={key + "caret2"}
130
131
  {...{
131
132
  leftMargin,
132
133
  onClick: _onClick || preventDefaultStopPropagation,
@@ -137,7 +138,6 @@ function SelectionLayer(props) {
137
138
  getGaps,
138
139
  style: selectionLayer.style,
139
140
  ignoreGaps,
140
- key: key + "caret2",
141
141
  sequenceLength,
142
142
  className:
143
143
  classNameToPass +
@@ -175,7 +175,6 @@ class Sequence extends React.Component {
175
175
  width,
176
176
  position: "absolute"
177
177
  }}
178
- ref="rowViewTextContainer"
179
178
  className="rowViewTextContainer"
180
179
  height={Math.max(0, Number(height))}
181
180
  >
@@ -69,6 +69,7 @@ class Translation extends React.Component {
69
69
  nextAaSliver = aminoAcidsForSubrange[index + 2];
70
70
  return (
71
71
  <rect
72
+ key={annotation.id + aminoAcidSliver.sequenceIndex}
72
73
  x={index * charWidth}
73
74
  y={height / 2 - height / 16}
74
75
  width={charWidth}
@@ -561,7 +561,6 @@ export default function RowItem(props) {
561
561
  height: sequenceHeight,
562
562
  position: "absolute"
563
563
  }}
564
- ref="rowViewTextContainer"
565
564
  onClick={function (event) {
566
565
  replacementLayerClicked({
567
566
  annotation: replacementLayer,