@teselagen/ove 0.4.2 → 0.4.4
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 +112 -88
- package/index.es.js +112 -88
- package/index.umd.js +86 -96
- package/package.json +2 -2
- package/src/MenuBar/defaultConfig.js +2 -1
- package/src/SimpleCircularOrLinearView.js +4 -3
- package/src/ToolBar/downloadTool.js +2 -1
- package/src/commands/index.js +19 -4
- package/src/withEditorProps/index.js +16 -14
package/index.umd.js
CHANGED
|
@@ -25840,10 +25840,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
25840
25840
|
/* istanbul ignore next */
|
|
25841
25841
|
Object.getOwnPropertyNames
|
|
25842
25842
|
);
|
|
25843
|
-
function toPrimitive$
|
|
25843
|
+
function toPrimitive$3(value) {
|
|
25844
25844
|
return value === null ? null : typeof value === "object" ? "" + value : value;
|
|
25845
25845
|
}
|
|
25846
|
-
__name(toPrimitive$
|
|
25846
|
+
__name(toPrimitive$3, "toPrimitive$3");
|
|
25847
25847
|
function hasProp(target, prop2) {
|
|
25848
25848
|
return objectPrototype$2.hasOwnProperty.call(target, prop2);
|
|
25849
25849
|
}
|
|
@@ -26740,7 +26740,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
26740
26740
|
return this.name_ + "[" + this.value_ + "]";
|
|
26741
26741
|
}, "toString");
|
|
26742
26742
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
26743
|
-
return toPrimitive$
|
|
26743
|
+
return toPrimitive$3(this.get());
|
|
26744
26744
|
}, "valueOf");
|
|
26745
26745
|
_proto[_Symbol$toPrimitive] = function() {
|
|
26746
26746
|
return this.valueOf();
|
|
@@ -26925,7 +26925,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
26925
26925
|
return this.name_ + "[" + this.derivation.toString() + "]";
|
|
26926
26926
|
}, "toString");
|
|
26927
26927
|
_proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
|
|
26928
|
-
return toPrimitive$
|
|
26928
|
+
return toPrimitive$3(this.get());
|
|
26929
26929
|
}, "valueOf");
|
|
26930
26930
|
_proto[_Symbol$toPrimitive$1] = function() {
|
|
26931
26931
|
return this.valueOf();
|
|
@@ -43595,20 +43595,11 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43595
43595
|
return true;
|
|
43596
43596
|
}
|
|
43597
43597
|
}, "_fails");
|
|
43598
|
-
var _descriptors
|
|
43599
|
-
|
|
43600
|
-
|
|
43601
|
-
|
|
43602
|
-
|
|
43603
|
-
hasRequired_descriptors = 1;
|
|
43604
|
-
_descriptors = !_fails(function() {
|
|
43605
|
-
return Object.defineProperty({}, "a", { get: function() {
|
|
43606
|
-
return 7;
|
|
43607
|
-
} }).a != 7;
|
|
43608
|
-
});
|
|
43609
|
-
return _descriptors;
|
|
43610
|
-
}
|
|
43611
|
-
__name(require_descriptors, "require_descriptors");
|
|
43598
|
+
var _descriptors = !_fails(function() {
|
|
43599
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
43600
|
+
return 7;
|
|
43601
|
+
} }).a != 7;
|
|
43602
|
+
});
|
|
43612
43603
|
var _domCreate;
|
|
43613
43604
|
var hasRequired_domCreate;
|
|
43614
43605
|
function require_domCreate() {
|
|
@@ -43624,20 +43615,11 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43624
43615
|
return _domCreate;
|
|
43625
43616
|
}
|
|
43626
43617
|
__name(require_domCreate, "require_domCreate");
|
|
43627
|
-
var _ie8DomDefine
|
|
43628
|
-
|
|
43629
|
-
|
|
43630
|
-
|
|
43631
|
-
|
|
43632
|
-
hasRequired_ie8DomDefine = 1;
|
|
43633
|
-
_ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
43634
|
-
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
43635
|
-
return 7;
|
|
43636
|
-
} }).a != 7;
|
|
43637
|
-
});
|
|
43638
|
-
return _ie8DomDefine;
|
|
43639
|
-
}
|
|
43640
|
-
__name(require_ie8DomDefine, "require_ie8DomDefine");
|
|
43618
|
+
var _ie8DomDefine = !_descriptors && !_fails(function() {
|
|
43619
|
+
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
43620
|
+
return 7;
|
|
43621
|
+
} }).a != 7;
|
|
43622
|
+
});
|
|
43641
43623
|
var isObject$6 = _isObject;
|
|
43642
43624
|
var _toPrimitive$1 = /* @__PURE__ */ __name(function(it, S2) {
|
|
43643
43625
|
if (!isObject$6(it))
|
|
@@ -43651,33 +43633,25 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43651
43633
|
return val2;
|
|
43652
43634
|
throw TypeError("Can't convert object to primitive value");
|
|
43653
43635
|
}, "_toPrimitive$1");
|
|
43654
|
-
var
|
|
43655
|
-
|
|
43656
|
-
|
|
43657
|
-
|
|
43658
|
-
|
|
43659
|
-
|
|
43660
|
-
|
|
43661
|
-
|
|
43662
|
-
|
|
43663
|
-
|
|
43664
|
-
|
|
43665
|
-
|
|
43666
|
-
|
|
43667
|
-
|
|
43668
|
-
|
|
43669
|
-
|
|
43670
|
-
|
|
43671
|
-
|
|
43672
|
-
|
|
43673
|
-
throw TypeError("Accessors not supported!");
|
|
43674
|
-
if ("value" in Attributes)
|
|
43675
|
-
O2[P2] = Attributes.value;
|
|
43676
|
-
return O2;
|
|
43677
|
-
}, "defineProperty");
|
|
43678
|
-
return _objectDp;
|
|
43679
|
-
}
|
|
43680
|
-
__name(require_objectDp, "require_objectDp");
|
|
43636
|
+
var anObject$5 = _anObject;
|
|
43637
|
+
var IE8_DOM_DEFINE$1 = _ie8DomDefine;
|
|
43638
|
+
var toPrimitive$2 = _toPrimitive$1;
|
|
43639
|
+
var dP$3 = Object.defineProperty;
|
|
43640
|
+
_objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
|
|
43641
|
+
anObject$5(O2);
|
|
43642
|
+
P2 = toPrimitive$2(P2, true);
|
|
43643
|
+
anObject$5(Attributes);
|
|
43644
|
+
if (IE8_DOM_DEFINE$1)
|
|
43645
|
+
try {
|
|
43646
|
+
return dP$3(O2, P2, Attributes);
|
|
43647
|
+
} catch (e2) {
|
|
43648
|
+
}
|
|
43649
|
+
if ("get" in Attributes || "set" in Attributes)
|
|
43650
|
+
throw TypeError("Accessors not supported!");
|
|
43651
|
+
if ("value" in Attributes)
|
|
43652
|
+
O2[P2] = Attributes.value;
|
|
43653
|
+
return O2;
|
|
43654
|
+
}, "defineProperty");
|
|
43681
43655
|
var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
|
|
43682
43656
|
return {
|
|
43683
43657
|
enumerable: !(bitmap & 1),
|
|
@@ -43686,9 +43660,9 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43686
43660
|
value
|
|
43687
43661
|
};
|
|
43688
43662
|
}, "_propertyDesc");
|
|
43689
|
-
var dP$2 =
|
|
43663
|
+
var dP$2 = _objectDp;
|
|
43690
43664
|
var createDesc$3 = _propertyDesc;
|
|
43691
|
-
var _hide =
|
|
43665
|
+
var _hide = _descriptors ? function(object2, key2, value) {
|
|
43692
43666
|
return dP$2.f(object2, key2, createDesc$3(1, value));
|
|
43693
43667
|
} : function(object2, key2, value) {
|
|
43694
43668
|
object2[key2] = value;
|
|
@@ -43894,7 +43868,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43894
43868
|
if (hasRequired_objectAssign)
|
|
43895
43869
|
return _objectAssign;
|
|
43896
43870
|
hasRequired_objectAssign = 1;
|
|
43897
|
-
var DESCRIPTORS2 =
|
|
43871
|
+
var DESCRIPTORS2 = _descriptors;
|
|
43898
43872
|
var getKeys2 = _objectKeys;
|
|
43899
43873
|
var gOPS2 = _objectGops;
|
|
43900
43874
|
var pIE2 = require_objectPie();
|
|
@@ -43960,10 +43934,10 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
43960
43934
|
}, "_iterStep");
|
|
43961
43935
|
var _iterators = {};
|
|
43962
43936
|
var _redefine = _hide;
|
|
43963
|
-
var dP$1 =
|
|
43937
|
+
var dP$1 = _objectDp;
|
|
43964
43938
|
var anObject$4 = _anObject;
|
|
43965
43939
|
var getKeys$1 = _objectKeys;
|
|
43966
|
-
var _objectDps =
|
|
43940
|
+
var _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties2) {
|
|
43967
43941
|
anObject$4(O2);
|
|
43968
43942
|
var keys2 = getKeys$1(Properties2);
|
|
43969
43943
|
var length = keys2.length;
|
|
@@ -44030,7 +44004,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44030
44004
|
};
|
|
44031
44005
|
$exports.store = store$2;
|
|
44032
44006
|
var _wksExports = _wks.exports;
|
|
44033
|
-
var def =
|
|
44007
|
+
var def = _objectDp.f;
|
|
44034
44008
|
var has$b = _has;
|
|
44035
44009
|
var TAG$1 = _wksExports("toStringTag");
|
|
44036
44010
|
var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
|
|
@@ -44303,7 +44277,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44303
44277
|
var _isArrayIter = /* @__PURE__ */ __name(function(it) {
|
|
44304
44278
|
return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
|
44305
44279
|
}, "_isArrayIter");
|
|
44306
|
-
var $defineProperty$1 =
|
|
44280
|
+
var $defineProperty$1 = _objectDp;
|
|
44307
44281
|
var createDesc$2 = _propertyDesc;
|
|
44308
44282
|
var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
|
|
44309
44283
|
if (index2 in object2)
|
|
@@ -44432,7 +44406,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44432
44406
|
}
|
|
44433
44407
|
}, "_default$8");
|
|
44434
44408
|
var $export$3 = _export;
|
|
44435
|
-
$export$3($export$3.S + $export$3.F * !
|
|
44409
|
+
$export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
|
|
44436
44410
|
var $Object$1 = _coreExports.Object;
|
|
44437
44411
|
var defineProperty$6 = /* @__PURE__ */ __name(function defineProperty2(it, key2, desc) {
|
|
44438
44412
|
return $Object$1.defineProperty(it, key2, desc);
|
|
@@ -44473,7 +44447,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44473
44447
|
var META$1 = _uid("meta");
|
|
44474
44448
|
var isObject$5 = _isObject;
|
|
44475
44449
|
var has$9 = _has;
|
|
44476
|
-
var setDesc =
|
|
44450
|
+
var setDesc = _objectDp.f;
|
|
44477
44451
|
var id$1 = 0;
|
|
44478
44452
|
var isExtensible = Object.isExtensible || function() {
|
|
44479
44453
|
return true;
|
|
@@ -44526,7 +44500,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44526
44500
|
var _metaExports = _meta.exports;
|
|
44527
44501
|
var core = _coreExports;
|
|
44528
44502
|
var wksExt$1 = _wksExt;
|
|
44529
|
-
var defineProperty$4 =
|
|
44503
|
+
var defineProperty$4 = _objectDp.f;
|
|
44530
44504
|
var _wksDefine = /* @__PURE__ */ __name(function(name2) {
|
|
44531
44505
|
var $Symbol2 = core.Symbol || (core.Symbol = {});
|
|
44532
44506
|
if (name2.charAt(0) != "_" && !(name2 in $Symbol2))
|
|
@@ -44588,9 +44562,9 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44588
44562
|
var toIObject$1 = _toIobject;
|
|
44589
44563
|
var toPrimitive$1 = _toPrimitive$1;
|
|
44590
44564
|
var has$8 = _has;
|
|
44591
|
-
var IE8_DOM_DEFINE =
|
|
44565
|
+
var IE8_DOM_DEFINE = _ie8DomDefine;
|
|
44592
44566
|
var gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
44593
|
-
_objectGopd.f =
|
|
44567
|
+
_objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor2(O2, P2) {
|
|
44594
44568
|
O2 = toIObject$1(O2);
|
|
44595
44569
|
P2 = toPrimitive$1(P2, true);
|
|
44596
44570
|
if (IE8_DOM_DEFINE)
|
|
@@ -44603,7 +44577,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44603
44577
|
}, "getOwnPropertyDescriptor");
|
|
44604
44578
|
var global$1 = _globalExports;
|
|
44605
44579
|
var has$7 = _has;
|
|
44606
|
-
var DESCRIPTORS =
|
|
44580
|
+
var DESCRIPTORS = _descriptors;
|
|
44607
44581
|
var $export$2 = _export;
|
|
44608
44582
|
var redefine = _redefine;
|
|
44609
44583
|
var META = _metaExports.KEY;
|
|
@@ -44626,7 +44600,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
44626
44600
|
var gOPNExt = _objectGopnExt;
|
|
44627
44601
|
var $GOPD = _objectGopd;
|
|
44628
44602
|
var $GOPS = _objectGops;
|
|
44629
|
-
var $DP =
|
|
44603
|
+
var $DP = _objectDp;
|
|
44630
44604
|
var $keys$1 = _objectKeys;
|
|
44631
44605
|
var gOPD$1 = $GOPD.f;
|
|
44632
44606
|
var dP = $DP.f;
|
|
@@ -113552,12 +113526,12 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
113552
113526
|
// Monovalent salt concentration. 50mM is typical for PCR.
|
|
113553
113527
|
/**
|
|
113554
113528
|
* Calculates temperature for DNA sequence using a given algorithm.
|
|
113555
|
-
*
|
|
113556
|
-
*
|
|
113557
|
-
*
|
|
113558
|
-
*
|
|
113559
|
-
*
|
|
113560
|
-
*
|
|
113529
|
+
* sequence - The DNA sequence to use.
|
|
113530
|
+
* type - Either Teselagen.bio.tools.TemperatureCalculator.TABLE_BRESLAUER, TABLE_SUGIMOTO, or TABLE_UNIFIED
|
|
113531
|
+
* A - Helix initation for deltaS. Defaults to -10.8.
|
|
113532
|
+
* R - The gas constant, in cal/(K*mol). Defaults to 0.5e-6M.
|
|
113533
|
+
* Na - THe monovalent salt concentration. Defaults to 50e-3M.
|
|
113534
|
+
* return - Temperature for the given sequence, in Celsius.
|
|
113561
113535
|
*/
|
|
113562
113536
|
calculateTemperature: function(sequence2, type, A2, R2, C2, Na2) {
|
|
113563
113537
|
if (typeof type === "undefined") {
|
|
@@ -135589,13 +135563,12 @@ ${seq.sequence}
|
|
|
135589
135563
|
proteinSize,
|
|
135590
135564
|
proteinSequence
|
|
135591
135565
|
} = cleanedData;
|
|
135592
|
-
options =
|
|
135593
|
-
|
|
135594
|
-
|
|
135595
|
-
|
|
135596
|
-
|
|
135597
|
-
|
|
135598
|
-
}
|
|
135566
|
+
options = __spreadValues({
|
|
135567
|
+
sequence: isProtein2 && proteinSequence ? proteinSequence : sequence2,
|
|
135568
|
+
size: isProtein2 && proteinSequence ? proteinSize : size
|
|
135569
|
+
}, options);
|
|
135570
|
+
const seqToUse = options.sequence;
|
|
135571
|
+
const sizeToUse = options.size;
|
|
135599
135572
|
let fastaString = "";
|
|
135600
135573
|
fastaString += `>${name2 || "Untitled Sequence"}|`;
|
|
135601
135574
|
fastaString += "|" + sizeToUse;
|
|
@@ -139310,7 +139283,7 @@ ${seq.sequence}
|
|
|
139310
139283
|
}
|
|
139311
139284
|
__name(finishDisplayingSeq, "finishDisplayingSeq");
|
|
139312
139285
|
}), "importSequenceFromFile");
|
|
139313
|
-
const exportSequenceToFile = /* @__PURE__ */ __name((props) => (format2) => {
|
|
139286
|
+
const exportSequenceToFile = /* @__PURE__ */ __name((props) => (format2, options) => {
|
|
139314
139287
|
const { sequenceData: sequenceData2 } = props;
|
|
139315
139288
|
let convert2, fileExt;
|
|
139316
139289
|
if (format2 === "genbank") {
|
|
@@ -139329,7 +139302,9 @@ ${seq.sequence}
|
|
|
139329
139302
|
console.error(`Invalid export format: '${format2}'`);
|
|
139330
139303
|
return;
|
|
139331
139304
|
}
|
|
139332
|
-
const blob = new Blob([convert2(sequenceData2)], {
|
|
139305
|
+
const blob = new Blob([convert2(sequenceData2, options)], {
|
|
139306
|
+
type: "text/plain"
|
|
139307
|
+
});
|
|
139333
139308
|
const filename = `${sequenceData2.name || "Untitled_Sequence"}.${fileExt}`;
|
|
139334
139309
|
FileSaver.saveAs(blob, filename);
|
|
139335
139310
|
window.toastr.success("File Downloaded Successfully");
|
|
@@ -154268,7 +154243,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
154268
154243
|
}
|
|
154269
154244
|
__name(showFileDialog, "showFileDialog");
|
|
154270
154245
|
const name = "@teselagen/ove";
|
|
154271
|
-
const version = "0.4.
|
|
154246
|
+
const version = "0.4.3";
|
|
154272
154247
|
const main = "./src/index.js";
|
|
154273
154248
|
const exports$1 = {
|
|
154274
154249
|
".": {
|
|
@@ -155190,9 +155165,21 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
155190
155165
|
name: (props) => isProtein(props) ? "Download GenPept File" : "Download Genbank File",
|
|
155191
155166
|
handler: (props) => props.exportSequenceToFile(isProtein(props) ? "genpept" : "genbank")
|
|
155192
155167
|
},
|
|
155193
|
-
|
|
155194
|
-
name:
|
|
155195
|
-
|
|
155168
|
+
exportDNASequenceAsFasta: {
|
|
155169
|
+
name: (props) => `Download ${props.sequenceData.isProtein ? "DNA " : ""}FASTA File`,
|
|
155170
|
+
isHidden: (props) => !props.sequenceData.sequence,
|
|
155171
|
+
handler: (props) => props.exportSequenceToFile("fasta", {
|
|
155172
|
+
sequence: props.sequenceData.sequence,
|
|
155173
|
+
size: props.sequenceData.size
|
|
155174
|
+
})
|
|
155175
|
+
},
|
|
155176
|
+
exportProteinSequenceAsFasta: {
|
|
155177
|
+
name: "Download AA FASTA File",
|
|
155178
|
+
isHidden: (props) => !props.sequenceData.proteinSequence,
|
|
155179
|
+
handler: (props) => props.exportSequenceToFile("fasta", {
|
|
155180
|
+
sequence: props.sequenceData.proteinSequence,
|
|
155181
|
+
size: props.sequenceData.proteinSize
|
|
155182
|
+
})
|
|
155196
155183
|
},
|
|
155197
155184
|
exportSequenceAsTeselagenJson: {
|
|
155198
155185
|
name: "Download Teselagen JSON File",
|
|
@@ -155272,7 +155259,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
155272
155259
|
const noSelection = /* @__PURE__ */ __name(({ selectionLayer: selectionLayer2 = {} }) => !(selectionLayer2.start > -1 && selectionLayer2.end > -1) && "Selection Required", "noSelection");
|
|
155273
155260
|
const triggerClipboardCommand = /* @__PURE__ */ __name((type, props) => {
|
|
155274
155261
|
const wrapper2 = document.querySelector(
|
|
155275
|
-
|
|
155262
|
+
`.${props.editorName} .veVectorInteractionWrapper`
|
|
155276
155263
|
);
|
|
155277
155264
|
if (!wrapper2) {
|
|
155278
155265
|
return window.toastr.info(`Cannot trigger a ${type} in the current view`);
|
|
@@ -157180,7 +157167,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
157180
157167
|
showInSearchMenu: true,
|
|
157181
157168
|
submenu: [
|
|
157182
157169
|
{ cmd: "exportSequenceAsGenbank" },
|
|
157183
|
-
{ cmd: "
|
|
157170
|
+
{ cmd: "exportDNASequenceAsFasta" },
|
|
157171
|
+
{ cmd: "exportProteinSequenceAsFasta" },
|
|
157184
157172
|
{ cmd: "exportSequenceAsTeselagenJson" }
|
|
157185
157173
|
]
|
|
157186
157174
|
},
|
|
@@ -165528,7 +165516,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
165528
165516
|
onClick: (event) => showContextMenu(
|
|
165529
165517
|
[
|
|
165530
165518
|
"exportSequenceAsGenbank",
|
|
165531
|
-
"
|
|
165519
|
+
"exportDNASequenceAsFasta",
|
|
165520
|
+
"exportProteinSequenceAsFasta",
|
|
165532
165521
|
"exportSequenceAsTeselagenJson"
|
|
165533
165522
|
],
|
|
165534
165523
|
[
|
|
@@ -172438,7 +172427,8 @@ ${seqDataToCopy}\r
|
|
|
172438
172427
|
return /* @__PURE__ */ React$2.createElement(Menu, null, createCommandMenu(
|
|
172439
172428
|
[
|
|
172440
172429
|
"exportSequenceAsGenbank",
|
|
172441
|
-
"
|
|
172430
|
+
"exportDNASequenceAsFasta",
|
|
172431
|
+
"exportProteinSequenceAsFasta",
|
|
172442
172432
|
"exportSequenceAsTeselagenJson"
|
|
172443
172433
|
],
|
|
172444
172434
|
getCommands({ props })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"node": "16.20.2"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@teselagen/sequence-utils": "0.3.
|
|
16
|
+
"@teselagen/sequence-utils": "0.3.19",
|
|
17
17
|
"@teselagen/range-utils": "0.3.7",
|
|
18
18
|
"@teselagen/ui": "0.3.75",
|
|
19
19
|
"@teselagen/file-utils": "0.3.16",
|
|
@@ -41,7 +41,8 @@ export default [
|
|
|
41
41
|
showInSearchMenu: true,
|
|
42
42
|
submenu: [
|
|
43
43
|
{ cmd: "exportSequenceAsGenbank" },
|
|
44
|
-
{ cmd: "
|
|
44
|
+
{ cmd: "exportDNASequenceAsFasta" },
|
|
45
|
+
{ cmd: "exportProteinSequenceAsFasta" },
|
|
45
46
|
{ cmd: "exportSequenceAsTeselagenJson" }
|
|
46
47
|
]
|
|
47
48
|
},
|
|
@@ -102,8 +102,8 @@ export default props => {
|
|
|
102
102
|
)
|
|
103
103
|
? CircularView
|
|
104
104
|
: _sequenceData.isOligo && _sequenceData.sequence
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
? SimpleOligoPreview
|
|
106
|
+
: LinearView;
|
|
107
107
|
if (withChoosePreviewType && previewType === "row") {
|
|
108
108
|
Component = RowView;
|
|
109
109
|
tickSpacing = undefined;
|
|
@@ -291,7 +291,8 @@ const DownloadBtn = withHandlers({ exportSequenceToFile })(props => {
|
|
|
291
291
|
showContextMenu(
|
|
292
292
|
[
|
|
293
293
|
"exportSequenceAsGenbank",
|
|
294
|
-
"
|
|
294
|
+
"exportDNASequenceAsFasta",
|
|
295
|
+
"exportProteinSequenceAsFasta",
|
|
295
296
|
"exportSequenceAsTeselagenJson"
|
|
296
297
|
],
|
|
297
298
|
[
|
|
@@ -28,7 +28,8 @@ const Dropdown = withEditorProps(props => {
|
|
|
28
28
|
{createCommandMenu(
|
|
29
29
|
[
|
|
30
30
|
"exportSequenceAsGenbank",
|
|
31
|
-
"
|
|
31
|
+
"exportDNASequenceAsFasta",
|
|
32
|
+
"exportProteinSequenceAsFasta",
|
|
32
33
|
"exportSequenceAsTeselagenJson"
|
|
33
34
|
],
|
|
34
35
|
getCommands({ props })
|
package/src/commands/index.js
CHANGED
|
@@ -264,9 +264,24 @@ const fileCommandDefs = {
|
|
|
264
264
|
handler: props =>
|
|
265
265
|
props.exportSequenceToFile(isProtein(props) ? "genpept" : "genbank")
|
|
266
266
|
},
|
|
267
|
-
|
|
268
|
-
name:
|
|
269
|
-
|
|
267
|
+
exportDNASequenceAsFasta: {
|
|
268
|
+
name: props =>
|
|
269
|
+
`Download ${props.sequenceData.isProtein ? "DNA " : ""}FASTA File`,
|
|
270
|
+
isHidden: props => !props.sequenceData.sequence,
|
|
271
|
+
handler: props =>
|
|
272
|
+
props.exportSequenceToFile("fasta", {
|
|
273
|
+
sequence: props.sequenceData.sequence,
|
|
274
|
+
size: props.sequenceData.size
|
|
275
|
+
})
|
|
276
|
+
},
|
|
277
|
+
exportProteinSequenceAsFasta: {
|
|
278
|
+
name: "Download AA FASTA File",
|
|
279
|
+
isHidden: props => !props.sequenceData.proteinSequence,
|
|
280
|
+
handler: props =>
|
|
281
|
+
props.exportSequenceToFile("fasta", {
|
|
282
|
+
sequence: props.sequenceData.proteinSequence,
|
|
283
|
+
size: props.sequenceData.proteinSize
|
|
284
|
+
})
|
|
270
285
|
},
|
|
271
286
|
exportSequenceAsTeselagenJson: {
|
|
272
287
|
name: "Download Teselagen JSON File",
|
|
@@ -360,7 +375,7 @@ const noSelection = ({ selectionLayer = {} }) =>
|
|
|
360
375
|
|
|
361
376
|
const triggerClipboardCommand = (type, props) => {
|
|
362
377
|
const wrapper = document.querySelector(
|
|
363
|
-
|
|
378
|
+
`.${props.editorName} .veVectorInteractionWrapper`
|
|
364
379
|
);
|
|
365
380
|
if (!wrapper) {
|
|
366
381
|
return window.toastr.info(`Cannot trigger a ${type} in the current view`);
|
|
@@ -50,8 +50,8 @@ const getUpperOrLowerSeq = defaultMemoize(
|
|
|
50
50
|
uppercaseSequenceMapFont === "uppercase"
|
|
51
51
|
? sequence.toUpperCase()
|
|
52
52
|
: uppercaseSequenceMapFont === "lowercase"
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
? sequence.toLowerCase()
|
|
54
|
+
: sequence
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
const getTypesToOmit = annotationsToSupport => {
|
|
@@ -284,7 +284,7 @@ export const importSequenceFromFile =
|
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
286
|
|
|
287
|
-
export const exportSequenceToFile = props => format => {
|
|
287
|
+
export const exportSequenceToFile = props => (format, options) => {
|
|
288
288
|
const { sequenceData } = props;
|
|
289
289
|
let convert, fileExt;
|
|
290
290
|
|
|
@@ -304,7 +304,9 @@ export const exportSequenceToFile = props => format => {
|
|
|
304
304
|
console.error(`Invalid export format: '${format}'`); // dev error
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
const blob = new Blob([convert(sequenceData)], {
|
|
307
|
+
const blob = new Blob([convert(sequenceData, options)], {
|
|
308
|
+
type: "text/plain"
|
|
309
|
+
});
|
|
308
310
|
const filename = `${sequenceData.name || "Untitled_Sequence"}.${fileExt}`;
|
|
309
311
|
FileSaver.saveAs(blob, filename);
|
|
310
312
|
window.toastr.success("File Downloaded Successfully");
|
|
@@ -441,16 +443,16 @@ export default compose(
|
|
|
441
443
|
selectionLayer.start > -1
|
|
442
444
|
? { ...selectionLayer, id: undefined }
|
|
443
445
|
: caretPosition > -1
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
446
|
+
? {
|
|
447
|
+
start: caretPosition,
|
|
448
|
+
end: sequenceData.isProtein
|
|
449
|
+
? caretPosition + 2
|
|
450
|
+
: caretPosition
|
|
451
|
+
}
|
|
452
|
+
: {
|
|
453
|
+
start: 0,
|
|
454
|
+
end: sequenceData.isProtein ? 2 : 0
|
|
455
|
+
};
|
|
454
456
|
showAddOrEditAnnotationDialog({
|
|
455
457
|
type: key.toLowerCase(),
|
|
456
458
|
annotation: {
|