@teselagen/sequence-utils 0.3.27 → 0.3.28-beta.1
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
CHANGED
|
@@ -8715,12 +8715,18 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
8715
8715
|
let positionInCodon = 0;
|
|
8716
8716
|
for (let i = 0; i < basesRead; i++) {
|
|
8717
8717
|
const posInCds = i + index;
|
|
8718
|
+
const sequenceIndex = codonPositionsInCDS.includes(posInCds) ? absoluteCodonPositions[codonPositionsInCDS.indexOf(posInCds)] : positionInCdsToPositionInMainSequence(
|
|
8719
|
+
posInCds,
|
|
8720
|
+
forward,
|
|
8721
|
+
translationRange,
|
|
8722
|
+
originalSequenceStringLength
|
|
8723
|
+
);
|
|
8718
8724
|
if (codonPositionsInCDS.includes(posInCds)) {
|
|
8719
8725
|
aminoAcidDataForEachBaseOfDNA.push({
|
|
8720
8726
|
aminoAcid,
|
|
8721
8727
|
positionInCodon,
|
|
8722
8728
|
aminoAcidIndex,
|
|
8723
|
-
sequenceIndex
|
|
8729
|
+
sequenceIndex,
|
|
8724
8730
|
codonRange,
|
|
8725
8731
|
fullCodon: codonPositionsInCDS.length === 3
|
|
8726
8732
|
});
|
|
@@ -8730,12 +8736,7 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
8730
8736
|
aminoAcid: null,
|
|
8731
8737
|
positionInCodon: null,
|
|
8732
8738
|
aminoAcidIndex: null,
|
|
8733
|
-
sequenceIndex
|
|
8734
|
-
posInCds,
|
|
8735
|
-
forward,
|
|
8736
|
-
translationRange,
|
|
8737
|
-
originalSequenceStringLength
|
|
8738
|
-
),
|
|
8739
|
+
sequenceIndex,
|
|
8739
8740
|
codonRange: null,
|
|
8740
8741
|
fullCodon: null
|
|
8741
8742
|
});
|
|
@@ -17427,6 +17428,7 @@ const defaultEnzymes = [
|
|
|
17427
17428
|
"banii",
|
|
17428
17429
|
"bari",
|
|
17429
17430
|
"baui",
|
|
17431
|
+
"bbsi",
|
|
17430
17432
|
"bbvbi",
|
|
17431
17433
|
"bcni",
|
|
17432
17434
|
"bcoki",
|
package/index.js
CHANGED
|
@@ -8713,12 +8713,18 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
8713
8713
|
let positionInCodon = 0;
|
|
8714
8714
|
for (let i = 0; i < basesRead; i++) {
|
|
8715
8715
|
const posInCds = i + index;
|
|
8716
|
+
const sequenceIndex = codonPositionsInCDS.includes(posInCds) ? absoluteCodonPositions[codonPositionsInCDS.indexOf(posInCds)] : positionInCdsToPositionInMainSequence(
|
|
8717
|
+
posInCds,
|
|
8718
|
+
forward,
|
|
8719
|
+
translationRange,
|
|
8720
|
+
originalSequenceStringLength
|
|
8721
|
+
);
|
|
8716
8722
|
if (codonPositionsInCDS.includes(posInCds)) {
|
|
8717
8723
|
aminoAcidDataForEachBaseOfDNA.push({
|
|
8718
8724
|
aminoAcid,
|
|
8719
8725
|
positionInCodon,
|
|
8720
8726
|
aminoAcidIndex,
|
|
8721
|
-
sequenceIndex
|
|
8727
|
+
sequenceIndex,
|
|
8722
8728
|
codonRange,
|
|
8723
8729
|
fullCodon: codonPositionsInCDS.length === 3
|
|
8724
8730
|
});
|
|
@@ -8728,12 +8734,7 @@ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optio
|
|
|
8728
8734
|
aminoAcid: null,
|
|
8729
8735
|
positionInCodon: null,
|
|
8730
8736
|
aminoAcidIndex: null,
|
|
8731
|
-
sequenceIndex
|
|
8732
|
-
posInCds,
|
|
8733
|
-
forward,
|
|
8734
|
-
translationRange,
|
|
8735
|
-
originalSequenceStringLength
|
|
8736
|
-
),
|
|
8737
|
+
sequenceIndex,
|
|
8737
8738
|
codonRange: null,
|
|
8738
8739
|
fullCodon: null
|
|
8739
8740
|
});
|
|
@@ -17425,6 +17426,7 @@ const defaultEnzymes = [
|
|
|
17425
17426
|
"banii",
|
|
17426
17427
|
"bari",
|
|
17427
17428
|
"baui",
|
|
17429
|
+
"bbsi",
|
|
17428
17430
|
"bbvbi",
|
|
17429
17431
|
"bcni",
|
|
17430
17432
|
"bcoki",
|
package/index.umd.cjs
CHANGED
|
@@ -8717,12 +8717,18 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
8717
8717
|
let positionInCodon = 0;
|
|
8718
8718
|
for (let i = 0; i < basesRead; i++) {
|
|
8719
8719
|
const posInCds = i + index;
|
|
8720
|
+
const sequenceIndex = codonPositionsInCDS.includes(posInCds) ? absoluteCodonPositions[codonPositionsInCDS.indexOf(posInCds)] : positionInCdsToPositionInMainSequence(
|
|
8721
|
+
posInCds,
|
|
8722
|
+
forward,
|
|
8723
|
+
translationRange,
|
|
8724
|
+
originalSequenceStringLength
|
|
8725
|
+
);
|
|
8720
8726
|
if (codonPositionsInCDS.includes(posInCds)) {
|
|
8721
8727
|
aminoAcidDataForEachBaseOfDNA.push({
|
|
8722
8728
|
aminoAcid,
|
|
8723
8729
|
positionInCodon,
|
|
8724
8730
|
aminoAcidIndex,
|
|
8725
|
-
sequenceIndex
|
|
8731
|
+
sequenceIndex,
|
|
8726
8732
|
codonRange,
|
|
8727
8733
|
fullCodon: codonPositionsInCDS.length === 3
|
|
8728
8734
|
});
|
|
@@ -8732,12 +8738,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
8732
8738
|
aminoAcid: null,
|
|
8733
8739
|
positionInCodon: null,
|
|
8734
8740
|
aminoAcidIndex: null,
|
|
8735
|
-
sequenceIndex
|
|
8736
|
-
posInCds,
|
|
8737
|
-
forward,
|
|
8738
|
-
translationRange,
|
|
8739
|
-
originalSequenceStringLength
|
|
8740
|
-
),
|
|
8741
|
+
sequenceIndex,
|
|
8741
8742
|
codonRange: null,
|
|
8742
8743
|
fullCodon: null
|
|
8743
8744
|
});
|
|
@@ -17429,6 +17430,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
17429
17430
|
"banii",
|
|
17430
17431
|
"bari",
|
|
17431
17432
|
"baui",
|
|
17433
|
+
"bbsi",
|
|
17432
17434
|
"bbvbi",
|
|
17433
17435
|
"bcni",
|
|
17434
17436
|
"bcoki",
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/sequence-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28-beta.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"dependencies": {
|
|
5
|
-
"@teselagen/range-utils": "0.3.
|
|
6
|
+
"@teselagen/range-utils": "0.3.10",
|
|
6
7
|
"bson-objectid": "^2.0.4",
|
|
7
8
|
"escape-string-regexp": "^5.0.0",
|
|
8
9
|
"jsondiffpatch": "0.4.1",
|
|
9
10
|
"string-splice": "^1.3.0"
|
|
10
11
|
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./index.js",
|
|
15
|
+
"require": "./index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
11
18
|
"license": "MIT"
|
|
12
19
|
}
|
|
@@ -28,8 +28,7 @@ function getNextTriplet(index, sequenceString, exonRange) {
|
|
|
28
28
|
// including introns.
|
|
29
29
|
const codonPositions = [];
|
|
30
30
|
|
|
31
|
-
// A function to check if a base is within an exon
|
|
32
|
-
// to avoid function creation in the loop (linter error)
|
|
31
|
+
// A function to check if a base is within an exon
|
|
33
32
|
const isBaseInExon = baseIndex =>
|
|
34
33
|
exonRange.some(r =>
|
|
35
34
|
isPositionWithinRange(baseIndex, r, sequenceString.length, true, false)
|
|
@@ -251,28 +250,31 @@ export default function getAminoAcidDataForEachBaseOfDna(
|
|
|
251
250
|
let positionInCodon = 0;
|
|
252
251
|
for (let i = 0; i < basesRead; i++) {
|
|
253
252
|
const posInCds = i + index;
|
|
253
|
+
const sequenceIndex = codonPositionsInCDS.includes(posInCds)
|
|
254
|
+
? absoluteCodonPositions[codonPositionsInCDS.indexOf(posInCds)]
|
|
255
|
+
: positionInCdsToPositionInMainSequence(
|
|
256
|
+
posInCds,
|
|
257
|
+
forward,
|
|
258
|
+
translationRange,
|
|
259
|
+
originalSequenceStringLength
|
|
260
|
+
);
|
|
254
261
|
if (codonPositionsInCDS.includes(posInCds)) {
|
|
255
262
|
aminoAcidDataForEachBaseOfDNA.push({
|
|
256
263
|
aminoAcid,
|
|
257
264
|
positionInCodon,
|
|
258
265
|
aminoAcidIndex,
|
|
259
|
-
sequenceIndex
|
|
266
|
+
sequenceIndex,
|
|
260
267
|
codonRange,
|
|
261
268
|
fullCodon: codonPositionsInCDS.length === 3
|
|
262
269
|
});
|
|
263
270
|
positionInCodon++;
|
|
264
271
|
} else {
|
|
265
|
-
//
|
|
272
|
+
// push a null object for intron bases
|
|
266
273
|
aminoAcidDataForEachBaseOfDNA.push({
|
|
267
274
|
aminoAcid: null,
|
|
268
275
|
positionInCodon: null,
|
|
269
276
|
aminoAcidIndex: null,
|
|
270
|
-
sequenceIndex
|
|
271
|
-
posInCds,
|
|
272
|
-
forward,
|
|
273
|
-
translationRange,
|
|
274
|
-
originalSequenceStringLength
|
|
275
|
-
),
|
|
277
|
+
sequenceIndex,
|
|
276
278
|
codonRange: null,
|
|
277
279
|
fullCodon: null
|
|
278
280
|
});
|