@teselagen/ove 0.5.3 → 0.5.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 CHANGED
@@ -52982,31 +52982,36 @@ const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_e) => {
52982
52982
  const optionsToUse = getOptions$1(options);
52983
52983
  if (options.some((opt) => {
52984
52984
  if (opt.value === "true") {
52985
- throw new Error('RadioGroup values cannot be strings of "true" or "false", they must be actual booleans');
52985
+ return true;
52986
52986
  }
52987
- }))
52988
- return /* @__PURE__ */ React$2.createElement(
52989
- core$5.RadioGroup,
52990
- __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
52991
- selectedValue: input.value,
52992
- label: void 0,
52993
- onChange: function(e2) {
52994
- let val2 = e2.target.value;
52995
- if (val2 === "true") {
52996
- val2 = true;
52997
- }
52998
- if (val2 === "false") {
52999
- val2 = false;
53000
- }
53001
- if (val2 === "") {
53002
- val2 = false;
53003
- }
53004
- input.onChange(val2);
53005
- onFieldSubmit(val2);
53006
- },
53007
- options: optionsToUse
53008
- })
52987
+ return false;
52988
+ })) {
52989
+ throw new Error(
52990
+ 'RadioGroup values cannot be strings of "true" or "false", they must be actual booleans'
53009
52991
  );
52992
+ }
52993
+ return /* @__PURE__ */ React$2.createElement(
52994
+ core$5.RadioGroup,
52995
+ __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
52996
+ selectedValue: input.value,
52997
+ label: void 0,
52998
+ onChange: function(e2) {
52999
+ let val2 = e2.target.value;
53000
+ if (val2 === "true") {
53001
+ val2 = true;
53002
+ }
53003
+ if (val2 === "false") {
53004
+ val2 = false;
53005
+ }
53006
+ if (val2 === "") {
53007
+ val2 = false;
53008
+ }
53009
+ input.onChange(val2);
53010
+ onFieldSubmit(val2);
53011
+ },
53012
+ options: optionsToUse
53013
+ })
53014
+ );
53010
53015
  }, "renderBlueprintRadioGroup");
53011
53016
  const _RenderReactColorPicker = class _RenderReactColorPicker extends React$2.Component {
53012
53017
  constructor() {
@@ -93528,19 +93533,38 @@ function flattenSequenceArray(parsingResultArray, opts2) {
93528
93533
  return parsingResultArray;
93529
93534
  }
93530
93535
  __name(flattenSequenceArray, "flattenSequenceArray");
93536
+ function wrapOriginSpanningFeatures(locArrayInput, sequenceLength, inclusive1BasedStart, inclusive1BasedEnd) {
93537
+ const locArrayOutput = locArrayInput.map((loc) => __spreadValues({}, loc));
93538
+ for (let i = 0; i < locArrayOutput.length - 1; i++) {
93539
+ const firstFeature = locArrayOutput[i];
93540
+ const secondFeature = locArrayOutput[i + 1];
93541
+ if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
93542
+ locArrayOutput[i] = {
93543
+ start: firstFeature.start,
93544
+ end: secondFeature.end
93545
+ };
93546
+ locArrayOutput.splice(i + 1, 1);
93547
+ }
93548
+ }
93549
+ return locArrayOutput;
93550
+ }
93551
+ __name(wrapOriginSpanningFeatures, "wrapOriginSpanningFeatures");
93531
93552
  function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusive1BasedEnd, isCircular, sequenceLength) {
93532
93553
  locStr = locStr.trim();
93533
- const locArr = [];
93534
- locStr.replace(/(\d+)/g, function(string2, match2) {
93535
- locArr.push(match2);
93554
+ const positionsArray = [];
93555
+ const locationParts = locStr.split(",");
93556
+ locationParts.forEach((locPart) => {
93557
+ const extractedPositions = locPart.match(/(\d+)/g);
93558
+ if (extractedPositions === null) {
93559
+ return;
93560
+ }
93561
+ positionsArray.push(extractedPositions[0]);
93562
+ positionsArray.push(extractedPositions[1] || extractedPositions[0]);
93536
93563
  });
93537
93564
  const locArray = [];
93538
- for (let i = 0; i < locArr.length; i += 2) {
93539
- const start2 = parseInt(locArr[i], 10) - (inclusive1BasedStart ? 0 : 1);
93540
- let end2 = parseInt(locArr[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
93541
- if (isNaN(end2)) {
93542
- end2 = start2;
93543
- }
93565
+ for (let i = 0; i < positionsArray.length; i += 2) {
93566
+ const start2 = parseInt(positionsArray[i], 10) - (inclusive1BasedStart ? 0 : 1);
93567
+ const end2 = parseInt(positionsArray[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
93544
93568
  const location2 = {
93545
93569
  start: start2,
93546
93570
  end: end2
@@ -93549,20 +93573,16 @@ function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusiv
93549
93573
  isProtein2 ? convertAACaretPositionOrRangeToDna(location2) : location2
93550
93574
  );
93551
93575
  }
93552
- if (isCircular) {
93553
- for (let i = 0; i < locArray.length; i += 2) {
93554
- const firstFeature = locArray[i];
93555
- const secondFeature = locArray[i + 1];
93556
- if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
93557
- locArray[i] = {
93558
- start: firstFeature.start,
93559
- end: secondFeature.end
93560
- };
93561
- locArray.splice(i + 1, 1);
93562
- }
93563
- }
93576
+ if (isCircular && sequenceLength) {
93577
+ return wrapOriginSpanningFeatures(
93578
+ locArray,
93579
+ sequenceLength,
93580
+ inclusive1BasedStart,
93581
+ inclusive1BasedEnd
93582
+ );
93583
+ } else {
93584
+ return locArray;
93564
93585
  }
93565
- return locArray;
93566
93586
  }
93567
93587
  __name(parseFeatureLocation, "parseFeatureLocation");
93568
93588
  function genbankToJson(string2, options = {}) {
@@ -93659,7 +93679,7 @@ function genbankToJson(string2, options = {}) {
93659
93679
  parseOrigin(line, key);
93660
93680
  break;
93661
93681
  case genbankAnnotationKey.END_SEQUENCE_TAG:
93662
- endSeq();
93682
+ endSeq(options);
93663
93683
  break;
93664
93684
  case genbankAnnotationKey.DEFINITION_TAG:
93665
93685
  line = line.replace(/DEFINITION/, "");
@@ -93764,9 +93784,9 @@ function genbankToJson(string2, options = {}) {
93764
93784
  }
93765
93785
  });
93766
93786
  return results;
93767
- function endSeq() {
93787
+ function endSeq(options2) {
93768
93788
  hasFoundLocus = false;
93769
- postProcessCurSeq();
93789
+ postProcessCurSeq(options2);
93770
93790
  resultsArray.push(result || { success: false });
93771
93791
  }
93772
93792
  __name(endSeq, "endSeq");
@@ -93780,11 +93800,13 @@ function genbankToJson(string2, options = {}) {
93780
93800
  }
93781
93801
  }
93782
93802
  __name(addMessage, "addMessage");
93783
- function postProcessCurSeq() {
93803
+ function postProcessCurSeq(options2) {
93784
93804
  if (result && result.parsedSequence && result.parsedSequence.features) {
93785
93805
  for (let i = 0; i < result.parsedSequence.features.length; i++) {
93786
93806
  result.parsedSequence.features[i] = postProcessGenbankFeature(
93787
- result.parsedSequence.features[i]
93807
+ result.parsedSequence.features[i],
93808
+ result.parsedSequence,
93809
+ options2
93788
93810
  );
93789
93811
  }
93790
93812
  }
@@ -94030,7 +94052,7 @@ function genbankToJson(string2, options = {}) {
94030
94052
  return runon;
94031
94053
  }
94032
94054
  __name(isKeywordRunon, "isKeywordRunon");
94033
- function postProcessGenbankFeature(feat) {
94055
+ function postProcessGenbankFeature(feat, parsedSequence, options2) {
94034
94056
  if (feat.notes.label) {
94035
94057
  feat.name = feat.notes.label[0];
94036
94058
  } else if (feat.notes.gene) {
@@ -94063,6 +94085,15 @@ function genbankToJson(string2, options = {}) {
94063
94085
  feat.arrowheadType = feat.notes.direction[0].toUpperCase() === "BOTH" ? "BOTH" : feat.notes.direction[0].toUpperCase() === "NONE" ? "NONE" : void 0;
94064
94086
  delete feat.notes.direction;
94065
94087
  }
94088
+ if (parsedSequence.circular) {
94089
+ const { inclusive1BasedStart: inclusive1BasedStart2, inclusive1BasedEnd: inclusive1BasedEnd2 } = options2;
94090
+ feat.locations = wrapOriginSpanningFeatures(
94091
+ feat.locations,
94092
+ parsedSequence.sequence.length,
94093
+ inclusive1BasedStart2,
94094
+ inclusive1BasedEnd2
94095
+ );
94096
+ }
94066
94097
  return feat;
94067
94098
  }
94068
94099
  __name(postProcessGenbankFeature, "postProcessGenbankFeature");
@@ -125363,7 +125394,7 @@ function showFileDialog({ multiple = false, onSelect }) {
125363
125394
  }
125364
125395
  __name(showFileDialog, "showFileDialog");
125365
125396
  const name = "@teselagen/ove";
125366
- const version = "0.5.2";
125397
+ const version = "0.5.3";
125367
125398
  const main = "./src/index.js";
125368
125399
  const exports$1 = {
125369
125400
  ".": {
package/index.es.js CHANGED
@@ -52964,31 +52964,36 @@ const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_e) => {
52964
52964
  const optionsToUse = getOptions$1(options);
52965
52965
  if (options.some((opt) => {
52966
52966
  if (opt.value === "true") {
52967
- throw new Error('RadioGroup values cannot be strings of "true" or "false", they must be actual booleans');
52967
+ return true;
52968
52968
  }
52969
- }))
52970
- return /* @__PURE__ */ React__default$1.createElement(
52971
- RadioGroup,
52972
- __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
52973
- selectedValue: input.value,
52974
- label: void 0,
52975
- onChange: function(e2) {
52976
- let val2 = e2.target.value;
52977
- if (val2 === "true") {
52978
- val2 = true;
52979
- }
52980
- if (val2 === "false") {
52981
- val2 = false;
52982
- }
52983
- if (val2 === "") {
52984
- val2 = false;
52985
- }
52986
- input.onChange(val2);
52987
- onFieldSubmit(val2);
52988
- },
52989
- options: optionsToUse
52990
- })
52969
+ return false;
52970
+ })) {
52971
+ throw new Error(
52972
+ 'RadioGroup values cannot be strings of "true" or "false", they must be actual booleans'
52991
52973
  );
52974
+ }
52975
+ return /* @__PURE__ */ React__default$1.createElement(
52976
+ RadioGroup,
52977
+ __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
52978
+ selectedValue: input.value,
52979
+ label: void 0,
52980
+ onChange: function(e2) {
52981
+ let val2 = e2.target.value;
52982
+ if (val2 === "true") {
52983
+ val2 = true;
52984
+ }
52985
+ if (val2 === "false") {
52986
+ val2 = false;
52987
+ }
52988
+ if (val2 === "") {
52989
+ val2 = false;
52990
+ }
52991
+ input.onChange(val2);
52992
+ onFieldSubmit(val2);
52993
+ },
52994
+ options: optionsToUse
52995
+ })
52996
+ );
52992
52997
  }, "renderBlueprintRadioGroup");
52993
52998
  const _RenderReactColorPicker = class _RenderReactColorPicker extends React__default$1.Component {
52994
52999
  constructor() {
@@ -93510,19 +93515,38 @@ function flattenSequenceArray(parsingResultArray, opts2) {
93510
93515
  return parsingResultArray;
93511
93516
  }
93512
93517
  __name(flattenSequenceArray, "flattenSequenceArray");
93518
+ function wrapOriginSpanningFeatures(locArrayInput, sequenceLength, inclusive1BasedStart, inclusive1BasedEnd) {
93519
+ const locArrayOutput = locArrayInput.map((loc) => __spreadValues({}, loc));
93520
+ for (let i = 0; i < locArrayOutput.length - 1; i++) {
93521
+ const firstFeature = locArrayOutput[i];
93522
+ const secondFeature = locArrayOutput[i + 1];
93523
+ if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
93524
+ locArrayOutput[i] = {
93525
+ start: firstFeature.start,
93526
+ end: secondFeature.end
93527
+ };
93528
+ locArrayOutput.splice(i + 1, 1);
93529
+ }
93530
+ }
93531
+ return locArrayOutput;
93532
+ }
93533
+ __name(wrapOriginSpanningFeatures, "wrapOriginSpanningFeatures");
93513
93534
  function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusive1BasedEnd, isCircular, sequenceLength) {
93514
93535
  locStr = locStr.trim();
93515
- const locArr = [];
93516
- locStr.replace(/(\d+)/g, function(string2, match2) {
93517
- locArr.push(match2);
93536
+ const positionsArray = [];
93537
+ const locationParts = locStr.split(",");
93538
+ locationParts.forEach((locPart) => {
93539
+ const extractedPositions = locPart.match(/(\d+)/g);
93540
+ if (extractedPositions === null) {
93541
+ return;
93542
+ }
93543
+ positionsArray.push(extractedPositions[0]);
93544
+ positionsArray.push(extractedPositions[1] || extractedPositions[0]);
93518
93545
  });
93519
93546
  const locArray = [];
93520
- for (let i = 0; i < locArr.length; i += 2) {
93521
- const start2 = parseInt(locArr[i], 10) - (inclusive1BasedStart ? 0 : 1);
93522
- let end2 = parseInt(locArr[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
93523
- if (isNaN(end2)) {
93524
- end2 = start2;
93525
- }
93547
+ for (let i = 0; i < positionsArray.length; i += 2) {
93548
+ const start2 = parseInt(positionsArray[i], 10) - (inclusive1BasedStart ? 0 : 1);
93549
+ const end2 = parseInt(positionsArray[i + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
93526
93550
  const location2 = {
93527
93551
  start: start2,
93528
93552
  end: end2
@@ -93531,20 +93555,16 @@ function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusiv
93531
93555
  isProtein2 ? convertAACaretPositionOrRangeToDna(location2) : location2
93532
93556
  );
93533
93557
  }
93534
- if (isCircular) {
93535
- for (let i = 0; i < locArray.length; i += 2) {
93536
- const firstFeature = locArray[i];
93537
- const secondFeature = locArray[i + 1];
93538
- if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
93539
- locArray[i] = {
93540
- start: firstFeature.start,
93541
- end: secondFeature.end
93542
- };
93543
- locArray.splice(i + 1, 1);
93544
- }
93545
- }
93558
+ if (isCircular && sequenceLength) {
93559
+ return wrapOriginSpanningFeatures(
93560
+ locArray,
93561
+ sequenceLength,
93562
+ inclusive1BasedStart,
93563
+ inclusive1BasedEnd
93564
+ );
93565
+ } else {
93566
+ return locArray;
93546
93567
  }
93547
- return locArray;
93548
93568
  }
93549
93569
  __name(parseFeatureLocation, "parseFeatureLocation");
93550
93570
  function genbankToJson(string2, options = {}) {
@@ -93641,7 +93661,7 @@ function genbankToJson(string2, options = {}) {
93641
93661
  parseOrigin(line, key);
93642
93662
  break;
93643
93663
  case genbankAnnotationKey.END_SEQUENCE_TAG:
93644
- endSeq();
93664
+ endSeq(options);
93645
93665
  break;
93646
93666
  case genbankAnnotationKey.DEFINITION_TAG:
93647
93667
  line = line.replace(/DEFINITION/, "");
@@ -93746,9 +93766,9 @@ function genbankToJson(string2, options = {}) {
93746
93766
  }
93747
93767
  });
93748
93768
  return results;
93749
- function endSeq() {
93769
+ function endSeq(options2) {
93750
93770
  hasFoundLocus = false;
93751
- postProcessCurSeq();
93771
+ postProcessCurSeq(options2);
93752
93772
  resultsArray.push(result || { success: false });
93753
93773
  }
93754
93774
  __name(endSeq, "endSeq");
@@ -93762,11 +93782,13 @@ function genbankToJson(string2, options = {}) {
93762
93782
  }
93763
93783
  }
93764
93784
  __name(addMessage, "addMessage");
93765
- function postProcessCurSeq() {
93785
+ function postProcessCurSeq(options2) {
93766
93786
  if (result && result.parsedSequence && result.parsedSequence.features) {
93767
93787
  for (let i = 0; i < result.parsedSequence.features.length; i++) {
93768
93788
  result.parsedSequence.features[i] = postProcessGenbankFeature(
93769
- result.parsedSequence.features[i]
93789
+ result.parsedSequence.features[i],
93790
+ result.parsedSequence,
93791
+ options2
93770
93792
  );
93771
93793
  }
93772
93794
  }
@@ -94012,7 +94034,7 @@ function genbankToJson(string2, options = {}) {
94012
94034
  return runon;
94013
94035
  }
94014
94036
  __name(isKeywordRunon, "isKeywordRunon");
94015
- function postProcessGenbankFeature(feat) {
94037
+ function postProcessGenbankFeature(feat, parsedSequence, options2) {
94016
94038
  if (feat.notes.label) {
94017
94039
  feat.name = feat.notes.label[0];
94018
94040
  } else if (feat.notes.gene) {
@@ -94045,6 +94067,15 @@ function genbankToJson(string2, options = {}) {
94045
94067
  feat.arrowheadType = feat.notes.direction[0].toUpperCase() === "BOTH" ? "BOTH" : feat.notes.direction[0].toUpperCase() === "NONE" ? "NONE" : void 0;
94046
94068
  delete feat.notes.direction;
94047
94069
  }
94070
+ if (parsedSequence.circular) {
94071
+ const { inclusive1BasedStart: inclusive1BasedStart2, inclusive1BasedEnd: inclusive1BasedEnd2 } = options2;
94072
+ feat.locations = wrapOriginSpanningFeatures(
94073
+ feat.locations,
94074
+ parsedSequence.sequence.length,
94075
+ inclusive1BasedStart2,
94076
+ inclusive1BasedEnd2
94077
+ );
94078
+ }
94048
94079
  return feat;
94049
94080
  }
94050
94081
  __name(postProcessGenbankFeature, "postProcessGenbankFeature");
@@ -125345,7 +125376,7 @@ function showFileDialog({ multiple = false, onSelect }) {
125345
125376
  }
125346
125377
  __name(showFileDialog, "showFileDialog");
125347
125378
  const name = "@teselagen/ove";
125348
- const version = "0.5.2";
125379
+ const version = "0.5.3";
125349
125380
  const main = "./src/index.js";
125350
125381
  const exports$1 = {
125351
125382
  ".": {
package/index.umd.js CHANGED
@@ -82868,31 +82868,36 @@ ${latestSubscriptionCallbackError.current.stack}
82868
82868
  const optionsToUse = getOptions$1(options);
82869
82869
  if (options.some((opt) => {
82870
82870
  if (opt.value === "true") {
82871
- throw new Error('RadioGroup values cannot be strings of "true" or "false", they must be actual booleans');
82871
+ return true;
82872
82872
  }
82873
- }))
82874
- return /* @__PURE__ */ React$2.createElement(
82875
- RadioGroup,
82876
- __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
82877
- selectedValue: input.value,
82878
- label: void 0,
82879
- onChange: function(e2) {
82880
- let val2 = e2.target.value;
82881
- if (val2 === "true") {
82882
- val2 = true;
82883
- }
82884
- if (val2 === "false") {
82885
- val2 = false;
82886
- }
82887
- if (val2 === "") {
82888
- val2 = false;
82889
- }
82890
- input.onChange(val2);
82891
- onFieldSubmit(val2);
82892
- },
82893
- options: optionsToUse
82894
- })
82873
+ return false;
82874
+ })) {
82875
+ throw new Error(
82876
+ 'RadioGroup values cannot be strings of "true" or "false", they must be actual booleans'
82895
82877
  );
82878
+ }
82879
+ return /* @__PURE__ */ React$2.createElement(
82880
+ RadioGroup,
82881
+ __spreadProps(__spreadValues(__spreadValues({}, input), removeUnwantedProps(rest)), {
82882
+ selectedValue: input.value,
82883
+ label: void 0,
82884
+ onChange: function(e2) {
82885
+ let val2 = e2.target.value;
82886
+ if (val2 === "true") {
82887
+ val2 = true;
82888
+ }
82889
+ if (val2 === "false") {
82890
+ val2 = false;
82891
+ }
82892
+ if (val2 === "") {
82893
+ val2 = false;
82894
+ }
82895
+ input.onChange(val2);
82896
+ onFieldSubmit(val2);
82897
+ },
82898
+ options: optionsToUse
82899
+ })
82900
+ );
82896
82901
  }, "renderBlueprintRadioGroup");
82897
82902
  const _RenderReactColorPicker = class _RenderReactColorPicker extends React$2.Component {
82898
82903
  constructor() {
@@ -123400,19 +123405,38 @@ ${latestSubscriptionCallbackError.current.stack}
123400
123405
  return parsingResultArray;
123401
123406
  }
123402
123407
  __name(flattenSequenceArray, "flattenSequenceArray");
123408
+ function wrapOriginSpanningFeatures(locArrayInput, sequenceLength, inclusive1BasedStart, inclusive1BasedEnd) {
123409
+ const locArrayOutput = locArrayInput.map((loc) => __spreadValues({}, loc));
123410
+ for (let i2 = 0; i2 < locArrayOutput.length - 1; i2++) {
123411
+ const firstFeature = locArrayOutput[i2];
123412
+ const secondFeature = locArrayOutput[i2 + 1];
123413
+ if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
123414
+ locArrayOutput[i2] = {
123415
+ start: firstFeature.start,
123416
+ end: secondFeature.end
123417
+ };
123418
+ locArrayOutput.splice(i2 + 1, 1);
123419
+ }
123420
+ }
123421
+ return locArrayOutput;
123422
+ }
123423
+ __name(wrapOriginSpanningFeatures, "wrapOriginSpanningFeatures");
123403
123424
  function parseFeatureLocation(locStr, isProtein2, inclusive1BasedStart, inclusive1BasedEnd, isCircular, sequenceLength) {
123404
123425
  locStr = locStr.trim();
123405
- const locArr = [];
123406
- locStr.replace(/(\d+)/g, function(string2, match2) {
123407
- locArr.push(match2);
123426
+ const positionsArray = [];
123427
+ const locationParts = locStr.split(",");
123428
+ locationParts.forEach((locPart) => {
123429
+ const extractedPositions = locPart.match(/(\d+)/g);
123430
+ if (extractedPositions === null) {
123431
+ return;
123432
+ }
123433
+ positionsArray.push(extractedPositions[0]);
123434
+ positionsArray.push(extractedPositions[1] || extractedPositions[0]);
123408
123435
  });
123409
123436
  const locArray = [];
123410
- for (let i2 = 0; i2 < locArr.length; i2 += 2) {
123411
- const start2 = parseInt(locArr[i2], 10) - (inclusive1BasedStart ? 0 : 1);
123412
- let end2 = parseInt(locArr[i2 + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
123413
- if (isNaN(end2)) {
123414
- end2 = start2;
123415
- }
123437
+ for (let i2 = 0; i2 < positionsArray.length; i2 += 2) {
123438
+ const start2 = parseInt(positionsArray[i2], 10) - (inclusive1BasedStart ? 0 : 1);
123439
+ const end2 = parseInt(positionsArray[i2 + 1], 10) - (inclusive1BasedEnd ? 0 : 1);
123416
123440
  const location2 = {
123417
123441
  start: start2,
123418
123442
  end: end2
@@ -123421,20 +123445,16 @@ ${latestSubscriptionCallbackError.current.stack}
123421
123445
  isProtein2 ? convertAACaretPositionOrRangeToDna(location2) : location2
123422
123446
  );
123423
123447
  }
123424
- if (isCircular) {
123425
- for (let i2 = 0; i2 < locArray.length; i2 += 2) {
123426
- const firstFeature = locArray[i2];
123427
- const secondFeature = locArray[i2 + 1];
123428
- if (firstFeature.end === sequenceLength - (inclusive1BasedEnd ? 0 : 1) && secondFeature.start === 1 - (inclusive1BasedStart ? 0 : 1)) {
123429
- locArray[i2] = {
123430
- start: firstFeature.start,
123431
- end: secondFeature.end
123432
- };
123433
- locArray.splice(i2 + 1, 1);
123434
- }
123435
- }
123448
+ if (isCircular && sequenceLength) {
123449
+ return wrapOriginSpanningFeatures(
123450
+ locArray,
123451
+ sequenceLength,
123452
+ inclusive1BasedStart,
123453
+ inclusive1BasedEnd
123454
+ );
123455
+ } else {
123456
+ return locArray;
123436
123457
  }
123437
- return locArray;
123438
123458
  }
123439
123459
  __name(parseFeatureLocation, "parseFeatureLocation");
123440
123460
  function genbankToJson(string2, options = {}) {
@@ -123531,7 +123551,7 @@ ${latestSubscriptionCallbackError.current.stack}
123531
123551
  parseOrigin(line, key2);
123532
123552
  break;
123533
123553
  case genbankAnnotationKey.END_SEQUENCE_TAG:
123534
- endSeq();
123554
+ endSeq(options);
123535
123555
  break;
123536
123556
  case genbankAnnotationKey.DEFINITION_TAG:
123537
123557
  line = line.replace(/DEFINITION/, "");
@@ -123636,9 +123656,9 @@ ${latestSubscriptionCallbackError.current.stack}
123636
123656
  }
123637
123657
  });
123638
123658
  return results;
123639
- function endSeq() {
123659
+ function endSeq(options2) {
123640
123660
  hasFoundLocus = false;
123641
- postProcessCurSeq();
123661
+ postProcessCurSeq(options2);
123642
123662
  resultsArray.push(result || { success: false });
123643
123663
  }
123644
123664
  __name(endSeq, "endSeq");
@@ -123652,11 +123672,13 @@ ${latestSubscriptionCallbackError.current.stack}
123652
123672
  }
123653
123673
  }
123654
123674
  __name(addMessage, "addMessage");
123655
- function postProcessCurSeq() {
123675
+ function postProcessCurSeq(options2) {
123656
123676
  if (result && result.parsedSequence && result.parsedSequence.features) {
123657
123677
  for (let i2 = 0; i2 < result.parsedSequence.features.length; i2++) {
123658
123678
  result.parsedSequence.features[i2] = postProcessGenbankFeature(
123659
- result.parsedSequence.features[i2]
123679
+ result.parsedSequence.features[i2],
123680
+ result.parsedSequence,
123681
+ options2
123660
123682
  );
123661
123683
  }
123662
123684
  }
@@ -123902,7 +123924,7 @@ ${latestSubscriptionCallbackError.current.stack}
123902
123924
  return runon;
123903
123925
  }
123904
123926
  __name(isKeywordRunon, "isKeywordRunon");
123905
- function postProcessGenbankFeature(feat) {
123927
+ function postProcessGenbankFeature(feat, parsedSequence, options2) {
123906
123928
  if (feat.notes.label) {
123907
123929
  feat.name = feat.notes.label[0];
123908
123930
  } else if (feat.notes.gene) {
@@ -123935,6 +123957,15 @@ ${latestSubscriptionCallbackError.current.stack}
123935
123957
  feat.arrowheadType = feat.notes.direction[0].toUpperCase() === "BOTH" ? "BOTH" : feat.notes.direction[0].toUpperCase() === "NONE" ? "NONE" : void 0;
123936
123958
  delete feat.notes.direction;
123937
123959
  }
123960
+ if (parsedSequence.circular) {
123961
+ const { inclusive1BasedStart: inclusive1BasedStart2, inclusive1BasedEnd: inclusive1BasedEnd2 } = options2;
123962
+ feat.locations = wrapOriginSpanningFeatures(
123963
+ feat.locations,
123964
+ parsedSequence.sequence.length,
123965
+ inclusive1BasedStart2,
123966
+ inclusive1BasedEnd2
123967
+ );
123968
+ }
123938
123969
  return feat;
123939
123970
  }
123940
123971
  __name(postProcessGenbankFeature, "postProcessGenbankFeature");
@@ -154625,7 +154656,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
154625
154656
  }
154626
154657
  __name(showFileDialog, "showFileDialog");
154627
154658
  const name = "@teselagen/ove";
154628
- const version = "0.5.2";
154659
+ const version = "0.5.3";
154629
154660
  const main = "./src/index.js";
154630
154661
  const exports$1 = {
154631
154662
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -12,10 +12,10 @@
12
12
  "dependencies": {
13
13
  "@teselagen/sequence-utils": "0.3.24",
14
14
  "@teselagen/range-utils": "0.3.7",
15
- "@teselagen/ui": "0.4.3",
15
+ "@teselagen/ui": "0.4.4",
16
16
  "@teselagen/file-utils": "0.3.16",
17
17
  "@teselagen/bounce-loader": "0.3.11",
18
- "@teselagen/bio-parsers": "0.4.15",
18
+ "@teselagen/bio-parsers": "0.4.16",
19
19
  "@blueprintjs/core": "3.52.0",
20
20
  "@blueprintjs/datetime": "3.23.19",
21
21
  "@blueprintjs/icons": "3.33.0",