@teselagen/ove 0.8.21 → 0.8.24
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/index.cjs.js +268 -210
- package/index.es.js +268 -210
- package/index.umd.js +268 -210
- package/package.json +3 -3
- package/selectors/orfsSelector.d.ts +1 -1
- package/selectors/searchLayersSelector.d.ts +1 -1
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +224 -210
- package/src/redux/temporaryAnnotations.js +1 -1
- package/src/selectors/orfsSelector.js +1 -0
- package/src/selectors/searchLayersSelector.js +25 -16
- package/src/utils/pureNoFunc.js +0 -18
- package/utils/pureNoFunc.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.24",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"@teselagen/file-utils": "0.3.20",
|
|
19
19
|
"@teselagen/range-utils": "0.3.13",
|
|
20
20
|
"@teselagen/react-list": "0.8.18",
|
|
21
|
-
"@teselagen/sequence-utils": "0.3.
|
|
22
|
-
"@teselagen/ui": "0.10.
|
|
21
|
+
"@teselagen/sequence-utils": "0.3.37",
|
|
22
|
+
"@teselagen/ui": "0.10.15",
|
|
23
23
|
"@use-gesture/react": "10.3.0",
|
|
24
24
|
"biomsa": "^0.2.4",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
@@ -8,7 +8,7 @@ declare const _default: ((state: any) => {
|
|
|
8
8
|
annotationTypePlural: string;
|
|
9
9
|
isOrf: boolean;
|
|
10
10
|
id: any;
|
|
11
|
-
}[]) & import('reselect').OutputSelectorFields<(args_0: any, args_1: any, args_2: any, args_3: any) => {
|
|
11
|
+
}[]) & import('reselect').OutputSelectorFields<(args_0: any, args_1: any, args_2: any, args_3: any, args_4: any) => {
|
|
12
12
|
start: number;
|
|
13
13
|
end: number;
|
|
14
14
|
length: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: ((state: any) => any[]) & import('reselect').OutputSelectorFields<(
|
|
1
|
+
declare const _default: ((state: any, ...params: any[]) => any[]) & import('reselect').OutputSelectorFields<(...args: readonly unknown[]) => any[], {
|
|
2
2
|
clearCache: () => void;
|
|
3
3
|
}> & {
|
|
4
4
|
clearCache: () => void;
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
DropdownButton,
|
|
9
9
|
createCommandMenu,
|
|
10
10
|
popoverOverflowModifiers,
|
|
11
|
-
removeDuplicatesIcon
|
|
11
|
+
removeDuplicatesIcon,
|
|
12
|
+
useMemoDeepEqual
|
|
12
13
|
} from "@teselagen/ui";
|
|
13
14
|
import { map, upperFirst, pick, startCase, isFunction } from "lodash-es";
|
|
14
15
|
import {
|
|
@@ -41,69 +42,79 @@ const genericAnnotationProperties = ({
|
|
|
41
42
|
additionalFooterEls
|
|
42
43
|
}) => {
|
|
43
44
|
const annotationTypeUpper = upperFirst(annotationType);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const {
|
|
62
|
-
readOnly,
|
|
63
|
-
annotations = {},
|
|
64
|
-
annotationVisibility,
|
|
65
|
-
sequenceLength,
|
|
66
|
-
selectionLayer,
|
|
67
|
-
sequence,
|
|
68
|
-
isProtein,
|
|
69
|
-
allPartTags,
|
|
70
|
-
annotationPropertiesSelectedEntities:
|
|
71
|
-
_annotationPropertiesSelectedEntities,
|
|
72
|
-
selectedAnnotationId,
|
|
73
|
-
PropertiesProps
|
|
74
|
-
} = this.props;
|
|
75
|
-
const annotationPropertiesSelectedEntities =
|
|
76
|
-
_annotationPropertiesSelectedEntities.filter(a => annotations[a.id]);
|
|
45
|
+
const AnnotationProperties = props => {
|
|
46
|
+
const {
|
|
47
|
+
readOnly,
|
|
48
|
+
annotations = {},
|
|
49
|
+
annotationVisibility,
|
|
50
|
+
sequenceLength,
|
|
51
|
+
selectionLayer,
|
|
52
|
+
sequence,
|
|
53
|
+
isProtein,
|
|
54
|
+
allPartTags,
|
|
55
|
+
annotationPropertiesSelectedEntities:
|
|
56
|
+
_annotationPropertiesSelectedEntities,
|
|
57
|
+
selectedAnnotationId,
|
|
58
|
+
PropertiesProps,
|
|
59
|
+
dispatch,
|
|
60
|
+
editorName
|
|
61
|
+
} = props;
|
|
77
62
|
|
|
78
|
-
|
|
63
|
+
// We need to keep a ref to the props so that the commands factory (old code) works
|
|
64
|
+
const instanceRef = React.useRef({ props });
|
|
65
|
+
instanceRef.current.props = props;
|
|
66
|
+
const cmds = React.useMemo(() => commands(instanceRef.current), []);
|
|
79
67
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
const onRowSelect = React.useCallback(
|
|
69
|
+
([record]) => {
|
|
70
|
+
if (!record) return;
|
|
71
|
+
dispatch({
|
|
72
|
+
type: "SELECTION_LAYER_UPDATE",
|
|
73
|
+
payload: record,
|
|
74
|
+
meta: {
|
|
75
|
+
editorName
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
[dispatch, editorName]
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const annotationPropertiesSelectedEntities =
|
|
83
|
+
_annotationPropertiesSelectedEntities.filter(a => annotations[a.id]);
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
const additionalColumns =
|
|
92
|
-
PropertiesProps?.propertiesList?.find(
|
|
93
|
-
p => (p.name || p) === (pluralize(annotationType) || "")
|
|
94
|
-
)?.additionalColumns || [];
|
|
85
|
+
const deleteAnnotation = props[`delete${annotationTypeUpper}`];
|
|
95
86
|
|
|
96
|
-
|
|
87
|
+
const annotationsToUse = React.useMemo(
|
|
88
|
+
() =>
|
|
89
|
+
map(annotations, annotation => {
|
|
90
|
+
return {
|
|
91
|
+
...annotation,
|
|
92
|
+
...(annotation.strand === undefined && {
|
|
93
|
+
strand: annotation.forward ? 1 : -1
|
|
94
|
+
}),
|
|
95
|
+
size: getRangeLength(annotation, sequenceLength)
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
98
|
+
[annotations, sequenceLength]
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const keyedPartTags = getKeyedTagsAndTagOptions(allPartTags) ?? {};
|
|
102
|
+
const additionalColumns =
|
|
103
|
+
PropertiesProps?.propertiesList?.find(
|
|
104
|
+
p => (p.name || p) === (pluralize(annotationType) || "")
|
|
105
|
+
)?.additionalColumns || [];
|
|
106
|
+
|
|
107
|
+
const schema = useMemoDeepEqual(
|
|
108
|
+
() => ({
|
|
97
109
|
fields: [
|
|
98
110
|
{
|
|
99
111
|
path: "name",
|
|
100
112
|
type: "string",
|
|
101
|
-
|
|
102
113
|
render: (name, ann) => {
|
|
103
114
|
const checked =
|
|
104
|
-
!
|
|
105
|
-
|
|
106
|
-
]
|
|
115
|
+
!annotationVisibility[`${annotationType}IndividualToHide`][
|
|
116
|
+
ann.id
|
|
117
|
+
];
|
|
107
118
|
|
|
108
119
|
return (
|
|
109
120
|
<>
|
|
@@ -113,9 +124,9 @@ const genericAnnotationProperties = ({
|
|
|
113
124
|
e.stopPropagation();
|
|
114
125
|
const upperType = startCase(annotationType);
|
|
115
126
|
if (checked) {
|
|
116
|
-
|
|
127
|
+
props[`hide${upperType}Individual`]([ann.id]);
|
|
117
128
|
} else {
|
|
118
|
-
|
|
129
|
+
props[`show${upperType}Individual`]([ann.id]);
|
|
119
130
|
}
|
|
120
131
|
}}
|
|
121
132
|
style={{
|
|
@@ -131,7 +142,6 @@ const genericAnnotationProperties = ({
|
|
|
131
142
|
);
|
|
132
143
|
}
|
|
133
144
|
},
|
|
134
|
-
|
|
135
145
|
...(!withBases
|
|
136
146
|
? []
|
|
137
147
|
: [
|
|
@@ -141,7 +151,7 @@ const genericAnnotationProperties = ({
|
|
|
141
151
|
render: (bases, primer) => {
|
|
142
152
|
let bps = bases;
|
|
143
153
|
if (!bases) {
|
|
144
|
-
bps = getSequenceWithinRange(primer,
|
|
154
|
+
bps = getSequenceWithinRange(primer, sequence);
|
|
145
155
|
if (!primer.forward) {
|
|
146
156
|
bps = getReverseComplementSequenceString(bps);
|
|
147
157
|
}
|
|
@@ -170,8 +180,8 @@ const genericAnnotationProperties = ({
|
|
|
170
180
|
}
|
|
171
181
|
}
|
|
172
182
|
]),
|
|
173
|
-
sizeSchema(
|
|
174
|
-
...(withTags &&
|
|
183
|
+
sizeSchema(isProtein),
|
|
184
|
+
...(withTags && allPartTags
|
|
175
185
|
? [
|
|
176
186
|
{
|
|
177
187
|
path: "tags",
|
|
@@ -203,159 +213,163 @@ const genericAnnotationProperties = ({
|
|
|
203
213
|
{ path: "strand", type: "number" },
|
|
204
214
|
...additionalColumns
|
|
205
215
|
]
|
|
206
|
-
}
|
|
216
|
+
}),
|
|
217
|
+
[
|
|
218
|
+
additionalColumns,
|
|
219
|
+
allPartTags,
|
|
220
|
+
annotationVisibility,
|
|
221
|
+
isProtein,
|
|
222
|
+
keyedPartTags,
|
|
223
|
+
sequence
|
|
224
|
+
]
|
|
225
|
+
);
|
|
207
226
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
></AnchorButton>
|
|
265
|
-
</Tooltip>
|
|
227
|
+
return (
|
|
228
|
+
<DataTable
|
|
229
|
+
topLeftItems={getVisFilter(
|
|
230
|
+
createCommandMenu(
|
|
231
|
+
isFunction(visSubmenu) ? visSubmenu(props) : visSubmenu,
|
|
232
|
+
cmds,
|
|
233
|
+
{
|
|
234
|
+
useTicks: true
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
)}
|
|
238
|
+
annotationPropertiesSelectedEntities={
|
|
239
|
+
annotationPropertiesSelectedEntities
|
|
240
|
+
}
|
|
241
|
+
leftOfSearchBarItems={
|
|
242
|
+
<>
|
|
243
|
+
{!readOnly && (
|
|
244
|
+
<ButtonGroup style={{ marginTop: 3, marginRight: 4 }}>
|
|
245
|
+
<Tooltip
|
|
246
|
+
position="top"
|
|
247
|
+
modifiers={popoverOverflowModifiers}
|
|
248
|
+
content="New"
|
|
249
|
+
>
|
|
250
|
+
<AnchorButton
|
|
251
|
+
disabled={!sequenceLength}
|
|
252
|
+
icon="plus"
|
|
253
|
+
className="tgNewAnnBtn"
|
|
254
|
+
onClick={() => {
|
|
255
|
+
showAddOrEditAnnotationDialog({
|
|
256
|
+
type: annotationType,
|
|
257
|
+
annotation: pick(
|
|
258
|
+
selectionLayer,
|
|
259
|
+
"start",
|
|
260
|
+
"end",
|
|
261
|
+
"forward"
|
|
262
|
+
)
|
|
263
|
+
});
|
|
264
|
+
}}
|
|
265
|
+
></AnchorButton>
|
|
266
|
+
</Tooltip>
|
|
267
|
+
<Tooltip
|
|
268
|
+
position="top"
|
|
269
|
+
modifiers={popoverOverflowModifiers}
|
|
270
|
+
content="Edit"
|
|
271
|
+
>
|
|
272
|
+
<AnchorButton
|
|
273
|
+
onClick={() => {
|
|
274
|
+
showAddOrEditAnnotationDialog({
|
|
275
|
+
type: annotationType,
|
|
276
|
+
annotation: annotationPropertiesSelectedEntities[0]
|
|
277
|
+
});
|
|
278
|
+
}}
|
|
279
|
+
disabled={annotationPropertiesSelectedEntities.length !== 1}
|
|
280
|
+
icon="edit"
|
|
281
|
+
></AnchorButton>
|
|
282
|
+
</Tooltip>
|
|
266
283
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
/>
|
|
288
|
-
)}
|
|
284
|
+
{["feature"].includes(annotationType) && (
|
|
285
|
+
<CmdButton
|
|
286
|
+
text=""
|
|
287
|
+
icon="cog"
|
|
288
|
+
data-tip="Configure Feature Types"
|
|
289
|
+
cmd={cmds.onConfigureFeatureTypesClick}
|
|
290
|
+
/>
|
|
291
|
+
)}
|
|
292
|
+
{["part", "primer", "feature"].includes(annotationType) && (
|
|
293
|
+
<CmdButton
|
|
294
|
+
text=""
|
|
295
|
+
icon={removeDuplicatesIcon}
|
|
296
|
+
data-tip="Remove Duplicates"
|
|
297
|
+
cmd={
|
|
298
|
+
cmds[
|
|
299
|
+
`showRemoveDuplicatesDialog${annotationTypeUpper + "s"}`
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
/>
|
|
303
|
+
)}
|
|
289
304
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
305
|
+
{additionalFooterEls && additionalFooterEls(props)}
|
|
306
|
+
<Tooltip
|
|
307
|
+
position="top"
|
|
308
|
+
modifiers={popoverOverflowModifiers}
|
|
309
|
+
content="Delete"
|
|
310
|
+
>
|
|
311
|
+
<AnchorButton
|
|
312
|
+
onClick={() => {
|
|
313
|
+
deleteAnnotation(annotationPropertiesSelectedEntities);
|
|
314
|
+
}}
|
|
315
|
+
className="tgDeleteAnnsBtn"
|
|
316
|
+
intent="danger"
|
|
317
|
+
disabled={!annotationPropertiesSelectedEntities.length}
|
|
318
|
+
icon="trash"
|
|
319
|
+
></AnchorButton>
|
|
320
|
+
</Tooltip>
|
|
321
|
+
</ButtonGroup>
|
|
322
|
+
)}
|
|
323
|
+
{/* {createCommandMenu(
|
|
324
|
+
{
|
|
325
|
+
cmd: "featureFilterIndividualCmd",
|
|
326
|
+
// text: 'hahah',
|
|
327
|
+
shouldDismissPopover: false
|
|
328
|
+
},
|
|
329
|
+
cmds,
|
|
330
|
+
{
|
|
331
|
+
useTicks: true
|
|
332
|
+
}
|
|
333
|
+
)} */}
|
|
334
|
+
{/* <CmdCheckbox
|
|
335
|
+
prefix="Show "
|
|
336
|
+
cmd={cmds.featureFilterIndividualCmd}
|
|
337
|
+
/> */}
|
|
338
|
+
</>
|
|
339
|
+
}
|
|
340
|
+
onDoubleClick={annotation => {
|
|
341
|
+
showAddOrEditAnnotationDialog({
|
|
342
|
+
type: annotationType,
|
|
343
|
+
annotation
|
|
344
|
+
});
|
|
345
|
+
}}
|
|
346
|
+
withCheckboxes
|
|
347
|
+
showFeatureIndividual={props.showFeatureIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
348
|
+
hideFeatureIndividual={props.hideFeatureIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
349
|
+
showPartIndividual={props.showPartIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
350
|
+
hidePartIndividual={props.hidePartIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
351
|
+
showPrimerIndividual={props.showPrimerIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
352
|
+
hidePrimerIndividual={props.hidePrimerIndividual} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
353
|
+
annotationVisibility={annotationVisibility} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
354
|
+
featureLengthsToHide={props.featureLengthsToHide} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
355
|
+
primerLengthsToHide={props.primerLengthsToHide} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
356
|
+
partLengthsToHide={props.partLengthsToHide} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
357
|
+
sequence={sequence} //we need to pass this in order to force the DT to rerenderannotationVisibility={annotationVisibility}
|
|
358
|
+
noPadding
|
|
359
|
+
noFullscreenButton
|
|
360
|
+
onRowSelect={onRowSelect}
|
|
361
|
+
selectedIds={selectedAnnotationId}
|
|
362
|
+
formName="annotationProperties"
|
|
363
|
+
noRouter
|
|
364
|
+
isProtein={isProtein}
|
|
365
|
+
compact
|
|
366
|
+
isInfinite
|
|
367
|
+
withDisplayOptions
|
|
368
|
+
schema={schema}
|
|
369
|
+
entities={annotationsToUse}
|
|
370
|
+
/>
|
|
371
|
+
);
|
|
372
|
+
};
|
|
359
373
|
|
|
360
374
|
return compose(
|
|
361
375
|
connectToEditor(
|
|
@@ -15,10 +15,12 @@ function searchLayersSelector(
|
|
|
15
15
|
dnaOrAA,
|
|
16
16
|
isProtein,
|
|
17
17
|
proteinSequence,
|
|
18
|
-
mismatchesAllowed
|
|
18
|
+
mismatchesAllowed,
|
|
19
|
+
tempSearchLayers = []
|
|
19
20
|
) {
|
|
21
|
+
const toReturn = [...tempSearchLayers];
|
|
20
22
|
if (!searchString || !isOpen) {
|
|
21
|
-
return
|
|
23
|
+
return toReturn;
|
|
22
24
|
}
|
|
23
25
|
if (isProtein) {
|
|
24
26
|
const searchingDna = dnaOrAA === "DNA";
|
|
@@ -35,7 +37,7 @@ function searchLayersSelector(
|
|
|
35
37
|
).sort(({ start }, { start: start2 }) => {
|
|
36
38
|
return start - start2;
|
|
37
39
|
});
|
|
38
|
-
|
|
40
|
+
const r = searchingDna
|
|
39
41
|
? matches
|
|
40
42
|
: matches.map(({ start, end, ...rest }) => ({
|
|
41
43
|
...rest,
|
|
@@ -43,6 +45,7 @@ function searchLayersSelector(
|
|
|
43
45
|
start: start * 3,
|
|
44
46
|
end: end * 3 + 2
|
|
45
47
|
}));
|
|
48
|
+
return [...toReturn, ...r];
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
// Use findApproxMatches when literal matching DNA with mismatches allowed
|
|
@@ -69,11 +72,13 @@ function searchLayersSelector(
|
|
|
69
72
|
forward: true
|
|
70
73
|
}))
|
|
71
74
|
.sort((a, b) => a.start - b.start);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...match
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
return [
|
|
76
|
+
...toReturn,
|
|
77
|
+
...matches.map(match => ({
|
|
78
|
+
...match,
|
|
79
|
+
className: "veSearchLayer"
|
|
80
|
+
}))
|
|
81
|
+
];
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
// Use regular findSequenceMatches for all other cases
|
|
@@ -85,14 +90,17 @@ function searchLayersSelector(
|
|
|
85
90
|
}).sort(({ start }, { start: start2 }) => {
|
|
86
91
|
return start - start2;
|
|
87
92
|
});
|
|
88
|
-
return
|
|
89
|
-
...
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
return [
|
|
94
|
+
...toReturn,
|
|
95
|
+
...matches.map(match => ({
|
|
96
|
+
...match,
|
|
97
|
+
forward: !match.bottomStrand,
|
|
98
|
+
className:
|
|
99
|
+
"veSearchLayer " +
|
|
100
|
+
(match.bottomStrand ? " veSearchLayerBottomStrand" : ""),
|
|
101
|
+
isSearchLayer: true
|
|
102
|
+
}))
|
|
103
|
+
];
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
export default createSelector(
|
|
@@ -105,5 +113,6 @@ export default createSelector(
|
|
|
105
113
|
state => state.sequenceData.isProtein,
|
|
106
114
|
state => state.sequenceData.proteinSequence,
|
|
107
115
|
state => state.findTool && state.findTool.mismatchesAllowed,
|
|
116
|
+
state => state.temporaryAnnotations?.searchLayers,
|
|
108
117
|
searchLayersSelector
|
|
109
118
|
);
|
package/src/utils/pureNoFunc.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { shouldUpdate } from "recompose";
|
|
2
|
-
import { isEqualWith, isFunction } from "lodash-es";
|
|
3
|
-
|
|
4
|
-
const isEq = (o1, o2) => {
|
|
5
|
-
const isEq = isEqualWith(o1, o2, function (val1, val2) {
|
|
6
|
-
if (isFunction(val1) && isFunction(val2)) {
|
|
7
|
-
return val1 === val2 || val1.toString() === val2.toString();
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
return isEq;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const pure = BaseComponent => {
|
|
14
|
-
const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
|
|
15
|
-
return hoc(BaseComponent);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default pure;
|
package/utils/pureNoFunc.d.ts
DELETED