@teselagen/bio-parsers 0.4.5 → 0.4.7
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.js +10 -17
- package/index.mjs +10 -17
- package/index.umd.js +10 -17
- package/package.json +2 -2
- package/src/gffToJson.js +2 -2
- package/src/utils/validateSequence.js +0 -5
package/index.js
CHANGED
|
@@ -948,7 +948,7 @@ lodash.exports;
|
|
|
948
948
|
}
|
|
949
949
|
__name(unicodeWords, "unicodeWords");
|
|
950
950
|
var runInContext = /* @__PURE__ */ __name(function runInContext2(context) {
|
|
951
|
-
context = context == null ? root :
|
|
951
|
+
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
952
952
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
953
953
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
954
954
|
var coreJsData = context["__core-js_shared__"];
|
|
@@ -6159,17 +6159,16 @@ lodash.exports;
|
|
|
6159
6159
|
}
|
|
6160
6160
|
return lodash2;
|
|
6161
6161
|
}, "runInContext");
|
|
6162
|
-
var
|
|
6162
|
+
var _ = runInContext();
|
|
6163
6163
|
if (freeModule) {
|
|
6164
|
-
(freeModule.exports =
|
|
6165
|
-
freeExports._ =
|
|
6164
|
+
(freeModule.exports = _)._ = _;
|
|
6165
|
+
freeExports._ = _;
|
|
6166
6166
|
} else {
|
|
6167
|
-
root._ =
|
|
6167
|
+
root._ = _;
|
|
6168
6168
|
}
|
|
6169
6169
|
}).call(commonjsGlobal);
|
|
6170
6170
|
})(lodash, lodash.exports);
|
|
6171
6171
|
var lodashExports = lodash.exports;
|
|
6172
|
-
const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
|
|
6173
6172
|
const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO";
|
|
6174
6173
|
const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
|
|
6175
6174
|
const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
|
|
@@ -11275,7 +11274,7 @@ const annotationTypes = [
|
|
|
11275
11274
|
"primers",
|
|
11276
11275
|
"guides"
|
|
11277
11276
|
];
|
|
11278
|
-
function filterSequenceString(sequenceString, {
|
|
11277
|
+
function filterSequenceString(sequenceString = "", {
|
|
11279
11278
|
additionalValidChars = "",
|
|
11280
11279
|
isOligo,
|
|
11281
11280
|
name,
|
|
@@ -19447,12 +19446,6 @@ function validateSequence(sequence, options = {}) {
|
|
|
19447
19446
|
sequence.proteinSize = sequence.proteinSequence.length;
|
|
19448
19447
|
} else {
|
|
19449
19448
|
const temp = sequence.sequence;
|
|
19450
|
-
if (!sequence.isOligo) {
|
|
19451
|
-
sequence.sequence = sequence.sequence.replace(
|
|
19452
|
-
/u/gi,
|
|
19453
|
-
(u) => u === "U" ? "T" : "t"
|
|
19454
|
-
);
|
|
19455
|
-
}
|
|
19456
19449
|
if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein && sequence.isRNA !== false) {
|
|
19457
19450
|
sequence.type = "RNA";
|
|
19458
19451
|
sequence.sequence = temp;
|
|
@@ -26909,7 +26902,7 @@ function requireBuffer_list() {
|
|
|
26909
26902
|
// Make sure the linked list only shows the minimal necessary information.
|
|
26910
26903
|
}, {
|
|
26911
26904
|
key: custom,
|
|
26912
|
-
value: /* @__PURE__ */ __name(function value(
|
|
26905
|
+
value: /* @__PURE__ */ __name(function value(_, options) {
|
|
26913
26906
|
return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
26914
26907
|
// Only inspect one level.
|
|
26915
26908
|
depth: 0,
|
|
@@ -27205,7 +27198,7 @@ function requireBrowser() {
|
|
|
27205
27198
|
try {
|
|
27206
27199
|
if (!commonjsGlobal.localStorage)
|
|
27207
27200
|
return false;
|
|
27208
|
-
} catch (
|
|
27201
|
+
} catch (_) {
|
|
27209
27202
|
return false;
|
|
27210
27203
|
}
|
|
27211
27204
|
var val2 = commonjsGlobal.localStorage[name];
|
|
@@ -27313,7 +27306,7 @@ function require_stream_writable() {
|
|
|
27313
27306
|
return this.getBuffer();
|
|
27314
27307
|
}, "writableStateBufferGetter"), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
|
27315
27308
|
});
|
|
27316
|
-
} catch (
|
|
27309
|
+
} catch (_) {
|
|
27317
27310
|
}
|
|
27318
27311
|
})();
|
|
27319
27312
|
var realHasInstance;
|
|
@@ -29935,7 +29928,7 @@ function gffToJson(string) {
|
|
|
29935
29928
|
if (!features[feature.seq_id])
|
|
29936
29929
|
features[feature.seq_id] = [];
|
|
29937
29930
|
const attributes = feature.attributes || {};
|
|
29938
|
-
const name =
|
|
29931
|
+
const name = lodashExports.get(attributes, "ID[0]");
|
|
29939
29932
|
features[feature.seq_id].push({
|
|
29940
29933
|
name,
|
|
29941
29934
|
start: feature.start,
|
package/index.mjs
CHANGED
|
@@ -946,7 +946,7 @@ lodash.exports;
|
|
|
946
946
|
}
|
|
947
947
|
__name(unicodeWords, "unicodeWords");
|
|
948
948
|
var runInContext = /* @__PURE__ */ __name(function runInContext2(context) {
|
|
949
|
-
context = context == null ? root :
|
|
949
|
+
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
950
950
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
951
951
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
952
952
|
var coreJsData = context["__core-js_shared__"];
|
|
@@ -6157,17 +6157,16 @@ lodash.exports;
|
|
|
6157
6157
|
}
|
|
6158
6158
|
return lodash2;
|
|
6159
6159
|
}, "runInContext");
|
|
6160
|
-
var
|
|
6160
|
+
var _ = runInContext();
|
|
6161
6161
|
if (freeModule) {
|
|
6162
|
-
(freeModule.exports =
|
|
6163
|
-
freeExports._ =
|
|
6162
|
+
(freeModule.exports = _)._ = _;
|
|
6163
|
+
freeExports._ = _;
|
|
6164
6164
|
} else {
|
|
6165
|
-
root._ =
|
|
6165
|
+
root._ = _;
|
|
6166
6166
|
}
|
|
6167
6167
|
}).call(commonjsGlobal);
|
|
6168
6168
|
})(lodash, lodash.exports);
|
|
6169
6169
|
var lodashExports = lodash.exports;
|
|
6170
|
-
const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
|
|
6171
6170
|
const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO";
|
|
6172
6171
|
const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
|
|
6173
6172
|
const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
|
|
@@ -11273,7 +11272,7 @@ const annotationTypes = [
|
|
|
11273
11272
|
"primers",
|
|
11274
11273
|
"guides"
|
|
11275
11274
|
];
|
|
11276
|
-
function filterSequenceString(sequenceString, {
|
|
11275
|
+
function filterSequenceString(sequenceString = "", {
|
|
11277
11276
|
additionalValidChars = "",
|
|
11278
11277
|
isOligo,
|
|
11279
11278
|
name,
|
|
@@ -19445,12 +19444,6 @@ function validateSequence(sequence, options = {}) {
|
|
|
19445
19444
|
sequence.proteinSize = sequence.proteinSequence.length;
|
|
19446
19445
|
} else {
|
|
19447
19446
|
const temp = sequence.sequence;
|
|
19448
|
-
if (!sequence.isOligo) {
|
|
19449
|
-
sequence.sequence = sequence.sequence.replace(
|
|
19450
|
-
/u/gi,
|
|
19451
|
-
(u) => u === "U" ? "T" : "t"
|
|
19452
|
-
);
|
|
19453
|
-
}
|
|
19454
19447
|
if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein && sequence.isRNA !== false) {
|
|
19455
19448
|
sequence.type = "RNA";
|
|
19456
19449
|
sequence.sequence = temp;
|
|
@@ -26907,7 +26900,7 @@ function requireBuffer_list() {
|
|
|
26907
26900
|
// Make sure the linked list only shows the minimal necessary information.
|
|
26908
26901
|
}, {
|
|
26909
26902
|
key: custom,
|
|
26910
|
-
value: /* @__PURE__ */ __name(function value(
|
|
26903
|
+
value: /* @__PURE__ */ __name(function value(_, options) {
|
|
26911
26904
|
return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
26912
26905
|
// Only inspect one level.
|
|
26913
26906
|
depth: 0,
|
|
@@ -27203,7 +27196,7 @@ function requireBrowser() {
|
|
|
27203
27196
|
try {
|
|
27204
27197
|
if (!commonjsGlobal.localStorage)
|
|
27205
27198
|
return false;
|
|
27206
|
-
} catch (
|
|
27199
|
+
} catch (_) {
|
|
27207
27200
|
return false;
|
|
27208
27201
|
}
|
|
27209
27202
|
var val2 = commonjsGlobal.localStorage[name];
|
|
@@ -27311,7 +27304,7 @@ function require_stream_writable() {
|
|
|
27311
27304
|
return this.getBuffer();
|
|
27312
27305
|
}, "writableStateBufferGetter"), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
|
27313
27306
|
});
|
|
27314
|
-
} catch (
|
|
27307
|
+
} catch (_) {
|
|
27315
27308
|
}
|
|
27316
27309
|
})();
|
|
27317
27310
|
var realHasInstance;
|
|
@@ -29933,7 +29926,7 @@ function gffToJson(string) {
|
|
|
29933
29926
|
if (!features[feature.seq_id])
|
|
29934
29927
|
features[feature.seq_id] = [];
|
|
29935
29928
|
const attributes = feature.attributes || {};
|
|
29936
|
-
const name =
|
|
29929
|
+
const name = lodashExports.get(attributes, "ID[0]");
|
|
29937
29930
|
features[feature.seq_id].push({
|
|
29938
29931
|
name,
|
|
29939
29932
|
start: feature.start,
|
package/index.umd.js
CHANGED
|
@@ -950,7 +950,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
950
950
|
}
|
|
951
951
|
__name(unicodeWords, "unicodeWords");
|
|
952
952
|
var runInContext = /* @__PURE__ */ __name(function runInContext2(context) {
|
|
953
|
-
context = context == null ? root :
|
|
953
|
+
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
954
954
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
955
955
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
956
956
|
var coreJsData = context["__core-js_shared__"];
|
|
@@ -6161,17 +6161,16 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6161
6161
|
}
|
|
6162
6162
|
return lodash2;
|
|
6163
6163
|
}, "runInContext");
|
|
6164
|
-
var
|
|
6164
|
+
var _ = runInContext();
|
|
6165
6165
|
if (freeModule) {
|
|
6166
|
-
(freeModule.exports =
|
|
6167
|
-
freeExports._ =
|
|
6166
|
+
(freeModule.exports = _)._ = _;
|
|
6167
|
+
freeExports._ = _;
|
|
6168
6168
|
} else {
|
|
6169
|
-
root._ =
|
|
6169
|
+
root._ = _;
|
|
6170
6170
|
}
|
|
6171
6171
|
}).call(commonjsGlobal);
|
|
6172
6172
|
})(lodash, lodash.exports);
|
|
6173
6173
|
var lodashExports = lodash.exports;
|
|
6174
|
-
const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
|
|
6175
6174
|
const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO";
|
|
6176
6175
|
const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
|
|
6177
6176
|
const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
|
|
@@ -11277,7 +11276,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11277
11276
|
"primers",
|
|
11278
11277
|
"guides"
|
|
11279
11278
|
];
|
|
11280
|
-
function filterSequenceString(sequenceString, {
|
|
11279
|
+
function filterSequenceString(sequenceString = "", {
|
|
11281
11280
|
additionalValidChars = "",
|
|
11282
11281
|
isOligo,
|
|
11283
11282
|
name: name2,
|
|
@@ -19449,12 +19448,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19449
19448
|
sequence.proteinSize = sequence.proteinSequence.length;
|
|
19450
19449
|
} else {
|
|
19451
19450
|
const temp = sequence.sequence;
|
|
19452
|
-
if (!sequence.isOligo) {
|
|
19453
|
-
sequence.sequence = sequence.sequence.replace(
|
|
19454
|
-
/u/gi,
|
|
19455
|
-
(u) => u === "U" ? "T" : "t"
|
|
19456
|
-
);
|
|
19457
|
-
}
|
|
19458
19451
|
if (temp !== sequence.sequence && !sequence.isDNA && !sequence.isProtein && sequence.isRNA !== false) {
|
|
19459
19452
|
sequence.type = "RNA";
|
|
19460
19453
|
sequence.sequence = temp;
|
|
@@ -26911,7 +26904,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
26911
26904
|
// Make sure the linked list only shows the minimal necessary information.
|
|
26912
26905
|
}, {
|
|
26913
26906
|
key: custom,
|
|
26914
|
-
value: /* @__PURE__ */ __name(function value(
|
|
26907
|
+
value: /* @__PURE__ */ __name(function value(_, options) {
|
|
26915
26908
|
return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
26916
26909
|
// Only inspect one level.
|
|
26917
26910
|
depth: 0,
|
|
@@ -27207,7 +27200,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
27207
27200
|
try {
|
|
27208
27201
|
if (!commonjsGlobal.localStorage)
|
|
27209
27202
|
return false;
|
|
27210
|
-
} catch (
|
|
27203
|
+
} catch (_) {
|
|
27211
27204
|
return false;
|
|
27212
27205
|
}
|
|
27213
27206
|
var val2 = commonjsGlobal.localStorage[name2];
|
|
@@ -27315,7 +27308,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
27315
27308
|
return this.getBuffer();
|
|
27316
27309
|
}, "writableStateBufferGetter"), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
|
27317
27310
|
});
|
|
27318
|
-
} catch (
|
|
27311
|
+
} catch (_) {
|
|
27319
27312
|
}
|
|
27320
27313
|
})();
|
|
27321
27314
|
var realHasInstance;
|
|
@@ -29937,7 +29930,7 @@ ${seq.sequence}
|
|
|
29937
29930
|
if (!features[feature.seq_id])
|
|
29938
29931
|
features[feature.seq_id] = [];
|
|
29939
29932
|
const attributes = feature.attributes || {};
|
|
29940
|
-
const name2 =
|
|
29933
|
+
const name2 = lodashExports.get(attributes, "ID[0]");
|
|
29941
29934
|
features[feature.seq_id].push({
|
|
29942
29935
|
name: name2,
|
|
29943
29936
|
start: feature.start,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/bio-parsers",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@teselagen/sequence-utils": "0.3.
|
|
5
|
+
"@teselagen/sequence-utils": "0.3.13",
|
|
6
6
|
"@teselagen/range-utils": "0.3.7",
|
|
7
7
|
"@gmod/gff": "^1.2.1",
|
|
8
8
|
"buffer": "^6.0.3",
|
package/src/gffToJson.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import gff from "@gmod/gff";
|
|
2
|
-
import
|
|
2
|
+
import { get } from "lodash";
|
|
3
3
|
|
|
4
4
|
function gffToJson(string) {
|
|
5
5
|
const arrayOfThings = gff.parseStringSync(string);
|
|
@@ -13,7 +13,7 @@ function gffToJson(string) {
|
|
|
13
13
|
const feature = featureOrSeq[0];
|
|
14
14
|
if (!features[feature.seq_id]) features[feature.seq_id] = [];
|
|
15
15
|
const attributes = feature.attributes || {};
|
|
16
|
-
const name =
|
|
16
|
+
const name = get(attributes, "ID[0]");
|
|
17
17
|
features[feature.seq_id].push({
|
|
18
18
|
name,
|
|
19
19
|
start: feature.start,
|
|
@@ -110,11 +110,6 @@ export default function validateSequence(sequence, options = {}) {
|
|
|
110
110
|
} else {
|
|
111
111
|
//todo: this logic won't catch every case of RNA, so we should probably handle RNA conversion at another level..
|
|
112
112
|
const temp = sequence.sequence;
|
|
113
|
-
if (!sequence.isOligo) {
|
|
114
|
-
sequence.sequence = sequence.sequence.replace(/u/gi, u =>
|
|
115
|
-
u === "U" ? "T" : "t"
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
113
|
if (
|
|
119
114
|
temp !== sequence.sequence &&
|
|
120
115
|
!sequence.isDNA &&
|