@teselagen/ove 0.8.20 → 0.8.22
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 +167 -38
- package/index.es.js +167 -38
- package/index.umd.js +167 -38
- package/ove.css +46 -0
- package/package.json +2 -2
- package/redux/temporaryAnnotations.d.ts +6 -0
- package/selectors/featuresSelector.d.ts +1 -1
- package/selectors/partsSelector.d.ts +1 -1
- package/selectors/primersSelector.d.ts +1 -1
- package/selectors/searchLayersSelector.d.ts +1 -1
- package/selectors/temporaryAnnotationsSelector.d.ts +2 -0
- package/src/redux/index.js +3 -1
- package/src/redux/temporaryAnnotations.js +23 -0
- package/src/selectors/featuresSelector.js +8 -3
- package/src/selectors/partsSelector.js +9 -3
- package/src/selectors/primersSelector.js +9 -3
- package/src/selectors/searchLayersSelector.js +14 -8
- package/src/selectors/temporaryAnnotationsSelector.js +1 -0
- package/src/updateEditor.js +5 -1
|
@@ -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,10 @@ function searchLayersSelector(
|
|
|
43
45
|
start: start * 3,
|
|
44
46
|
end: end * 3 + 2
|
|
45
47
|
}));
|
|
48
|
+
return [
|
|
49
|
+
...toReturn,
|
|
50
|
+
...r
|
|
51
|
+
];
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
// Use findApproxMatches when literal matching DNA with mismatches allowed
|
|
@@ -69,11 +75,10 @@ function searchLayersSelector(
|
|
|
69
75
|
forward: true
|
|
70
76
|
}))
|
|
71
77
|
.sort((a, b) => a.start - b.start);
|
|
72
|
-
|
|
73
|
-
return matches.map(match => ({
|
|
78
|
+
return [...toReturn, ...matches.map(match => ({
|
|
74
79
|
...match,
|
|
75
80
|
className: "veSearchLayer"
|
|
76
|
-
}));
|
|
81
|
+
}))];
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
// Use regular findSequenceMatches for all other cases
|
|
@@ -85,14 +90,14 @@ function searchLayersSelector(
|
|
|
85
90
|
}).sort(({ start }, { start: start2 }) => {
|
|
86
91
|
return start - start2;
|
|
87
92
|
});
|
|
88
|
-
return matches.map(match => ({
|
|
93
|
+
return [...toReturn, ...matches.map(match => ({
|
|
89
94
|
...match,
|
|
90
95
|
forward: !match.bottomStrand,
|
|
91
96
|
className:
|
|
92
97
|
"veSearchLayer " +
|
|
93
98
|
(match.bottomStrand ? " veSearchLayerBottomStrand" : ""),
|
|
94
99
|
isSearchLayer: true
|
|
95
|
-
}));
|
|
100
|
+
}))];
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
export default createSelector(
|
|
@@ -105,5 +110,6 @@ export default createSelector(
|
|
|
105
110
|
state => state.sequenceData.isProtein,
|
|
106
111
|
state => state.sequenceData.proteinSequence,
|
|
107
112
|
state => state.findTool && state.findTool.mismatchesAllowed,
|
|
113
|
+
state => state.temporaryAnnotations.searchLayers,
|
|
108
114
|
searchLayersSelector
|
|
109
115
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default editor => editor.temporaryAnnotations;
|
package/src/updateEditor.js
CHANGED
|
@@ -14,7 +14,8 @@ export default function updateEditor(
|
|
|
14
14
|
annotationVisibility,
|
|
15
15
|
annotationsToSupport,
|
|
16
16
|
findTool,
|
|
17
|
-
justPassingPartialSeqData
|
|
17
|
+
justPassingPartialSeqData,
|
|
18
|
+
temporaryAnnotations
|
|
18
19
|
} = initialValues;
|
|
19
20
|
const currentEditor = store.getState().VectorEditor[editorName] || {};
|
|
20
21
|
const isAlreadyProteinEditor =
|
|
@@ -174,6 +175,9 @@ export default function updateEditor(
|
|
|
174
175
|
//if we have sequence data coming in make sure to tidy it up for the user :)
|
|
175
176
|
annotationsAsObjects: true
|
|
176
177
|
})
|
|
178
|
+
}),
|
|
179
|
+
...(temporaryAnnotations && {
|
|
180
|
+
temporaryAnnotations
|
|
177
181
|
})
|
|
178
182
|
};
|
|
179
183
|
}
|