@teselagen/ove 0.7.35 → 0.7.38
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/README.md +2 -2
- package/index.cjs.js +81 -19
- package/index.es.js +81 -19
- package/index.umd.js +81 -19
- package/ove.css +12 -4
- package/package.json +2 -2
- package/src/FindBar/index.js +11 -16
- package/src/FindBar/style.css +12 -4
- package/src/withEditorInteractions/index.js +9 -2
package/README.md
CHANGED
|
@@ -713,6 +713,6 @@ you can either add your test to an existing cypress file or make a new test file
|
|
|
713
713
|
|
|
714
714
|
once you're satisfied, make a pull request back to tg-oss and mention @tnrich
|
|
715
715
|
|
|
716
|
-
|
|
716
|
+
## Running unit tests
|
|
717
717
|
|
|
718
|
-
|
|
718
|
+
Run `bun test` from the root of the repo to execute all unit tests.
|
package/index.cjs.js
CHANGED
|
@@ -83139,7 +83139,7 @@ const proteinAlphabet = {
|
|
|
83139
83139
|
mass: 0
|
|
83140
83140
|
}
|
|
83141
83141
|
};
|
|
83142
|
-
const
|
|
83142
|
+
const initThreeLetterSequenceStringToAminoAcidMap = {
|
|
83143
83143
|
gct: proteinAlphabet.A,
|
|
83144
83144
|
gcc: proteinAlphabet.A,
|
|
83145
83145
|
gca: proteinAlphabet.A,
|
|
@@ -83238,9 +83238,74 @@ const threeLetterSequenceStringToAminoAcidMap = {
|
|
|
83238
83238
|
taa: proteinAlphabet["*"],
|
|
83239
83239
|
tag: proteinAlphabet["*"],
|
|
83240
83240
|
tga: proteinAlphabet["*"],
|
|
83241
|
+
uaa: proteinAlphabet["*"],
|
|
83242
|
+
uag: proteinAlphabet["*"],
|
|
83243
|
+
uga: proteinAlphabet["*"],
|
|
83241
83244
|
"...": proteinAlphabet["."],
|
|
83242
83245
|
"---": proteinAlphabet["-"]
|
|
83243
83246
|
};
|
|
83247
|
+
const IUPAC = {
|
|
83248
|
+
A: ["A"],
|
|
83249
|
+
C: ["C"],
|
|
83250
|
+
G: ["G"],
|
|
83251
|
+
T: ["T"],
|
|
83252
|
+
U: ["U"],
|
|
83253
|
+
R: ["A", "G"],
|
|
83254
|
+
Y: ["C", "T", "U"],
|
|
83255
|
+
K: ["G", "T", "U"],
|
|
83256
|
+
M: ["A", "C"],
|
|
83257
|
+
S: ["G", "C"],
|
|
83258
|
+
W: ["A", "T", "U"],
|
|
83259
|
+
B: ["C", "G", "T", "U"],
|
|
83260
|
+
D: ["A", "G", "T", "U"],
|
|
83261
|
+
H: ["A", "C", "T", "U"],
|
|
83262
|
+
V: ["A", "C", "G"],
|
|
83263
|
+
N: ["A", "C", "G", "T", "U"],
|
|
83264
|
+
X: ["A", "C", "G", "T", "U"]
|
|
83265
|
+
};
|
|
83266
|
+
function expandAndResolve(threeLetterCodon) {
|
|
83267
|
+
var _a2, _b2;
|
|
83268
|
+
const chars = threeLetterCodon.toUpperCase().split("");
|
|
83269
|
+
const picks = chars.map((c2) => IUPAC[c2] || [c2]);
|
|
83270
|
+
let allPossibleThreeLetterCodons = [""];
|
|
83271
|
+
for (const set6 of picks) {
|
|
83272
|
+
const next = [];
|
|
83273
|
+
for (const prefix2 of allPossibleThreeLetterCodons) for (const b3 of set6) next.push(prefix2 + b3);
|
|
83274
|
+
allPossibleThreeLetterCodons = next;
|
|
83275
|
+
}
|
|
83276
|
+
let foundAminoAcid = null;
|
|
83277
|
+
for (const codon of allPossibleThreeLetterCodons) {
|
|
83278
|
+
const lowerCodon = codon.toLowerCase();
|
|
83279
|
+
const aminoAcidObj = (_b2 = (_a2 = initThreeLetterSequenceStringToAminoAcidMap[lowerCodon]) != null ? _a2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/u/g, "t")]) != null ? _b2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/t/g, "u")];
|
|
83280
|
+
if (aminoAcidObj) {
|
|
83281
|
+
if (!foundAminoAcid) {
|
|
83282
|
+
foundAminoAcid = aminoAcidObj;
|
|
83283
|
+
} else if (foundAminoAcid.value !== aminoAcidObj.value) {
|
|
83284
|
+
return null;
|
|
83285
|
+
}
|
|
83286
|
+
} else {
|
|
83287
|
+
return null;
|
|
83288
|
+
}
|
|
83289
|
+
}
|
|
83290
|
+
return foundAminoAcid;
|
|
83291
|
+
}
|
|
83292
|
+
__name(expandAndResolve, "expandAndResolve");
|
|
83293
|
+
function getCodonToAminoAcidMap() {
|
|
83294
|
+
const map3 = initThreeLetterSequenceStringToAminoAcidMap;
|
|
83295
|
+
const codes = Object.keys(IUPAC);
|
|
83296
|
+
for (const a2 of codes)
|
|
83297
|
+
for (const b3 of codes)
|
|
83298
|
+
for (const c2 of codes) {
|
|
83299
|
+
const codon = a2 + b3 + c2;
|
|
83300
|
+
const lowerCodon = codon.toLowerCase();
|
|
83301
|
+
if (map3[lowerCodon]) continue;
|
|
83302
|
+
const aminoAcidObj = expandAndResolve(codon);
|
|
83303
|
+
if (aminoAcidObj) map3[lowerCodon] = aminoAcidObj;
|
|
83304
|
+
}
|
|
83305
|
+
return map3;
|
|
83306
|
+
}
|
|
83307
|
+
__name(getCodonToAminoAcidMap, "getCodonToAminoAcidMap");
|
|
83308
|
+
const threeLetterSequenceStringToAminoAcidMap = getCodonToAminoAcidMap();
|
|
83244
83309
|
const degenerateDnaToAminoAcidMap = invert(aminoAcidToDegenerateDnaMap);
|
|
83245
83310
|
function getAminoAcidFromSequenceTriplet(sequenceString) {
|
|
83246
83311
|
sequenceString = sequenceString.toLowerCase();
|
|
@@ -83353,7 +83418,7 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
83353
83418
|
const aminoAcidDataForEachBaseOfDNA = [];
|
|
83354
83419
|
for (let index2 = 0; index2 < sequenceStringLength; index2 += 3) {
|
|
83355
83420
|
let aminoAcid;
|
|
83356
|
-
const aminoAcidIndex = index2 / 3;
|
|
83421
|
+
const aminoAcidIndex = Math.floor(index2 / 3);
|
|
83357
83422
|
let codonPositionsInCDS;
|
|
83358
83423
|
let basesRead;
|
|
83359
83424
|
if (isProteinSequence) {
|
|
@@ -124895,7 +124960,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
124895
124960
|
input.click();
|
|
124896
124961
|
}
|
|
124897
124962
|
__name(showFileDialog, "showFileDialog");
|
|
124898
|
-
const version = "0.7.
|
|
124963
|
+
const version = "0.7.37";
|
|
124899
124964
|
const packageJson = {
|
|
124900
124965
|
version
|
|
124901
124966
|
};
|
|
@@ -130061,6 +130126,8 @@ function VectorInteractionHOC(Component) {
|
|
|
130061
130126
|
[this.commandEnhancer],
|
|
130062
130127
|
e,
|
|
130063
130128
|
() => {
|
|
130129
|
+
document.body.removeEventListener("cut", this.handleCut);
|
|
130130
|
+
document.body.removeEventListener("copy", this.handleCopy);
|
|
130064
130131
|
if (lastFocusedEl) {
|
|
130065
130132
|
lastFocusedEl.focus();
|
|
130066
130133
|
}
|
|
@@ -150179,19 +150246,13 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
150179
150246
|
minWidth: 300
|
|
150180
150247
|
} : {
|
|
150181
150248
|
position: "fixed",
|
|
150182
|
-
top:
|
|
150249
|
+
top: 120,
|
|
150183
150250
|
right: 25,
|
|
150184
150251
|
padding: 10,
|
|
150185
150252
|
display: "flex",
|
|
150186
|
-
alignItems: "
|
|
150253
|
+
alignItems: "start",
|
|
150187
150254
|
paddingBottom: 5,
|
|
150188
|
-
|
|
150189
|
-
zIndex: "20000",
|
|
150190
|
-
borderBottom: "1px solid lightgrey",
|
|
150191
|
-
borderLeft: "1px solid lightgrey",
|
|
150192
|
-
borderRight: "1px solid lightgrey",
|
|
150193
|
-
borderBottomLeftRadius: "5px",
|
|
150194
|
-
borderBottomRightRadius: "5px"
|
|
150255
|
+
zIndex: 2e4
|
|
150195
150256
|
},
|
|
150196
150257
|
className: "veFindBar"
|
|
150197
150258
|
},
|
|
@@ -150206,7 +150267,10 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
150206
150267
|
autoFocus: true,
|
|
150207
150268
|
style: __spreadValues({
|
|
150208
150269
|
resize: "vertical"
|
|
150209
|
-
}, !isInline && {
|
|
150270
|
+
}, !isInline && {
|
|
150271
|
+
width: 350,
|
|
150272
|
+
height: 190
|
|
150273
|
+
}),
|
|
150210
150274
|
className: "tg-find-tool-input",
|
|
150211
150275
|
inputRef: /* @__PURE__ */ __name((n2) => {
|
|
150212
150276
|
if (n2) this.inputEl = n2;
|
|
@@ -150252,12 +150316,10 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
150252
150316
|
"div",
|
|
150253
150317
|
{
|
|
150254
150318
|
style: {
|
|
150319
|
+
marginLeft: 10,
|
|
150255
150320
|
display: "flex",
|
|
150256
|
-
|
|
150257
|
-
|
|
150258
|
-
justifyContent: "space-around",
|
|
150259
|
-
alignItems: "stretch",
|
|
150260
|
-
height: "76px"
|
|
150321
|
+
flexDirection: "column",
|
|
150322
|
+
gap: 5
|
|
150261
150323
|
}
|
|
150262
150324
|
},
|
|
150263
150325
|
rightEl,
|
|
@@ -150267,7 +150329,7 @@ const _FindBar = class _FindBar extends React.Component {
|
|
|
150267
150329
|
core.Button,
|
|
150268
150330
|
{
|
|
150269
150331
|
minimal: true,
|
|
150270
|
-
style: { position: "absolute", bottom: 0, right:
|
|
150332
|
+
style: { position: "absolute", bottom: 0, right: 0 },
|
|
150271
150333
|
onClick: toggleFindTool2,
|
|
150272
150334
|
icon: "cross"
|
|
150273
150335
|
}
|
package/index.es.js
CHANGED
|
@@ -83121,7 +83121,7 @@ const proteinAlphabet = {
|
|
|
83121
83121
|
mass: 0
|
|
83122
83122
|
}
|
|
83123
83123
|
};
|
|
83124
|
-
const
|
|
83124
|
+
const initThreeLetterSequenceStringToAminoAcidMap = {
|
|
83125
83125
|
gct: proteinAlphabet.A,
|
|
83126
83126
|
gcc: proteinAlphabet.A,
|
|
83127
83127
|
gca: proteinAlphabet.A,
|
|
@@ -83220,9 +83220,74 @@ const threeLetterSequenceStringToAminoAcidMap = {
|
|
|
83220
83220
|
taa: proteinAlphabet["*"],
|
|
83221
83221
|
tag: proteinAlphabet["*"],
|
|
83222
83222
|
tga: proteinAlphabet["*"],
|
|
83223
|
+
uaa: proteinAlphabet["*"],
|
|
83224
|
+
uag: proteinAlphabet["*"],
|
|
83225
|
+
uga: proteinAlphabet["*"],
|
|
83223
83226
|
"...": proteinAlphabet["."],
|
|
83224
83227
|
"---": proteinAlphabet["-"]
|
|
83225
83228
|
};
|
|
83229
|
+
const IUPAC = {
|
|
83230
|
+
A: ["A"],
|
|
83231
|
+
C: ["C"],
|
|
83232
|
+
G: ["G"],
|
|
83233
|
+
T: ["T"],
|
|
83234
|
+
U: ["U"],
|
|
83235
|
+
R: ["A", "G"],
|
|
83236
|
+
Y: ["C", "T", "U"],
|
|
83237
|
+
K: ["G", "T", "U"],
|
|
83238
|
+
M: ["A", "C"],
|
|
83239
|
+
S: ["G", "C"],
|
|
83240
|
+
W: ["A", "T", "U"],
|
|
83241
|
+
B: ["C", "G", "T", "U"],
|
|
83242
|
+
D: ["A", "G", "T", "U"],
|
|
83243
|
+
H: ["A", "C", "T", "U"],
|
|
83244
|
+
V: ["A", "C", "G"],
|
|
83245
|
+
N: ["A", "C", "G", "T", "U"],
|
|
83246
|
+
X: ["A", "C", "G", "T", "U"]
|
|
83247
|
+
};
|
|
83248
|
+
function expandAndResolve(threeLetterCodon) {
|
|
83249
|
+
var _a2, _b2;
|
|
83250
|
+
const chars = threeLetterCodon.toUpperCase().split("");
|
|
83251
|
+
const picks = chars.map((c2) => IUPAC[c2] || [c2]);
|
|
83252
|
+
let allPossibleThreeLetterCodons = [""];
|
|
83253
|
+
for (const set6 of picks) {
|
|
83254
|
+
const next = [];
|
|
83255
|
+
for (const prefix2 of allPossibleThreeLetterCodons) for (const b3 of set6) next.push(prefix2 + b3);
|
|
83256
|
+
allPossibleThreeLetterCodons = next;
|
|
83257
|
+
}
|
|
83258
|
+
let foundAminoAcid = null;
|
|
83259
|
+
for (const codon of allPossibleThreeLetterCodons) {
|
|
83260
|
+
const lowerCodon = codon.toLowerCase();
|
|
83261
|
+
const aminoAcidObj = (_b2 = (_a2 = initThreeLetterSequenceStringToAminoAcidMap[lowerCodon]) != null ? _a2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/u/g, "t")]) != null ? _b2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/t/g, "u")];
|
|
83262
|
+
if (aminoAcidObj) {
|
|
83263
|
+
if (!foundAminoAcid) {
|
|
83264
|
+
foundAminoAcid = aminoAcidObj;
|
|
83265
|
+
} else if (foundAminoAcid.value !== aminoAcidObj.value) {
|
|
83266
|
+
return null;
|
|
83267
|
+
}
|
|
83268
|
+
} else {
|
|
83269
|
+
return null;
|
|
83270
|
+
}
|
|
83271
|
+
}
|
|
83272
|
+
return foundAminoAcid;
|
|
83273
|
+
}
|
|
83274
|
+
__name(expandAndResolve, "expandAndResolve");
|
|
83275
|
+
function getCodonToAminoAcidMap() {
|
|
83276
|
+
const map3 = initThreeLetterSequenceStringToAminoAcidMap;
|
|
83277
|
+
const codes = Object.keys(IUPAC);
|
|
83278
|
+
for (const a2 of codes)
|
|
83279
|
+
for (const b3 of codes)
|
|
83280
|
+
for (const c2 of codes) {
|
|
83281
|
+
const codon = a2 + b3 + c2;
|
|
83282
|
+
const lowerCodon = codon.toLowerCase();
|
|
83283
|
+
if (map3[lowerCodon]) continue;
|
|
83284
|
+
const aminoAcidObj = expandAndResolve(codon);
|
|
83285
|
+
if (aminoAcidObj) map3[lowerCodon] = aminoAcidObj;
|
|
83286
|
+
}
|
|
83287
|
+
return map3;
|
|
83288
|
+
}
|
|
83289
|
+
__name(getCodonToAminoAcidMap, "getCodonToAminoAcidMap");
|
|
83290
|
+
const threeLetterSequenceStringToAminoAcidMap = getCodonToAminoAcidMap();
|
|
83226
83291
|
const degenerateDnaToAminoAcidMap = invert(aminoAcidToDegenerateDnaMap);
|
|
83227
83292
|
function getAminoAcidFromSequenceTriplet(sequenceString) {
|
|
83228
83293
|
sequenceString = sequenceString.toLowerCase();
|
|
@@ -83335,7 +83400,7 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
83335
83400
|
const aminoAcidDataForEachBaseOfDNA = [];
|
|
83336
83401
|
for (let index2 = 0; index2 < sequenceStringLength; index2 += 3) {
|
|
83337
83402
|
let aminoAcid;
|
|
83338
|
-
const aminoAcidIndex = index2 / 3;
|
|
83403
|
+
const aminoAcidIndex = Math.floor(index2 / 3);
|
|
83339
83404
|
let codonPositionsInCDS;
|
|
83340
83405
|
let basesRead;
|
|
83341
83406
|
if (isProteinSequence) {
|
|
@@ -124877,7 +124942,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
124877
124942
|
input.click();
|
|
124878
124943
|
}
|
|
124879
124944
|
__name(showFileDialog, "showFileDialog");
|
|
124880
|
-
const version = "0.7.
|
|
124945
|
+
const version = "0.7.37";
|
|
124881
124946
|
const packageJson = {
|
|
124882
124947
|
version
|
|
124883
124948
|
};
|
|
@@ -130043,6 +130108,8 @@ function VectorInteractionHOC(Component2) {
|
|
|
130043
130108
|
[this.commandEnhancer],
|
|
130044
130109
|
e,
|
|
130045
130110
|
() => {
|
|
130111
|
+
document.body.removeEventListener("cut", this.handleCut);
|
|
130112
|
+
document.body.removeEventListener("copy", this.handleCopy);
|
|
130046
130113
|
if (lastFocusedEl) {
|
|
130047
130114
|
lastFocusedEl.focus();
|
|
130048
130115
|
}
|
|
@@ -150161,19 +150228,13 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
150161
150228
|
minWidth: 300
|
|
150162
150229
|
} : {
|
|
150163
150230
|
position: "fixed",
|
|
150164
|
-
top:
|
|
150231
|
+
top: 120,
|
|
150165
150232
|
right: 25,
|
|
150166
150233
|
padding: 10,
|
|
150167
150234
|
display: "flex",
|
|
150168
|
-
alignItems: "
|
|
150235
|
+
alignItems: "start",
|
|
150169
150236
|
paddingBottom: 5,
|
|
150170
|
-
|
|
150171
|
-
zIndex: "20000",
|
|
150172
|
-
borderBottom: "1px solid lightgrey",
|
|
150173
|
-
borderLeft: "1px solid lightgrey",
|
|
150174
|
-
borderRight: "1px solid lightgrey",
|
|
150175
|
-
borderBottomLeftRadius: "5px",
|
|
150176
|
-
borderBottomRightRadius: "5px"
|
|
150237
|
+
zIndex: 2e4
|
|
150177
150238
|
},
|
|
150178
150239
|
className: "veFindBar"
|
|
150179
150240
|
},
|
|
@@ -150188,7 +150249,10 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
150188
150249
|
autoFocus: true,
|
|
150189
150250
|
style: __spreadValues({
|
|
150190
150251
|
resize: "vertical"
|
|
150191
|
-
}, !isInline && {
|
|
150252
|
+
}, !isInline && {
|
|
150253
|
+
width: 350,
|
|
150254
|
+
height: 190
|
|
150255
|
+
}),
|
|
150192
150256
|
className: "tg-find-tool-input",
|
|
150193
150257
|
inputRef: /* @__PURE__ */ __name((n2) => {
|
|
150194
150258
|
if (n2) this.inputEl = n2;
|
|
@@ -150234,12 +150298,10 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
150234
150298
|
"div",
|
|
150235
150299
|
{
|
|
150236
150300
|
style: {
|
|
150301
|
+
marginLeft: 10,
|
|
150237
150302
|
display: "flex",
|
|
150238
|
-
|
|
150239
|
-
|
|
150240
|
-
justifyContent: "space-around",
|
|
150241
|
-
alignItems: "stretch",
|
|
150242
|
-
height: "76px"
|
|
150303
|
+
flexDirection: "column",
|
|
150304
|
+
gap: 5
|
|
150243
150305
|
}
|
|
150244
150306
|
},
|
|
150245
150307
|
rightEl,
|
|
@@ -150249,7 +150311,7 @@ const _FindBar = class _FindBar extends React__default.Component {
|
|
|
150249
150311
|
Button,
|
|
150250
150312
|
{
|
|
150251
150313
|
minimal: true,
|
|
150252
|
-
style: { position: "absolute", bottom: 0, right:
|
|
150314
|
+
style: { position: "absolute", bottom: 0, right: 0 },
|
|
150253
150315
|
onClick: toggleFindTool2,
|
|
150254
150316
|
icon: "cross"
|
|
150255
150317
|
}
|
package/index.umd.js
CHANGED
|
@@ -112042,7 +112042,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
112042
112042
|
mass: 0
|
|
112043
112043
|
}
|
|
112044
112044
|
};
|
|
112045
|
-
const
|
|
112045
|
+
const initThreeLetterSequenceStringToAminoAcidMap = {
|
|
112046
112046
|
gct: proteinAlphabet.A,
|
|
112047
112047
|
gcc: proteinAlphabet.A,
|
|
112048
112048
|
gca: proteinAlphabet.A,
|
|
@@ -112141,9 +112141,74 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
112141
112141
|
taa: proteinAlphabet["*"],
|
|
112142
112142
|
tag: proteinAlphabet["*"],
|
|
112143
112143
|
tga: proteinAlphabet["*"],
|
|
112144
|
+
uaa: proteinAlphabet["*"],
|
|
112145
|
+
uag: proteinAlphabet["*"],
|
|
112146
|
+
uga: proteinAlphabet["*"],
|
|
112144
112147
|
"...": proteinAlphabet["."],
|
|
112145
112148
|
"---": proteinAlphabet["-"]
|
|
112146
112149
|
};
|
|
112150
|
+
const IUPAC = {
|
|
112151
|
+
A: ["A"],
|
|
112152
|
+
C: ["C"],
|
|
112153
|
+
G: ["G"],
|
|
112154
|
+
T: ["T"],
|
|
112155
|
+
U: ["U"],
|
|
112156
|
+
R: ["A", "G"],
|
|
112157
|
+
Y: ["C", "T", "U"],
|
|
112158
|
+
K: ["G", "T", "U"],
|
|
112159
|
+
M: ["A", "C"],
|
|
112160
|
+
S: ["G", "C"],
|
|
112161
|
+
W: ["A", "T", "U"],
|
|
112162
|
+
B: ["C", "G", "T", "U"],
|
|
112163
|
+
D: ["A", "G", "T", "U"],
|
|
112164
|
+
H: ["A", "C", "T", "U"],
|
|
112165
|
+
V: ["A", "C", "G"],
|
|
112166
|
+
N: ["A", "C", "G", "T", "U"],
|
|
112167
|
+
X: ["A", "C", "G", "T", "U"]
|
|
112168
|
+
};
|
|
112169
|
+
function expandAndResolve(threeLetterCodon) {
|
|
112170
|
+
var _a2, _b2;
|
|
112171
|
+
const chars2 = threeLetterCodon.toUpperCase().split("");
|
|
112172
|
+
const picks = chars2.map((c2) => IUPAC[c2] || [c2]);
|
|
112173
|
+
let allPossibleThreeLetterCodons = [""];
|
|
112174
|
+
for (const set2 of picks) {
|
|
112175
|
+
const next = [];
|
|
112176
|
+
for (const prefix2 of allPossibleThreeLetterCodons) for (const b3 of set2) next.push(prefix2 + b3);
|
|
112177
|
+
allPossibleThreeLetterCodons = next;
|
|
112178
|
+
}
|
|
112179
|
+
let foundAminoAcid = null;
|
|
112180
|
+
for (const codon of allPossibleThreeLetterCodons) {
|
|
112181
|
+
const lowerCodon = codon.toLowerCase();
|
|
112182
|
+
const aminoAcidObj = (_b2 = (_a2 = initThreeLetterSequenceStringToAminoAcidMap[lowerCodon]) != null ? _a2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/u/g, "t")]) != null ? _b2 : initThreeLetterSequenceStringToAminoAcidMap[lowerCodon.replace(/t/g, "u")];
|
|
112183
|
+
if (aminoAcidObj) {
|
|
112184
|
+
if (!foundAminoAcid) {
|
|
112185
|
+
foundAminoAcid = aminoAcidObj;
|
|
112186
|
+
} else if (foundAminoAcid.value !== aminoAcidObj.value) {
|
|
112187
|
+
return null;
|
|
112188
|
+
}
|
|
112189
|
+
} else {
|
|
112190
|
+
return null;
|
|
112191
|
+
}
|
|
112192
|
+
}
|
|
112193
|
+
return foundAminoAcid;
|
|
112194
|
+
}
|
|
112195
|
+
__name(expandAndResolve, "expandAndResolve");
|
|
112196
|
+
function getCodonToAminoAcidMap() {
|
|
112197
|
+
const map2 = initThreeLetterSequenceStringToAminoAcidMap;
|
|
112198
|
+
const codes = Object.keys(IUPAC);
|
|
112199
|
+
for (const a2 of codes)
|
|
112200
|
+
for (const b3 of codes)
|
|
112201
|
+
for (const c2 of codes) {
|
|
112202
|
+
const codon = a2 + b3 + c2;
|
|
112203
|
+
const lowerCodon = codon.toLowerCase();
|
|
112204
|
+
if (map2[lowerCodon]) continue;
|
|
112205
|
+
const aminoAcidObj = expandAndResolve(codon);
|
|
112206
|
+
if (aminoAcidObj) map2[lowerCodon] = aminoAcidObj;
|
|
112207
|
+
}
|
|
112208
|
+
return map2;
|
|
112209
|
+
}
|
|
112210
|
+
__name(getCodonToAminoAcidMap, "getCodonToAminoAcidMap");
|
|
112211
|
+
const threeLetterSequenceStringToAminoAcidMap = getCodonToAminoAcidMap();
|
|
112147
112212
|
const degenerateDnaToAminoAcidMap = invert(aminoAcidToDegenerateDnaMap);
|
|
112148
112213
|
function getAminoAcidFromSequenceTriplet(sequenceString) {
|
|
112149
112214
|
sequenceString = sequenceString.toLowerCase();
|
|
@@ -112256,7 +112321,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
112256
112321
|
const aminoAcidDataForEachBaseOfDNA = [];
|
|
112257
112322
|
for (let index2 = 0; index2 < sequenceStringLength; index2 += 3) {
|
|
112258
112323
|
let aminoAcid;
|
|
112259
|
-
const aminoAcidIndex = index2 / 3;
|
|
112324
|
+
const aminoAcidIndex = Math.floor(index2 / 3);
|
|
112260
112325
|
let codonPositionsInCDS;
|
|
112261
112326
|
let basesRead;
|
|
112262
112327
|
if (isProteinSequence) {
|
|
@@ -152993,7 +153058,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
152993
153058
|
input.click();
|
|
152994
153059
|
}
|
|
152995
153060
|
__name(showFileDialog, "showFileDialog");
|
|
152996
|
-
const version = "0.7.
|
|
153061
|
+
const version = "0.7.37";
|
|
152997
153062
|
const packageJson = {
|
|
152998
153063
|
version
|
|
152999
153064
|
};
|
|
@@ -156557,6 +156622,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
156557
156622
|
[this.commandEnhancer],
|
|
156558
156623
|
e2,
|
|
156559
156624
|
() => {
|
|
156625
|
+
document.body.removeEventListener("cut", this.handleCut);
|
|
156626
|
+
document.body.removeEventListener("copy", this.handleCopy);
|
|
156560
156627
|
if (lastFocusedEl) {
|
|
156561
156628
|
lastFocusedEl.focus();
|
|
156562
156629
|
}
|
|
@@ -176675,19 +176742,13 @@ ${seqDataToCopy}\r
|
|
|
176675
176742
|
minWidth: 300
|
|
176676
176743
|
} : {
|
|
176677
176744
|
position: "fixed",
|
|
176678
|
-
top:
|
|
176745
|
+
top: 120,
|
|
176679
176746
|
right: 25,
|
|
176680
176747
|
padding: 10,
|
|
176681
176748
|
display: "flex",
|
|
176682
|
-
alignItems: "
|
|
176749
|
+
alignItems: "start",
|
|
176683
176750
|
paddingBottom: 5,
|
|
176684
|
-
|
|
176685
|
-
zIndex: "20000",
|
|
176686
|
-
borderBottom: "1px solid lightgrey",
|
|
176687
|
-
borderLeft: "1px solid lightgrey",
|
|
176688
|
-
borderRight: "1px solid lightgrey",
|
|
176689
|
-
borderBottomLeftRadius: "5px",
|
|
176690
|
-
borderBottomRightRadius: "5px"
|
|
176751
|
+
zIndex: 2e4
|
|
176691
176752
|
},
|
|
176692
176753
|
className: "veFindBar"
|
|
176693
176754
|
},
|
|
@@ -176702,7 +176763,10 @@ ${seqDataToCopy}\r
|
|
|
176702
176763
|
autoFocus: true,
|
|
176703
176764
|
style: __spreadValues({
|
|
176704
176765
|
resize: "vertical"
|
|
176705
|
-
}, !isInline && {
|
|
176766
|
+
}, !isInline && {
|
|
176767
|
+
width: 350,
|
|
176768
|
+
height: 190
|
|
176769
|
+
}),
|
|
176706
176770
|
className: "tg-find-tool-input",
|
|
176707
176771
|
inputRef: /* @__PURE__ */ __name((n2) => {
|
|
176708
176772
|
if (n2) this.inputEl = n2;
|
|
@@ -176748,12 +176812,10 @@ ${seqDataToCopy}\r
|
|
|
176748
176812
|
"div",
|
|
176749
176813
|
{
|
|
176750
176814
|
style: {
|
|
176815
|
+
marginLeft: 10,
|
|
176751
176816
|
display: "flex",
|
|
176752
|
-
|
|
176753
|
-
|
|
176754
|
-
justifyContent: "space-around",
|
|
176755
|
-
alignItems: "stretch",
|
|
176756
|
-
height: "76px"
|
|
176817
|
+
flexDirection: "column",
|
|
176818
|
+
gap: 5
|
|
176757
176819
|
}
|
|
176758
176820
|
},
|
|
176759
176821
|
rightEl,
|
|
@@ -176763,7 +176825,7 @@ ${seqDataToCopy}\r
|
|
|
176763
176825
|
Button,
|
|
176764
176826
|
{
|
|
176765
176827
|
minimal: true,
|
|
176766
|
-
style: { position: "absolute", bottom: 0, right:
|
|
176828
|
+
style: { position: "absolute", bottom: 0, right: 0 },
|
|
176767
176829
|
onClick: toggleFindTool2,
|
|
176768
176830
|
icon: "cross"
|
|
176769
176831
|
}
|
package/ove.css
CHANGED
|
@@ -11520,22 +11520,30 @@ path.partWithSelectedTag {
|
|
|
11520
11520
|
overflow: auto;
|
|
11521
11521
|
max-height: 50vh;
|
|
11522
11522
|
}
|
|
11523
|
-
|
|
11524
|
-
|
|
11523
|
+
.veFindBar {
|
|
11524
|
+
background: #ffffff;
|
|
11525
11525
|
border-bottom: 1px solid lightgrey;
|
|
11526
11526
|
border-left: 1px solid lightgrey;
|
|
11527
11527
|
border-right: 1px solid lightgrey;
|
|
11528
11528
|
border-bottom-left-radius: 5px;
|
|
11529
11529
|
border-bottom-right-radius: 5px;
|
|
11530
|
-
}
|
|
11530
|
+
}
|
|
11531
|
+
|
|
11531
11532
|
.veFindBar > .bp3-control {
|
|
11532
11533
|
margin-bottom: 0px;
|
|
11533
11534
|
}
|
|
11534
11535
|
.veFindBar > * {
|
|
11535
|
-
margin-right: 10px;
|
|
11536
11536
|
width: fit-content;
|
|
11537
11537
|
}
|
|
11538
11538
|
|
|
11539
|
+
.bp3-dark .veFindBar {
|
|
11540
|
+
border-radius: 5px;
|
|
11541
|
+
background: #30404d !important;
|
|
11542
|
+
border-bottom: 1px solid #202b33 !important;
|
|
11543
|
+
border-left: 1px solid #202b33 !important;
|
|
11544
|
+
border-right: 1px solid #202b33 !important;
|
|
11545
|
+
}
|
|
11546
|
+
|
|
11539
11547
|
.ve-find-options-popover > * {
|
|
11540
11548
|
margin: 10px 5px;
|
|
11541
11549
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.38",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@teselagen/range-utils": "0.3.13",
|
|
20
20
|
"@teselagen/react-list": "0.8.18",
|
|
21
21
|
"@teselagen/sequence-utils": "0.3.32",
|
|
22
|
-
"@teselagen/ui": "0.9.
|
|
22
|
+
"@teselagen/ui": "0.9.6",
|
|
23
23
|
"@use-gesture/react": "10.3.0",
|
|
24
24
|
"biomsa": "^0.2.4",
|
|
25
25
|
"classnames": "^2.3.2",
|
package/src/FindBar/index.js
CHANGED
|
@@ -270,19 +270,13 @@ export class FindBar extends React.Component {
|
|
|
270
270
|
}
|
|
271
271
|
: {
|
|
272
272
|
position: "fixed",
|
|
273
|
-
top:
|
|
273
|
+
top: 120,
|
|
274
274
|
right: 25,
|
|
275
275
|
padding: 10,
|
|
276
276
|
display: "flex",
|
|
277
|
-
alignItems: "
|
|
277
|
+
alignItems: "start",
|
|
278
278
|
paddingBottom: 5,
|
|
279
|
-
|
|
280
|
-
zIndex: "20000",
|
|
281
|
-
borderBottom: "1px solid lightgrey",
|
|
282
|
-
borderLeft: "1px solid lightgrey",
|
|
283
|
-
borderRight: "1px solid lightgrey",
|
|
284
|
-
borderBottomLeftRadius: "5px",
|
|
285
|
-
borderBottomRightRadius: "5px"
|
|
279
|
+
zIndex: 20000
|
|
286
280
|
}
|
|
287
281
|
}
|
|
288
282
|
className="veFindBar"
|
|
@@ -295,7 +289,10 @@ export class FindBar extends React.Component {
|
|
|
295
289
|
autoFocus
|
|
296
290
|
style={{
|
|
297
291
|
resize: "vertical",
|
|
298
|
-
...(!isInline && {
|
|
292
|
+
...(!isInline && {
|
|
293
|
+
width: 350,
|
|
294
|
+
height: 190
|
|
295
|
+
})
|
|
299
296
|
}}
|
|
300
297
|
className="tg-find-tool-input"
|
|
301
298
|
inputRef={n => {
|
|
@@ -347,12 +344,10 @@ export class FindBar extends React.Component {
|
|
|
347
344
|
{!isInline && (
|
|
348
345
|
<div
|
|
349
346
|
style={{
|
|
347
|
+
marginLeft: 10,
|
|
350
348
|
display: "flex",
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
justifyContent: "space-around",
|
|
354
|
-
alignItems: "stretch",
|
|
355
|
-
height: "76px"
|
|
349
|
+
flexDirection: "column",
|
|
350
|
+
gap: 5
|
|
356
351
|
}}
|
|
357
352
|
>
|
|
358
353
|
{rightEl}
|
|
@@ -362,7 +357,7 @@ export class FindBar extends React.Component {
|
|
|
362
357
|
{!isInline && (
|
|
363
358
|
<Button
|
|
364
359
|
minimal
|
|
365
|
-
style={{ position: "absolute", bottom: 0, right:
|
|
360
|
+
style={{ position: "absolute", bottom: 0, right: 0 }}
|
|
366
361
|
onClick={toggleFindTool}
|
|
367
362
|
icon="cross"
|
|
368
363
|
/>
|
package/src/FindBar/style.css
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
.veFindBar {
|
|
2
|
+
background: #ffffff;
|
|
3
3
|
border-bottom: 1px solid lightgrey;
|
|
4
4
|
border-left: 1px solid lightgrey;
|
|
5
5
|
border-right: 1px solid lightgrey;
|
|
6
6
|
border-bottom-left-radius: 5px;
|
|
7
7
|
border-bottom-right-radius: 5px;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
|
|
9
10
|
.veFindBar > .bp3-control {
|
|
10
11
|
margin-bottom: 0px;
|
|
11
12
|
}
|
|
12
13
|
.veFindBar > * {
|
|
13
|
-
margin-right: 10px;
|
|
14
14
|
width: fit-content;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.bp3-dark .veFindBar {
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
background: #30404d !important;
|
|
20
|
+
border-bottom: 1px solid #202b33 !important;
|
|
21
|
+
border-left: 1px solid #202b33 !important;
|
|
22
|
+
border-right: 1px solid #202b33 !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
.ve-find-options-popover > * {
|
|
18
26
|
margin: 10px 5px;
|
|
19
27
|
}
|
|
@@ -242,7 +242,11 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
242
242
|
seqDataToInsert.proteinSequence = seqDataToInsert.sequence;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
if (
|
|
245
|
+
if (
|
|
246
|
+
maxInsertSize &&
|
|
247
|
+
(seqDataToInsert.proteinSequence || seqDataToInsert.sequence).length >
|
|
248
|
+
maxInsertSize
|
|
249
|
+
) {
|
|
246
250
|
return window.toastr.error(
|
|
247
251
|
`Sorry, the pasted sequence exceeds the maximum allowed length of ${maxInsertSize}`
|
|
248
252
|
);
|
|
@@ -395,7 +399,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
395
399
|
sequenceData = { sequence: "" },
|
|
396
400
|
readOnly,
|
|
397
401
|
disableBpEditing,
|
|
398
|
-
maxInsertSize
|
|
402
|
+
maxInsertSize
|
|
399
403
|
// updateSequenceData,
|
|
400
404
|
// wrappedInsertSequenceDataAtPositionOrRange
|
|
401
405
|
// handleInsert
|
|
@@ -611,6 +615,7 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
611
615
|
const { sequenceData, readOnly, disableBpEditing, selectionLayer } =
|
|
612
616
|
this.props;
|
|
613
617
|
const { isProtein } = sequenceData;
|
|
618
|
+
|
|
614
619
|
// Add the appropriate listener
|
|
615
620
|
document.body.addEventListener("copy", this.handleCopy, { once: true });
|
|
616
621
|
document.body.addEventListener("cut", this.handleCut, { once: true });
|
|
@@ -836,6 +841,8 @@ function VectorInteractionHOC(Component /* options */) {
|
|
|
836
841
|
[this.commandEnhancer],
|
|
837
842
|
e,
|
|
838
843
|
() => {
|
|
844
|
+
document.body.removeEventListener("cut", this.handleCut);
|
|
845
|
+
document.body.removeEventListener("copy", this.handleCopy);
|
|
839
846
|
if (lastFocusedEl) {
|
|
840
847
|
lastFocusedEl.focus();
|
|
841
848
|
}
|