@teselagen/bio-parsers 0.4.15 → 0.4.17
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/genbankToJson.d.ts +1 -1
- package/index.cjs +28840 -0
- package/index.d.ts +16 -16
- package/index.js +2204 -6183
- package/index.mjs +82 -29
- package/index.umd.cjs +28844 -0
- package/index.umd.js +82 -29
- package/package.json +1 -1
- package/src/genbankToJson.js +94 -43
- package/src/geneiousXmlToJson.js +2 -2
- package/src/gffToJson.js +1 -1
- package/src/jbeiXmlToJson.js +1 -1
- package/src/jsonToGenbank.js +3 -3
- package/src/jsonToJsonString.js +1 -1
- package/src/sbolXmlToJson.js +1 -1
- package/src/snapgeneToJson.js +1 -1
- package/src/utils/cleanUpTeselagenJsonForExport.js +1 -1
- package/src/utils/searchWholeObjByName.js +1 -1
- package/src/utils/validateSequence.js +3 -3
package/index.umd.js
CHANGED
|
@@ -11508,6 +11508,26 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11508
11508
|
return aaString.split("").map((char) => aminoAcidToDegenerateDnaMap[char.toLowerCase()] || "nnn").join("");
|
|
11509
11509
|
}
|
|
11510
11510
|
__name(getDegenerateDnaStringFromAAString, "getDegenerateDnaStringFromAAString");
|
|
11511
|
+
function getAminoAcidStringFromSequenceString(sequenceString, { doNotExcludeAsterisk } = {}) {
|
|
11512
|
+
const aminoAcidsPerBase = getAminoAcidDataForEachBaseOfDna(
|
|
11513
|
+
sequenceString,
|
|
11514
|
+
true
|
|
11515
|
+
);
|
|
11516
|
+
const aaArray = [];
|
|
11517
|
+
let aaString = "";
|
|
11518
|
+
aminoAcidsPerBase.forEach((aa, index) => {
|
|
11519
|
+
if (!aa.fullCodon) {
|
|
11520
|
+
return;
|
|
11521
|
+
}
|
|
11522
|
+
if (!doNotExcludeAsterisk && index >= aminoAcidsPerBase.length - 3 && aa.aminoAcid.value === "*") {
|
|
11523
|
+
return;
|
|
11524
|
+
}
|
|
11525
|
+
aaArray[aa.aminoAcidIndex] = aa.aminoAcid.value;
|
|
11526
|
+
});
|
|
11527
|
+
aaString = aaArray.join("");
|
|
11528
|
+
return aaString;
|
|
11529
|
+
}
|
|
11530
|
+
__name(getAminoAcidStringFromSequenceString, "getAminoAcidStringFromSequenceString");
|
|
11511
11531
|
function tidyUpSequenceData(pSeqData, options = {}) {
|
|
11512
11532
|
const {
|
|
11513
11533
|
annotationsAsObjects,
|
|
@@ -11515,6 +11535,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11515
11535
|
doNotRemoveInvalidChars,
|
|
11516
11536
|
additionalValidChars,
|
|
11517
11537
|
noTranslationData,
|
|
11538
|
+
includeProteinSequence,
|
|
11518
11539
|
doNotProvideIdsForAnnotations,
|
|
11519
11540
|
noCdsTranslations,
|
|
11520
11541
|
convertAnnotationsFromAAIndices,
|
|
@@ -11548,7 +11569,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11548
11569
|
}
|
|
11549
11570
|
if (!doNotRemoveInvalidChars) {
|
|
11550
11571
|
if (seqData.isProtein) {
|
|
11551
|
-
const [newSeq] = filterSequenceString(seqData.proteinSequence, __spreadValues({}, topLevelSeqData || seqData)
|
|
11572
|
+
const [newSeq] = filterSequenceString(seqData.proteinSequence, __spreadProps(__spreadValues({}, topLevelSeqData || seqData), {
|
|
11573
|
+
isProtein: true
|
|
11574
|
+
}));
|
|
11552
11575
|
seqData.proteinSequence = newSeq;
|
|
11553
11576
|
} else {
|
|
11554
11577
|
const [newSeq] = filterSequenceString(seqData.sequence, __spreadValues({
|
|
@@ -11569,6 +11592,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11569
11592
|
null,
|
|
11570
11593
|
true
|
|
11571
11594
|
);
|
|
11595
|
+
} else if (includeProteinSequence) {
|
|
11596
|
+
seqData.proteinSequence = getAminoAcidStringFromSequenceString(
|
|
11597
|
+
seqData.sequence
|
|
11598
|
+
);
|
|
11572
11599
|
}
|
|
11573
11600
|
seqData.size = seqData.noSequence ? seqData.size : seqData.sequence.length;
|
|
11574
11601
|
seqData.proteinSize = seqData.noSequence ? seqData.proteinSize : seqData.proteinSequence.length;
|
|
@@ -19789,19 +19816,38 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19789
19816
|
return parsingResultArray;
|
|
19790
19817
|
}
|
|
19791
19818
|
__name(flattenSequenceArray, "flattenSequenceArray");
|
|
19819
|
+
function wrapOriginSpanningFeatures(locArrayInput, sequenceLength, inclusive1BasedStart, inclusive1BasedEnd) {
|
|
19820
|
+
const locArrayOutput = locArrayInput.map((loc) => __spreadValues({}, loc));
|
|
19821
|
+
for (let i2 = 0; i2 < locArrayOutput.length - 1; i2++) {
|
|
19822
|
+
const firstFeature = locArrayOutput[i2];
|
|
19823
|
+
const secondFeature = locArrayOutput[i2 + 1];
|
|
19824
|
+
if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
|
|
19825
|
+
locArrayOutput[i2] = {
|
|
19826
|
+
start: firstFeature.start,
|
|
19827
|
+
end: secondFeature.end
|
|
19828
|
+
};
|
|
19829
|
+
locArrayOutput.splice(i2 + 1, 1);
|
|
19830
|
+
}
|
|
19831
|
+
}
|
|
19832
|
+
return locArrayOutput;
|
|
19833
|
+
}
|
|
19834
|
+
__name(wrapOriginSpanningFeatures, "wrapOriginSpanningFeatures");
|
|
19792
19835
|
function parseFeatureLocation(locStr, isProtein, inclusive1BasedStart, inclusive1BasedEnd, isCircular, sequenceLength) {
|
|
19793
19836
|
locStr = locStr.trim();
|
|
19794
|
-
const
|
|
19795
|
-
locStr.
|
|
19796
|
-
|
|
19837
|
+
const positionsArray = [];
|
|
19838
|
+
const locationParts = locStr.split(",");
|
|
19839
|
+
locationParts.forEach((locPart) => {
|
|
19840
|
+
const extractedPositions = locPart.match(/(\d+)/g);
|
|
19841
|
+
if (extractedPositions === null) {
|
|
19842
|
+
return;
|
|
19843
|
+
}
|
|
19844
|
+
positionsArray.push(extractedPositions[0]);
|
|
19845
|
+
positionsArray.push(extractedPositions[1] || extractedPositions[0]);
|
|
19797
19846
|
});
|
|
19798
19847
|
const locArray = [];
|
|
19799
|
-
for (let i2 = 0; i2 <
|
|
19800
|
-
const start = parseInt(
|
|
19801
|
-
|
|
19802
|
-
if (isNaN(end)) {
|
|
19803
|
-
end = start;
|
|
19804
|
-
}
|
|
19848
|
+
for (let i2 = 0; i2 < positionsArray.length; i2 += 2) {
|
|
19849
|
+
const start = parseInt(positionsArray[i2], 10) - (inclusive1BasedStart ? 0 : 1);
|
|
19850
|
+
const end = parseInt(positionsArray[i2 + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
|
|
19805
19851
|
const location = {
|
|
19806
19852
|
start,
|
|
19807
19853
|
end
|
|
@@ -19810,20 +19856,16 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19810
19856
|
isProtein ? convertAACaretPositionOrRangeToDna(location) : location
|
|
19811
19857
|
);
|
|
19812
19858
|
}
|
|
19813
|
-
if (isCircular) {
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
locArray.splice(i2 + 1, 1);
|
|
19823
|
-
}
|
|
19824
|
-
}
|
|
19859
|
+
if (isCircular && sequenceLength) {
|
|
19860
|
+
return wrapOriginSpanningFeatures(
|
|
19861
|
+
locArray,
|
|
19862
|
+
sequenceLength,
|
|
19863
|
+
inclusive1BasedStart,
|
|
19864
|
+
inclusive1BasedEnd
|
|
19865
|
+
);
|
|
19866
|
+
} else {
|
|
19867
|
+
return locArray;
|
|
19825
19868
|
}
|
|
19826
|
-
return locArray;
|
|
19827
19869
|
}
|
|
19828
19870
|
__name(parseFeatureLocation, "parseFeatureLocation");
|
|
19829
19871
|
function genbankToJson(string, options = {}) {
|
|
@@ -19920,7 +19962,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19920
19962
|
parseOrigin(line, key);
|
|
19921
19963
|
break;
|
|
19922
19964
|
case genbankAnnotationKey.END_SEQUENCE_TAG:
|
|
19923
|
-
endSeq();
|
|
19965
|
+
endSeq(options);
|
|
19924
19966
|
break;
|
|
19925
19967
|
case genbankAnnotationKey.DEFINITION_TAG:
|
|
19926
19968
|
line = line.replace(/DEFINITION/, "");
|
|
@@ -20025,9 +20067,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20025
20067
|
}
|
|
20026
20068
|
});
|
|
20027
20069
|
return results;
|
|
20028
|
-
function endSeq() {
|
|
20070
|
+
function endSeq(options2) {
|
|
20029
20071
|
hasFoundLocus = false;
|
|
20030
|
-
postProcessCurSeq();
|
|
20072
|
+
postProcessCurSeq(options2);
|
|
20031
20073
|
resultsArray.push(result || { success: false });
|
|
20032
20074
|
}
|
|
20033
20075
|
__name(endSeq, "endSeq");
|
|
@@ -20041,11 +20083,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20041
20083
|
}
|
|
20042
20084
|
}
|
|
20043
20085
|
__name(addMessage, "addMessage");
|
|
20044
|
-
function postProcessCurSeq() {
|
|
20086
|
+
function postProcessCurSeq(options2) {
|
|
20045
20087
|
if (result && result.parsedSequence && result.parsedSequence.features) {
|
|
20046
20088
|
for (let i2 = 0; i2 < result.parsedSequence.features.length; i2++) {
|
|
20047
20089
|
result.parsedSequence.features[i2] = postProcessGenbankFeature(
|
|
20048
|
-
result.parsedSequence.features[i2]
|
|
20090
|
+
result.parsedSequence.features[i2],
|
|
20091
|
+
result.parsedSequence,
|
|
20092
|
+
options2
|
|
20049
20093
|
);
|
|
20050
20094
|
}
|
|
20051
20095
|
}
|
|
@@ -20291,7 +20335,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20291
20335
|
return runon;
|
|
20292
20336
|
}
|
|
20293
20337
|
__name(isKeywordRunon, "isKeywordRunon");
|
|
20294
|
-
function postProcessGenbankFeature(feat) {
|
|
20338
|
+
function postProcessGenbankFeature(feat, parsedSequence, options2) {
|
|
20295
20339
|
if (feat.notes.label) {
|
|
20296
20340
|
feat.name = feat.notes.label[0];
|
|
20297
20341
|
} else if (feat.notes.gene) {
|
|
@@ -20324,6 +20368,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20324
20368
|
feat.arrowheadType = feat.notes.direction[0].toUpperCase() === "BOTH" ? "BOTH" : feat.notes.direction[0].toUpperCase() === "NONE" ? "NONE" : void 0;
|
|
20325
20369
|
delete feat.notes.direction;
|
|
20326
20370
|
}
|
|
20371
|
+
if (parsedSequence.circular) {
|
|
20372
|
+
const { inclusive1BasedStart: inclusive1BasedStart2, inclusive1BasedEnd: inclusive1BasedEnd2 } = options2;
|
|
20373
|
+
feat.locations = wrapOriginSpanningFeatures(
|
|
20374
|
+
feat.locations,
|
|
20375
|
+
parsedSequence.sequence.length,
|
|
20376
|
+
inclusive1BasedStart2,
|
|
20377
|
+
inclusive1BasedEnd2
|
|
20378
|
+
);
|
|
20379
|
+
}
|
|
20327
20380
|
return feat;
|
|
20328
20381
|
}
|
|
20329
20382
|
__name(postProcessGenbankFeature, "postProcessGenbankFeature");
|
package/package.json
CHANGED
package/src/genbankToJson.js
CHANGED
|
@@ -8,6 +8,40 @@ import splitStringIntoLines from "./utils/splitStringIntoLines.js";
|
|
|
8
8
|
|
|
9
9
|
import createInitialSequence from "./utils/createInitialSequence";
|
|
10
10
|
|
|
11
|
+
function wrapOriginSpanningFeatures(
|
|
12
|
+
locArrayInput,
|
|
13
|
+
sequenceLength,
|
|
14
|
+
inclusive1BasedStart,
|
|
15
|
+
inclusive1BasedEnd
|
|
16
|
+
) {
|
|
17
|
+
// In genbank files, locations of origin-spanning features are represented as follows:
|
|
18
|
+
// complement(join(490883..490885,1..879)) (for a circular sequence of length 490885)
|
|
19
|
+
// Then, for locations in locArray we check if there is a location that ends at sequenceLength
|
|
20
|
+
// joined with a location that starts at 1. If so, we merge them into a single location.
|
|
21
|
+
// (see https://github.com/TeselaGen/tg-oss/issues/35)
|
|
22
|
+
|
|
23
|
+
// make a deep copy of the array to avoid modifying the original
|
|
24
|
+
const locArrayOutput = locArrayInput.map(loc => ({ ...loc }));
|
|
25
|
+
|
|
26
|
+
// Iterate by pairs of features
|
|
27
|
+
for (let i = 0; i < locArrayOutput.length - 1; i++) {
|
|
28
|
+
const firstFeature = locArrayOutput[i];
|
|
29
|
+
const secondFeature = locArrayOutput[i + 1];
|
|
30
|
+
if (
|
|
31
|
+
firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) &&
|
|
32
|
+
secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)
|
|
33
|
+
) {
|
|
34
|
+
// Merge the two features
|
|
35
|
+
locArrayOutput[i] = {
|
|
36
|
+
start: firstFeature.start,
|
|
37
|
+
end: secondFeature.end
|
|
38
|
+
};
|
|
39
|
+
locArrayOutput.splice(i + 1, 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return locArrayOutput;
|
|
43
|
+
}
|
|
44
|
+
|
|
11
45
|
export function parseFeatureLocation(
|
|
12
46
|
locStr,
|
|
13
47
|
isProtein,
|
|
@@ -17,22 +51,37 @@ export function parseFeatureLocation(
|
|
|
17
51
|
sequenceLength
|
|
18
52
|
) {
|
|
19
53
|
locStr = locStr.trim();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
54
|
+
const positionsArray = [];
|
|
55
|
+
// Genbank feature locations can be:
|
|
56
|
+
// 4 -> single base (equivalent to 4..4)
|
|
57
|
+
// 4..8 -> range
|
|
58
|
+
// complement(4..8) -> complement of range
|
|
59
|
+
// join(4..8, 10..12) -> join of ranges
|
|
60
|
+
// complement(join(4..8, 10..12)) -> complement of join of ranges
|
|
61
|
+
// but also
|
|
62
|
+
// join(4, 10..12) -> join of single base and range
|
|
63
|
+
// First we split with commas to obtain pairs of positions
|
|
64
|
+
const locationParts = locStr.split(",");
|
|
65
|
+
locationParts.forEach(locPart => {
|
|
66
|
+
// Extract two integers from loc, if only one is present
|
|
67
|
+
// we push the same one as the end (e.g. if location is `4` we push
|
|
68
|
+
// 4 twice
|
|
69
|
+
const extractedPositions = locPart.match(/(\d+)/g);
|
|
70
|
+
// Sometimes the location is split between two lines and has a trailing comma
|
|
71
|
+
if (extractedPositions === null) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
positionsArray.push(extractedPositions[0]);
|
|
75
|
+
positionsArray.push(extractedPositions[1] || extractedPositions[0]);
|
|
23
76
|
});
|
|
77
|
+
|
|
24
78
|
const locArray = [];
|
|
25
|
-
for (let i = 0; i <
|
|
26
|
-
const start =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//147
|
|
32
|
-
//function like:
|
|
33
|
-
//147..147
|
|
34
|
-
end = start;
|
|
35
|
-
}
|
|
79
|
+
for (let i = 0; i < positionsArray.length; i += 2) {
|
|
80
|
+
const start =
|
|
81
|
+
parseInt(positionsArray[i], 10) - (inclusive1BasedStart ? 0 : 1);
|
|
82
|
+
const end =
|
|
83
|
+
parseInt(positionsArray[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
|
|
84
|
+
|
|
36
85
|
const location = {
|
|
37
86
|
start: start,
|
|
38
87
|
end: end
|
|
@@ -41,31 +90,21 @@ export function parseFeatureLocation(
|
|
|
41
90
|
isProtein ? convertAACaretPositionOrRangeToDna(location) : location
|
|
42
91
|
);
|
|
43
92
|
}
|
|
44
|
-
// In genbank files, origin-spanning features are represented as follows:
|
|
45
|
-
// complement(join(490883..490885,1..879)) (for a circular sequence of length 490885)
|
|
46
|
-
// Then, for locations in locArray we check if there is a feature that ends at sequenceLength
|
|
47
|
-
// joined with a feature that starts at 1. If so, we merge them into a single feature.
|
|
48
|
-
// (see https://github.com/TeselaGen/tg-oss/issues/35)
|
|
49
93
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
locArray.splice(i + 1, 1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
94
|
+
// sequenceLength will not be set when this is called during genbank parsing,
|
|
95
|
+
// and the wrapping is done in endSeq > postProcessCurSeq > postProcessGenbankFeature
|
|
96
|
+
// However, this is useful if the function is used as a standalone parser of
|
|
97
|
+
// feature locations.
|
|
98
|
+
if (isCircular && sequenceLength) {
|
|
99
|
+
return wrapOriginSpanningFeatures(
|
|
100
|
+
locArray,
|
|
101
|
+
sequenceLength,
|
|
102
|
+
inclusive1BasedStart,
|
|
103
|
+
inclusive1BasedEnd
|
|
104
|
+
);
|
|
105
|
+
} else {
|
|
106
|
+
return locArray;
|
|
67
107
|
}
|
|
68
|
-
return locArray;
|
|
69
108
|
}
|
|
70
109
|
|
|
71
110
|
function genbankToJson(string, options = {}) {
|
|
@@ -182,7 +221,7 @@ function genbankToJson(string, options = {}) {
|
|
|
182
221
|
parseOrigin(line, key);
|
|
183
222
|
break;
|
|
184
223
|
case genbankAnnotationKey.END_SEQUENCE_TAG:
|
|
185
|
-
endSeq();
|
|
224
|
+
endSeq(options);
|
|
186
225
|
break;
|
|
187
226
|
case genbankAnnotationKey.DEFINITION_TAG:
|
|
188
227
|
line = line.replace(/DEFINITION/, "");
|
|
@@ -321,10 +360,10 @@ function genbankToJson(string, options = {}) {
|
|
|
321
360
|
|
|
322
361
|
return results;
|
|
323
362
|
|
|
324
|
-
function endSeq() {
|
|
363
|
+
function endSeq(options) {
|
|
325
364
|
//do some post processing clean-up
|
|
326
365
|
hasFoundLocus = false;
|
|
327
|
-
postProcessCurSeq();
|
|
366
|
+
postProcessCurSeq(options);
|
|
328
367
|
//push the result into the resultsArray
|
|
329
368
|
resultsArray.push(result || { success: false });
|
|
330
369
|
}
|
|
@@ -341,11 +380,13 @@ function genbankToJson(string, options = {}) {
|
|
|
341
380
|
}
|
|
342
381
|
}
|
|
343
382
|
|
|
344
|
-
function postProcessCurSeq() {
|
|
383
|
+
function postProcessCurSeq(options) {
|
|
345
384
|
if (result && result.parsedSequence && result.parsedSequence.features) {
|
|
346
385
|
for (let i = 0; i < result.parsedSequence.features.length; i++) {
|
|
347
386
|
result.parsedSequence.features[i] = postProcessGenbankFeature(
|
|
348
|
-
result.parsedSequence.features[i]
|
|
387
|
+
result.parsedSequence.features[i],
|
|
388
|
+
result.parsedSequence,
|
|
389
|
+
options
|
|
349
390
|
);
|
|
350
391
|
}
|
|
351
392
|
}
|
|
@@ -656,7 +697,7 @@ function genbankToJson(string, options = {}) {
|
|
|
656
697
|
return runon;
|
|
657
698
|
}
|
|
658
699
|
|
|
659
|
-
function postProcessGenbankFeature(feat) {
|
|
700
|
+
function postProcessGenbankFeature(feat, parsedSequence, options) {
|
|
660
701
|
if (feat.notes.label) {
|
|
661
702
|
feat.name = feat.notes.label[0];
|
|
662
703
|
} else if (feat.notes.gene) {
|
|
@@ -697,6 +738,16 @@ function genbankToJson(string, options = {}) {
|
|
|
697
738
|
: undefined;
|
|
698
739
|
delete feat.notes.direction;
|
|
699
740
|
}
|
|
741
|
+
if (parsedSequence.circular) {
|
|
742
|
+
const { inclusive1BasedStart, inclusive1BasedEnd } = options;
|
|
743
|
+
feat.locations = wrapOriginSpanningFeatures(
|
|
744
|
+
feat.locations,
|
|
745
|
+
parsedSequence.sequence.length,
|
|
746
|
+
inclusive1BasedStart,
|
|
747
|
+
inclusive1BasedEnd
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
|
|
700
751
|
return feat;
|
|
701
752
|
}
|
|
702
753
|
}
|
package/src/geneiousXmlToJson.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "./utils/searchWholeObjByName";
|
|
8
8
|
|
|
9
9
|
import { XMLParser } from "fast-xml-parser";
|
|
10
|
-
import { forEach, flatMap } from "lodash";
|
|
11
|
-
import { filter } from "lodash";
|
|
10
|
+
import { forEach, flatMap } from "lodash-es";
|
|
11
|
+
import { filter } from "lodash-es";
|
|
12
12
|
|
|
13
13
|
//Here's what should be in the callback:
|
|
14
14
|
// {
|
package/src/gffToJson.js
CHANGED
package/src/jbeiXmlToJson.js
CHANGED
package/src/jsonToGenbank.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-var*/
|
|
2
|
-
import { get, cloneDeep, map, each, isObject, flatMap } from "lodash";
|
|
2
|
+
import { get, cloneDeep, map, each, isObject, flatMap } from "lodash-es";
|
|
3
3
|
import color from "color";
|
|
4
4
|
|
|
5
5
|
import pragmasAndTypes from "./utils/pragmasAndTypes.js";
|
|
@@ -343,8 +343,8 @@ function featureToGenbankString(feat, options) {
|
|
|
343
343
|
feat.arrowheadType.toUpperCase() === "BOTH"
|
|
344
344
|
? "BOTH"
|
|
345
345
|
: feat.arrowheadType.toUpperCase() === "NONE"
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
? "NONE"
|
|
347
|
+
: undefined;
|
|
348
348
|
|
|
349
349
|
if (valToAdd) addToNotes(feat, "direction", valToAdd);
|
|
350
350
|
}
|
package/src/jsonToJsonString.js
CHANGED
package/src/sbolXmlToJson.js
CHANGED
package/src/snapgeneToJson.js
CHANGED
|
@@ -9,7 +9,7 @@ import getArrayBufferFromFile from "./utils/getArrayBufferFromFile";
|
|
|
9
9
|
import createInitialSequence from "./utils/createInitialSequence";
|
|
10
10
|
import validateSequenceArray from "./utils/validateSequenceArray";
|
|
11
11
|
import flattenSequenceArray from "./utils/flattenSequenceArray";
|
|
12
|
-
import { get } from "lodash";
|
|
12
|
+
import { get } from "lodash-es";
|
|
13
13
|
import { XMLParser } from "fast-xml-parser";
|
|
14
14
|
import extractFileExtension from "./utils/extractFileExtension";
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//tnr: taken from https://github.com/angus-c/waldojs (not using waldojs as it is not being maintained and pulled in nasty babel runtime transforms)
|
|
2
2
|
/* eslint-disable eqeqeq */
|
|
3
|
-
import { isEqual } from "lodash";
|
|
3
|
+
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
5
|
class Match {
|
|
6
6
|
constructor(props) {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
filterSequenceString,
|
|
5
5
|
guessIfSequenceIsDnaAndNotProtein
|
|
6
6
|
} from "@teselagen/sequence-utils";
|
|
7
|
-
import { filter, some, upperFirst } from "lodash";
|
|
7
|
+
import { filter, some, upperFirst } from "lodash-es";
|
|
8
8
|
import pragmasAndTypes from "./pragmasAndTypes.js";
|
|
9
|
-
import { forEach } from "lodash";
|
|
10
|
-
import { map } from "lodash";
|
|
9
|
+
import { forEach } from "lodash-es";
|
|
10
|
+
import { map } from "lodash-es";
|
|
11
11
|
import { unmangleUrls } from "./unmangleUrls";
|
|
12
12
|
import { reformatName } from "./NameUtils.js";
|
|
13
13
|
|