@teselagen/ove 0.3.30 → 0.3.43
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 +163 -93
- package/index.es.js +163 -93
- package/index.js +197011 -0
- package/index.mjs +196957 -0
- package/index.umd.js +219 -140
- package/package.json +4 -4
- package/src/RowItem/Sequence.js +1 -1
- package/src/helperComponents/AddOrEditPrimerDialog/index.js +7 -10
- package/src/utils/editorUtils.js +0 -19
- package/src/withEditorInteractions/createSequenceInputPopup.js +10 -16
- package/src/withEditorInteractions/index.js +5 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.43",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"node": "16.20.2"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@teselagen/sequence-utils": "0.3.
|
|
16
|
+
"@teselagen/sequence-utils": "0.3.9",
|
|
17
17
|
"@teselagen/range-utils": "0.3.7",
|
|
18
|
-
"@teselagen/ui": "0.3.
|
|
18
|
+
"@teselagen/ui": "0.3.32",
|
|
19
19
|
"@teselagen/file-utils": "0.3.9",
|
|
20
20
|
"@teselagen/bounce-loader": "0.3.11",
|
|
21
|
-
"@teselagen/bio-parsers": "0.
|
|
21
|
+
"@teselagen/bio-parsers": "0.4.1",
|
|
22
22
|
"@blueprintjs/core": "3.52.0",
|
|
23
23
|
"@blueprintjs/datetime": "3.23.19",
|
|
24
24
|
"@blueprintjs/icons": "3.33.0",
|
package/src/RowItem/Sequence.js
CHANGED
|
@@ -90,7 +90,7 @@ class Sequence extends React.Component {
|
|
|
90
90
|
|
|
91
91
|
let inner;
|
|
92
92
|
const shared = {
|
|
93
|
-
...isSafari ? { letterSpacing: "3px" } : {},
|
|
93
|
+
...(isSafari ? { letterSpacing: "3px" } : {}),
|
|
94
94
|
y: height - height / 4,
|
|
95
95
|
className:
|
|
96
96
|
"ve-monospace-font " + (isReverse ? " ve-sequence-reverse" : "")
|
|
@@ -6,11 +6,13 @@ import {
|
|
|
6
6
|
generateField,
|
|
7
7
|
RadioGroupField
|
|
8
8
|
} from "@teselagen/ui";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
filterSequenceString,
|
|
11
|
+
getReverseComplementSequenceString
|
|
12
|
+
} from "@teselagen/sequence-utils";
|
|
10
13
|
|
|
11
14
|
import AddOrEditAnnotationDialog from "../AddOrEditAnnotationDialog";
|
|
12
15
|
import { convertRangeTo0Based } from "@teselagen/range-utils";
|
|
13
|
-
import { getAcceptedChars } from "../../utils/editorUtils";
|
|
14
16
|
import classNames from "classnames";
|
|
15
17
|
import "./style.css";
|
|
16
18
|
import { getSequenceWithinRange } from "@teselagen/range-utils";
|
|
@@ -42,14 +44,9 @@ const CustomContentEditable = generateField(function CustomContentEditable({
|
|
|
42
44
|
const newVal = e.target.innerText;
|
|
43
45
|
const savedCaretPosition = CaretPositioning.saveSelection(e.currentTarget);
|
|
44
46
|
setCaretPosition(savedCaretPosition);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (acceptedChars.includes(letter.toLowerCase())) {
|
|
49
|
-
newBases += letter;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
if (newVal.length !== newBases.length) {
|
|
47
|
+
const [newBases, warnings] = filterSequenceString(newVal, sequenceData);
|
|
48
|
+
|
|
49
|
+
if (warnings.length) {
|
|
53
50
|
setTempError(true);
|
|
54
51
|
setTimeout(() => {
|
|
55
52
|
setTempError(false);
|
package/src/utils/editorUtils.js
CHANGED
|
@@ -4,7 +4,6 @@ import { divideBy3 } from "./proteinUtils";
|
|
|
4
4
|
import {
|
|
5
5
|
getInsertBetweenVals,
|
|
6
6
|
calculatePercentGC,
|
|
7
|
-
bioData,
|
|
8
7
|
aliasedEnzymesByName
|
|
9
8
|
} from "@teselagen/sequence-utils";
|
|
10
9
|
import { get, sortBy } from "lodash";
|
|
@@ -172,24 +171,6 @@ export function getSelFromWrappedAddon(selectionLayer, sequenceLength) {
|
|
|
172
171
|
return selToUse;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
export function getAcceptedChars({
|
|
176
|
-
isOligo,
|
|
177
|
-
isProtein,
|
|
178
|
-
isRna,
|
|
179
|
-
isMixedRnaAndDna
|
|
180
|
-
} = {}) {
|
|
181
|
-
return isProtein
|
|
182
|
-
? bioData.extended_protein_letters.toLowerCase()
|
|
183
|
-
: isOligo
|
|
184
|
-
? bioData.ambiguous_rna_letters.toLowerCase() + "t"
|
|
185
|
-
: isRna
|
|
186
|
-
? bioData.ambiguous_rna_letters.toLowerCase()
|
|
187
|
-
: isMixedRnaAndDna
|
|
188
|
-
? bioData.ambiguous_rna_letters.toLowerCase() +
|
|
189
|
-
bioData.ambiguous_dna_letters.toLowerCase()
|
|
190
|
-
: //just plain old dna
|
|
191
|
-
bioData.ambiguous_dna_letters.toLowerCase();
|
|
192
|
-
}
|
|
193
174
|
export function getStripedPattern({ color }) {
|
|
194
175
|
return (
|
|
195
176
|
<pattern
|
|
@@ -6,7 +6,8 @@ import Popper from "popper.js";
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
getInsertBetweenVals,
|
|
9
|
-
convertDnaCaretPositionOrRangeToAA
|
|
9
|
+
convertDnaCaretPositionOrRangeToAA,
|
|
10
|
+
filterSequenceString
|
|
10
11
|
} from "@teselagen/sequence-utils";
|
|
11
12
|
import React from "react";
|
|
12
13
|
import { divideBy3 } from "../utils/proteinUtils";
|
|
@@ -77,9 +78,8 @@ class SequenceInputNoHotkeys extends React.Component {
|
|
|
77
78
|
selectionLayer,
|
|
78
79
|
sequenceLength,
|
|
79
80
|
isProtein,
|
|
80
|
-
replaceChars,
|
|
81
81
|
caretPosition,
|
|
82
|
-
|
|
82
|
+
sequenceData,
|
|
83
83
|
maxInsertSize
|
|
84
84
|
} = this.props;
|
|
85
85
|
const { charsToInsert, hasTempError } = this.state;
|
|
@@ -136,19 +136,14 @@ class SequenceInputNoHotkeys extends React.Component {
|
|
|
136
136
|
autoFocus
|
|
137
137
|
style={hasTempError ? { borderColor: "red" } : {}}
|
|
138
138
|
onChange={e => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
sanitizedVal += isUpper
|
|
145
|
-
? replaceChars[lowerLetter].toUpperCase()
|
|
146
|
-
: replaceChars[lowerLetter];
|
|
147
|
-
} else if (acceptedChars.includes(lowerLetter)) {
|
|
148
|
-
sanitizedVal += letter;
|
|
139
|
+
const [sanitizedVal, warnings] = filterSequenceString(
|
|
140
|
+
e.target.value,
|
|
141
|
+
{
|
|
142
|
+
...sequenceData,
|
|
143
|
+
name: undefined
|
|
149
144
|
}
|
|
150
|
-
|
|
151
|
-
if (
|
|
145
|
+
);
|
|
146
|
+
if (warnings.length) {
|
|
152
147
|
this.setState({
|
|
153
148
|
hasTempError: true
|
|
154
149
|
});
|
|
@@ -165,7 +160,6 @@ class SequenceInputNoHotkeys extends React.Component {
|
|
|
165
160
|
);
|
|
166
161
|
}
|
|
167
162
|
e.target.value = sanitizedVal;
|
|
168
|
-
|
|
169
163
|
this.setState({ charsToInsert: sanitizedVal });
|
|
170
164
|
}}
|
|
171
165
|
/>
|
|
@@ -41,11 +41,7 @@ import {
|
|
|
41
41
|
createNewAnnotationMenu
|
|
42
42
|
} from "../MenuBar/defaultConfig";
|
|
43
43
|
import { fullSequenceTranslationMenu } from "../MenuBar/viewSubmenu";
|
|
44
|
-
import {
|
|
45
|
-
getAcceptedChars,
|
|
46
|
-
getNodeToRefocus,
|
|
47
|
-
getSelFromWrappedAddon
|
|
48
|
-
} from "../utils/editorUtils";
|
|
44
|
+
import { getNodeToRefocus, getSelFromWrappedAddon } from "../utils/editorUtils";
|
|
49
45
|
|
|
50
46
|
import {
|
|
51
47
|
showAddOrEditAnnotationDialog,
|
|
@@ -212,7 +208,8 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
212
208
|
selectionLayer = { start: -1, end: -1 },
|
|
213
209
|
readOnly,
|
|
214
210
|
onPaste,
|
|
215
|
-
disableBpEditing
|
|
211
|
+
disableBpEditing,
|
|
212
|
+
sequenceData
|
|
216
213
|
} = this.props;
|
|
217
214
|
|
|
218
215
|
if (disableBpEditing) {
|
|
@@ -240,6 +237,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
240
237
|
}
|
|
241
238
|
|
|
242
239
|
seqDataToInsert = tidyUpSequenceData(seqDataToInsert, {
|
|
240
|
+
topLevelSeqData: sequenceData,
|
|
243
241
|
provideNewIdsForAnnotations: true,
|
|
244
242
|
annotationsAsObjects: true,
|
|
245
243
|
removeUnwantedChars: true,
|
|
@@ -360,8 +358,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
360
358
|
createSequenceInputPopup({
|
|
361
359
|
useEventPositioning,
|
|
362
360
|
isReplace,
|
|
363
|
-
|
|
364
|
-
acceptedChars: getAcceptedChars(sequenceData),
|
|
361
|
+
sequenceData,
|
|
365
362
|
isProtein: sequenceData.isProtein,
|
|
366
363
|
selectionLayer,
|
|
367
364
|
sequenceLength,
|