@teselagen/ove 0.5.13 → 0.5.14

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.es.js CHANGED
@@ -14453,10 +14453,10 @@ var _objectKeysInternal = /* @__PURE__ */ __name(function(object3, names2) {
14453
14453
  return result;
14454
14454
  }, "_objectKeysInternal");
14455
14455
  var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
14456
- var $keys$3 = _objectKeysInternal;
14456
+ var $keys$2 = _objectKeysInternal;
14457
14457
  var enumBugKeys$1 = _enumBugKeys;
14458
14458
  var _objectKeys = Object.keys || /* @__PURE__ */ __name(function keys(O2) {
14459
- return $keys$3(O2, enumBugKeys$1);
14459
+ return $keys$2(O2, enumBugKeys$1);
14460
14460
  }, "keys");
14461
14461
  var _objectGops = {};
14462
14462
  _objectGops.f = Object.getOwnPropertySymbols;
@@ -14889,11 +14889,11 @@ var ArrayProto = Array.prototype;
14889
14889
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
14890
14890
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
14891
14891
  }, "_isArrayIter");
14892
- var $defineProperty$4 = require_objectDp();
14892
+ var $defineProperty$3 = require_objectDp();
14893
14893
  var createDesc$2 = _propertyDesc;
14894
14894
  var _createProperty = /* @__PURE__ */ __name(function(object3, index2, value) {
14895
14895
  if (index2 in object3)
14896
- $defineProperty$4.f(object3, index2, createDesc$2(0, value));
14896
+ $defineProperty$3.f(object3, index2, createDesc$2(0, value));
14897
14897
  else
14898
14898
  object3[index2] = value;
14899
14899
  }, "_createProperty");
@@ -15141,13 +15141,21 @@ var _isArray = Array.isArray || /* @__PURE__ */ __name(function isArray(arg) {
15141
15141
  }, "isArray");
15142
15142
  var _objectGopnExt = {};
15143
15143
  var _objectGopn = {};
15144
- var $keys$2 = _objectKeysInternal;
15145
- var hiddenKeys = _enumBugKeys.concat("length", "prototype");
15146
- _objectGopn.f = Object.getOwnPropertyNames || /* @__PURE__ */ __name(function getOwnPropertyNames(O2) {
15147
- return $keys$2(O2, hiddenKeys);
15148
- }, "getOwnPropertyNames");
15144
+ var hasRequired_objectGopn;
15145
+ function require_objectGopn() {
15146
+ if (hasRequired_objectGopn)
15147
+ return _objectGopn;
15148
+ hasRequired_objectGopn = 1;
15149
+ var $keys2 = _objectKeysInternal;
15150
+ var hiddenKeys = _enumBugKeys.concat("length", "prototype");
15151
+ _objectGopn.f = Object.getOwnPropertyNames || /* @__PURE__ */ __name(function getOwnPropertyNames4(O2) {
15152
+ return $keys2(O2, hiddenKeys);
15153
+ }, "getOwnPropertyNames");
15154
+ return _objectGopn;
15155
+ }
15156
+ __name(require_objectGopn, "require_objectGopn");
15149
15157
  var toIObject$2 = _toIobject;
15150
- var gOPN$1 = _objectGopn.f;
15158
+ var gOPN$1 = require_objectGopn().f;
15151
15159
  var toString$4 = {}.toString;
15152
15160
  var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
15153
15161
  var getWindowNames = /* @__PURE__ */ __name(function(it) {
@@ -15157,7 +15165,7 @@ var getWindowNames = /* @__PURE__ */ __name(function(it) {
15157
15165
  return windowNames.slice();
15158
15166
  }
15159
15167
  }, "getWindowNames");
15160
- _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
15168
+ _objectGopnExt.f = /* @__PURE__ */ __name(function getOwnPropertyNames(it) {
15161
15169
  return windowNames && toString$4.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
15162
15170
  }, "getOwnPropertyNames");
15163
15171
  var _objectGopd = {};
@@ -15247,9 +15255,9 @@ var isSymbol$7 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
15247
15255
  } : function(it) {
15248
15256
  return it instanceof $Symbol;
15249
15257
  };
15250
- var $defineProperty$3 = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
15258
+ var $defineProperty$2 = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
15251
15259
  if (it === ObjectProto)
15252
- $defineProperty$3(OPSymbols, key, D2);
15260
+ $defineProperty$2(OPSymbols, key, D2);
15253
15261
  anObject(it);
15254
15262
  key = toPrimitive(key, true);
15255
15263
  anObject(D2);
@@ -15274,7 +15282,7 @@ var $defineProperties = /* @__PURE__ */ __name(function defineProperties2(it, P2
15274
15282
  var l2 = keys5.length;
15275
15283
  var key;
15276
15284
  while (l2 > i)
15277
- $defineProperty$3(it, key = keys5[i++], P2[key]);
15285
+ $defineProperty$2(it, key = keys5[i++], P2[key]);
15278
15286
  return it;
15279
15287
  }, "defineProperties");
15280
15288
  var $create = /* @__PURE__ */ __name(function create2(it, P2) {
@@ -15296,7 +15304,7 @@ var $getOwnPropertyDescriptor = /* @__PURE__ */ __name(function getOwnPropertyDe
15296
15304
  D2.enumerable = true;
15297
15305
  return D2;
15298
15306
  }, "getOwnPropertyDescriptor");
15299
- var $getOwnPropertyNames = /* @__PURE__ */ __name(function getOwnPropertyNames3(it) {
15307
+ var $getOwnPropertyNames = /* @__PURE__ */ __name(function getOwnPropertyNames2(it) {
15300
15308
  var names2 = gOPN(toIObject(it));
15301
15309
  var result = [];
15302
15310
  var i = 0;
@@ -15339,8 +15347,8 @@ if (!USE_NATIVE) {
15339
15347
  return this._k;
15340
15348
  }, "toString"));
15341
15349
  $GOPD.f = $getOwnPropertyDescriptor;
15342
- $DP.f = $defineProperty$3;
15343
- _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
15350
+ $DP.f = $defineProperty$2;
15351
+ require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames;
15344
15352
  require_objectPie().f = $propertyIsEnumerable;
15345
15353
  $GOPS.f = $getOwnPropertySymbols;
15346
15354
  if (DESCRIPTORS && !_library) {
@@ -15382,7 +15390,7 @@ $export$2($export$2.S + $export$2.F * !USE_NATIVE, "Object", {
15382
15390
  // 19.1.2.2 Object.create(O [, Properties])
15383
15391
  create: $create,
15384
15392
  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
15385
- defineProperty: $defineProperty$3,
15393
+ defineProperty: $defineProperty$2,
15386
15394
  // 19.1.2.3 Object.defineProperties(O, Properties)
15387
15395
  defineProperties: $defineProperties,
15388
15396
  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
@@ -37267,16 +37275,25 @@ var getIntrinsic = /* @__PURE__ */ __name(function GetIntrinsic(name2, allowMiss
37267
37275
  return value;
37268
37276
  }, "GetIntrinsic");
37269
37277
  var callBind$3 = { exports: {} };
37270
- var GetIntrinsic$4 = getIntrinsic;
37271
- var $defineProperty$2 = GetIntrinsic$4("%Object.defineProperty%", true) || false;
37272
- if ($defineProperty$2) {
37273
- try {
37274
- $defineProperty$2({}, "a", { value: 1 });
37275
- } catch (e2) {
37276
- $defineProperty$2 = false;
37278
+ var esDefineProperty;
37279
+ var hasRequiredEsDefineProperty;
37280
+ function requireEsDefineProperty() {
37281
+ if (hasRequiredEsDefineProperty)
37282
+ return esDefineProperty;
37283
+ hasRequiredEsDefineProperty = 1;
37284
+ var GetIntrinsic3 = getIntrinsic;
37285
+ var $defineProperty2 = GetIntrinsic3("%Object.defineProperty%", true) || false;
37286
+ if ($defineProperty2) {
37287
+ try {
37288
+ $defineProperty2({}, "a", { value: 1 });
37289
+ } catch (e2) {
37290
+ $defineProperty2 = false;
37291
+ }
37277
37292
  }
37293
+ esDefineProperty = $defineProperty2;
37294
+ return esDefineProperty;
37278
37295
  }
37279
- var esDefineProperty = $defineProperty$2;
37296
+ __name(requireEsDefineProperty, "requireEsDefineProperty");
37280
37297
  var GetIntrinsic$3 = getIntrinsic;
37281
37298
  var $gOPD$1 = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", true);
37282
37299
  if ($gOPD$1) {
@@ -37287,7 +37304,7 @@ if ($gOPD$1) {
37287
37304
  }
37288
37305
  }
37289
37306
  var gopd$1 = $gOPD$1;
37290
- var $defineProperty$1 = esDefineProperty;
37307
+ var $defineProperty$1 = requireEsDefineProperty();
37291
37308
  var $SyntaxError = syntax;
37292
37309
  var $TypeError$4 = type$1;
37293
37310
  var gopd = gopd$1;
@@ -37328,7 +37345,7 @@ var defineDataProperty$1 = /* @__PURE__ */ __name(function defineDataProperty(ob
37328
37345
  throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
37329
37346
  }
37330
37347
  }, "defineDataProperty");
37331
- var $defineProperty = esDefineProperty;
37348
+ var $defineProperty = requireEsDefineProperty();
37332
37349
  var hasPropertyDescriptors = /* @__PURE__ */ __name(function hasPropertyDescriptors2() {
37333
37350
  return !!$defineProperty;
37334
37351
  }, "hasPropertyDescriptors");
@@ -37397,7 +37414,7 @@ var setFunctionLength = /* @__PURE__ */ __name(function setFunctionLength2(fn4,
37397
37414
  var $apply = GetIntrinsic3("%Function.prototype.apply%");
37398
37415
  var $call = GetIntrinsic3("%Function.prototype.call%");
37399
37416
  var $reflectApply = GetIntrinsic3("%Reflect.apply%", true) || bind3.call($call, $apply);
37400
- var $defineProperty2 = esDefineProperty;
37417
+ var $defineProperty2 = requireEsDefineProperty();
37401
37418
  var $max = GetIntrinsic3("%Math.max%");
37402
37419
  module2.exports = /* @__PURE__ */ __name(function callBind2(originalFunction) {
37403
37420
  if (typeof originalFunction !== "function") {
@@ -49864,7 +49881,7 @@ var KNOWN_STATICS = {
49864
49881
  arity: true
49865
49882
  };
49866
49883
  var defineProperty$3 = Object.defineProperty;
49867
- var getOwnPropertyNames4 = Object.getOwnPropertyNames;
49884
+ var getOwnPropertyNames3 = Object.getOwnPropertyNames;
49868
49885
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
49869
49886
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
49870
49887
  var getPrototypeOf = Object.getPrototypeOf;
@@ -49877,7 +49894,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
49877
49894
  hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
49878
49895
  }
49879
49896
  }
49880
- var keys5 = getOwnPropertyNames4(sourceComponent);
49897
+ var keys5 = getOwnPropertyNames3(sourceComponent);
49881
49898
  if (getOwnPropertySymbols3) {
49882
49899
  keys5 = keys5.concat(getOwnPropertySymbols3(sourceComponent));
49883
49900
  }
@@ -78874,123 +78891,167 @@ function getAminoAcidFromSequenceTriplet(sequenceString) {
78874
78891
  return proteinAlphabet[letter.toUpperCase()];
78875
78892
  }
78876
78893
  __name(getAminoAcidFromSequenceTriplet, "getAminoAcidFromSequenceTriplet");
78877
- function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optionalSubrangeRange, isProteinSequence) {
78894
+ function getNextTriplet(index2, sequenceString, exonRange) {
78895
+ let triplet = "";
78896
+ let internalIndex;
78897
+ const codonPositions = [];
78898
+ const isBaseInExon = /* @__PURE__ */ __name((baseIndex) => exonRange.some(
78899
+ (r2) => isPositionWithinRange(baseIndex, r2, sequenceString.length, true, false)
78900
+ ), "isBaseInExon");
78901
+ for (internalIndex = index2; internalIndex < sequenceString.length; internalIndex++) {
78902
+ if (triplet.length === 3) {
78903
+ break;
78904
+ }
78905
+ if (isBaseInExon(internalIndex)) {
78906
+ triplet += sequenceString[internalIndex];
78907
+ codonPositions.push(internalIndex);
78908
+ }
78909
+ }
78910
+ return { triplet, basesRead: internalIndex - index2, codonPositions };
78911
+ }
78912
+ __name(getNextTriplet, "getNextTriplet");
78913
+ function getTranslatedSequenceProperties(originalSequenceString, forward, optionalSubrangeRange, isProteinSequence) {
78878
78914
  const originalSequenceStringLength = isProteinSequence ? originalSequenceString.length * 3 : originalSequenceString.length;
78879
78915
  let sequenceString = originalSequenceString;
78880
- let startOffset = 0;
78916
+ const translationRange = { start: 0, end: originalSequenceStringLength - 1 };
78881
78917
  if (optionalSubrangeRange) {
78882
78918
  sequenceString = getSequenceWithinRange(
78883
78919
  optionalSubrangeRange,
78884
78920
  originalSequenceString
78885
78921
  );
78886
- startOffset = optionalSubrangeRange.start;
78922
+ translationRange.start = optionalSubrangeRange.start;
78923
+ translationRange.end = optionalSubrangeRange.end;
78887
78924
  }
78888
78925
  const sequenceStringLength = isProteinSequence ? sequenceString.length * 3 : sequenceString.length;
78889
- const aminoAcidDataForEachBaseOfDNA = [];
78890
- let codonRange;
78891
- let revCompGapLength = 0;
78892
- let aminoAcidIndex = 0;
78893
- if (!forward) {
78894
- aminoAcidIndex = Math.floor((sequenceStringLength - 1) / 3);
78895
- revCompGapLength = sequenceStringLength % 3;
78896
- codonRange = translateRange(
78897
- {
78898
- start: 0,
78899
- end: revCompGapLength - 1
78900
- },
78901
- startOffset,
78926
+ if (!isProteinSequence && !forward) {
78927
+ sequenceString = getReverseComplementSequenceString(sequenceString);
78928
+ }
78929
+ const absoluteExonRange = !isProteinSequence && optionalSubrangeRange && optionalSubrangeRange.locations ? optionalSubrangeRange.locations : [translationRange];
78930
+ const exonRange = absoluteExonRange.map((range2) => {
78931
+ let outputRange = translateRange(
78932
+ range2,
78933
+ -translationRange.start,
78902
78934
  originalSequenceStringLength
78903
78935
  );
78904
- if (revCompGapLength > 0) {
78905
- for (let i = 0; i < revCompGapLength; i++) {
78906
- aminoAcidDataForEachBaseOfDNA.push({
78907
- aminoAcid: getAminoAcidFromSequenceTriplet("xxx"),
78908
- //fake xxx triplet returns the ambiguous X amino acid
78909
- positionInCodon: revCompGapLength - i - 1,
78910
- aminoAcidIndex,
78911
- sequenceIndex: codonRange.start + i,
78912
- codonRange,
78913
- fullCodon: false
78914
- });
78915
- }
78916
- aminoAcidIndex--;
78936
+ if (!forward) {
78937
+ outputRange = flipRelativeRange(
78938
+ outputRange,
78939
+ { start: 0, end: sequenceStringLength - 1 },
78940
+ sequenceStringLength
78941
+ );
78917
78942
  }
78943
+ return outputRange;
78944
+ });
78945
+ return {
78946
+ sequenceString,
78947
+ translationRange,
78948
+ sequenceStringLength,
78949
+ originalSequenceStringLength,
78950
+ exonRange
78951
+ };
78952
+ }
78953
+ __name(getTranslatedSequenceProperties, "getTranslatedSequenceProperties");
78954
+ function positionInCdsToPositionInMainSequence(index2, forward, translationRange, mainSequenceLength) {
78955
+ let outputRange = translateRange(
78956
+ { start: index2, end: index2 },
78957
+ translationRange.start,
78958
+ mainSequenceLength
78959
+ );
78960
+ if (!forward) {
78961
+ outputRange = flipRelativeRange(
78962
+ outputRange,
78963
+ translationRange,
78964
+ mainSequenceLength
78965
+ );
78918
78966
  }
78919
- for (let index2 = 2 + revCompGapLength; index2 < sequenceStringLength; index2 += 3) {
78967
+ return outputRange.start;
78968
+ }
78969
+ __name(positionInCdsToPositionInMainSequence, "positionInCdsToPositionInMainSequence");
78970
+ function getAminoAcidDataForEachBaseOfDna(originalSequenceString, forward, optionalSubrangeRange, isProteinSequence) {
78971
+ const {
78972
+ sequenceString,
78973
+ translationRange,
78974
+ sequenceStringLength,
78975
+ originalSequenceStringLength,
78976
+ exonRange
78977
+ } = getTranslatedSequenceProperties(
78978
+ originalSequenceString,
78979
+ forward,
78980
+ optionalSubrangeRange,
78981
+ isProteinSequence
78982
+ );
78983
+ const aminoAcidDataForEachBaseOfDNA = [];
78984
+ for (let index2 = 0; index2 < sequenceStringLength; index2 += 3) {
78920
78985
  let aminoAcid;
78986
+ const aminoAcidIndex = index2 / 3;
78987
+ let codonPositionsInCDS;
78988
+ let basesRead;
78921
78989
  if (isProteinSequence) {
78922
- aminoAcid = proteinAlphabet[sequenceString[(index2 - 2) / 3].toUpperCase()];
78990
+ codonPositionsInCDS = [0, 1, 2].map((i) => index2 + i);
78991
+ basesRead = 3;
78992
+ aminoAcid = proteinAlphabet[sequenceString[index2 / 3].toUpperCase()];
78923
78993
  } else {
78924
- let triplet = sequenceString.slice(index2 - 2, index2 + 1);
78925
- if (!forward) {
78926
- triplet = getReverseComplementSequenceString(triplet);
78927
- }
78928
- aminoAcid = getAminoAcidFromSequenceTriplet(triplet);
78929
- }
78930
- codonRange = translateRange(
78931
- {
78932
- start: index2 - 2,
78933
- end: index2
78934
- },
78935
- startOffset,
78936
- originalSequenceStringLength
78994
+ const {
78995
+ triplet,
78996
+ basesRead: _basesRead,
78997
+ codonPositions
78998
+ } = getNextTriplet(index2, sequenceString, exonRange);
78999
+ basesRead = _basesRead;
79000
+ codonPositionsInCDS = codonPositions;
79001
+ aminoAcid = triplet.length === 3 ? getAminoAcidFromSequenceTriplet(triplet) : getAminoAcidFromSequenceTriplet("xxx");
79002
+ }
79003
+ const absoluteCodonPositions = codonPositionsInCDS.map(
79004
+ (i) => positionInCdsToPositionInMainSequence(
79005
+ i,
79006
+ forward,
79007
+ translationRange,
79008
+ originalSequenceStringLength
79009
+ )
78937
79010
  );
78938
- aminoAcidDataForEachBaseOfDNA.push({
78939
- aminoAcid,
78940
- //gap amino acid
78941
- positionInCodon: forward ? 0 : 2,
78942
- aminoAcidIndex,
78943
- sequenceIndex: codonRange.start,
78944
- codonRange,
78945
- fullCodon: true
78946
- });
78947
- aminoAcidDataForEachBaseOfDNA.push({
78948
- aminoAcid,
78949
- //gap amino acid
78950
- positionInCodon: 1,
78951
- aminoAcidIndex,
78952
- sequenceIndex: codonRange.start + 1,
78953
- codonRange,
78954
- fullCodon: true
78955
- });
78956
- aminoAcidDataForEachBaseOfDNA.push({
78957
- aminoAcid,
78958
- //gap amino acid
78959
- positionInCodon: forward ? 2 : 0,
78960
- aminoAcidIndex,
78961
- sequenceIndex: codonRange.start + 2,
78962
- codonRange,
78963
- fullCodon: true
78964
- });
78965
- if (forward) {
78966
- aminoAcidIndex++;
78967
- } else {
78968
- aminoAcidIndex--;
79011
+ const codonRange = forward ? {
79012
+ start: absoluteCodonPositions[0],
79013
+ end: absoluteCodonPositions[codonPositionsInCDS.length - 1]
79014
+ } : {
79015
+ start: absoluteCodonPositions[codonPositionsInCDS.length - 1],
79016
+ end: absoluteCodonPositions[0]
79017
+ };
79018
+ let positionInCodon = 0;
79019
+ for (let i = 0; i < basesRead; i++) {
79020
+ const posInCds = i + index2;
79021
+ if (codonPositionsInCDS.includes(posInCds)) {
79022
+ aminoAcidDataForEachBaseOfDNA.push({
79023
+ aminoAcid,
79024
+ positionInCodon,
79025
+ aminoAcidIndex,
79026
+ sequenceIndex: absoluteCodonPositions[i],
79027
+ codonRange,
79028
+ fullCodon: codonPositionsInCDS.length === 3
79029
+ });
79030
+ positionInCodon++;
79031
+ } else {
79032
+ aminoAcidDataForEachBaseOfDNA.push({
79033
+ aminoAcid: null,
79034
+ positionInCodon: null,
79035
+ aminoAcidIndex: null,
79036
+ sequenceIndex: positionInCdsToPositionInMainSequence(
79037
+ posInCds,
79038
+ forward,
79039
+ translationRange,
79040
+ originalSequenceStringLength
79041
+ ),
79042
+ codonRange: null,
79043
+ fullCodon: null
79044
+ });
79045
+ }
78969
79046
  }
78970
- }
78971
- const lengthOfEndBpsNotCoveredByAminoAcids = sequenceStringLength - aminoAcidDataForEachBaseOfDNA.length;
78972
- codonRange = translateRange(
78973
- {
78974
- start: sequenceStringLength - lengthOfEndBpsNotCoveredByAminoAcids,
78975
- end: sequenceStringLength - 1
78976
- },
78977
- startOffset,
78978
- originalSequenceStringLength
78979
- );
78980
- for (let j = 0; j < lengthOfEndBpsNotCoveredByAminoAcids; j++) {
78981
- aminoAcidDataForEachBaseOfDNA.push({
78982
- aminoAcid: getAminoAcidFromSequenceTriplet("xxx"),
78983
- //fake xxx triplet returns the gap amino acid
78984
- positionInCodon: j,
78985
- aminoAcidIndex,
78986
- sequenceIndex: codonRange.start + j,
78987
- fullCodon: false,
78988
- codonRange
78989
- });
79047
+ index2 += basesRead - codonPositionsInCDS.length;
78990
79048
  }
78991
79049
  if (sequenceStringLength !== aminoAcidDataForEachBaseOfDNA.length) {
78992
79050
  throw new Error("something went wrong!");
78993
79051
  }
79052
+ if (!forward) {
79053
+ aminoAcidDataForEachBaseOfDNA.reverse();
79054
+ }
78994
79055
  return aminoAcidDataForEachBaseOfDNA;
78995
79056
  }
78996
79057
  __name(getAminoAcidDataForEachBaseOfDna, "getAminoAcidDataForEachBaseOfDna");
@@ -118604,7 +118665,7 @@ function AASliver(props) {
118604
118665
  fill: color2 || "gray"
118605
118666
  }
118606
118667
  )),
118607
- !isFiller && /* @__PURE__ */ React__default$1.createElement(
118668
+ (!isFiller || isTruncatedEnd && isTruncatedStart) && /* @__PURE__ */ React__default$1.createElement(
118608
118669
  "text",
118609
118670
  {
118610
118671
  fontSize: 25,
@@ -118681,18 +118742,39 @@ const _Translation = class _Translation extends React__default$1.Component {
118681
118742
  subrangeStartRelativeToAnnotationStart,
118682
118743
  aminoAcids
118683
118744
  );
118745
+ let prevAaSliver;
118746
+ let nextAaSliver = aminoAcidsForSubrange[1];
118747
+ const lastIndex = aminoAcidsForSubrange.length - 1;
118684
118748
  const translationSVG = aminoAcidsForSubrange.map(
118685
118749
  function(aminoAcidSliver, index2) {
118686
- const isEndFiller = index2 === 0 && aminoAcidSliver.positionInCodon === (annotation.forward ? 2 : 0);
118687
- let isTruncatedEnd = index2 === 0 && aminoAcidSliver.positionInCodon === 1;
118688
- let isTruncatedStart = index2 === aminoAcidsForSubrange.length - 1 && aminoAcidSliver.positionInCodon === 1;
118750
+ if (aminoAcidSliver.positionInCodon === null) {
118751
+ prevAaSliver = aminoAcidSliver;
118752
+ nextAaSliver = aminoAcidsForSubrange[index2 + 2];
118753
+ return /* @__PURE__ */ React__default$1.createElement(
118754
+ "rect",
118755
+ {
118756
+ x: index2 * charWidth2,
118757
+ y: height2 / 2 - height2 / 16,
118758
+ width: charWidth2,
118759
+ height: height2 / 8,
118760
+ fill: "grey",
118761
+ stroke: "black",
118762
+ strokeWidth: 1
118763
+ }
118764
+ );
118765
+ }
118766
+ const isEndFiller = (index2 === 0 || (prevAaSliver == null ? void 0 : prevAaSliver.positionInCodon) === null) && aminoAcidSliver.positionInCodon === (annotation.forward ? 2 : 0);
118767
+ const isStartFiller = (index2 === lastIndex || (nextAaSliver == null ? void 0 : nextAaSliver.positionInCodon) === null) && aminoAcidSliver.positionInCodon === (annotation.forward ? 0 : 2);
118768
+ let isTruncatedEnd = (index2 === 0 || (prevAaSliver == null ? void 0 : prevAaSliver.positionInCodon) === null) && aminoAcidSliver.positionInCodon === 1;
118769
+ let isTruncatedStart = (index2 === lastIndex || (nextAaSliver == null ? void 0 : nextAaSliver.positionInCodon) === null) && aminoAcidSliver.positionInCodon === 1;
118689
118770
  if (!annotation.forward) {
118690
118771
  const holder = isTruncatedEnd;
118691
118772
  isTruncatedEnd = isTruncatedStart;
118692
118773
  isTruncatedStart = holder;
118693
118774
  }
118694
- const isStartFiller = index2 === aminoAcidsForSubrange.length - 1 && aminoAcidSliver.positionInCodon === (annotation.forward ? 0 : 2);
118695
118775
  if (aminoAcidSliver.positionInCodon !== 1 && !isStartFiller && !isEndFiller) {
118776
+ prevAaSliver = aminoAcidSliver;
118777
+ nextAaSliver = aminoAcidsForSubrange[index2 + 2];
118696
118778
  return null;
118697
118779
  }
118698
118780
  const { gapsInside, gapsBefore } = getGaps2(aminoAcidSliver.codonRange);
@@ -118709,10 +118791,12 @@ const _Translation = class _Translation extends React__default$1.Component {
118709
118791
  } else {
118710
118792
  color2 = aminoAcid.color;
118711
118793
  }
118794
+ prevAaSliver = aminoAcidSliver;
118795
+ nextAaSliver = aminoAcidsForSubrange[index2 + 2];
118712
118796
  return /* @__PURE__ */ React__default$1.createElement(
118713
118797
  AASliver$1,
118714
118798
  {
118715
- isFiller: isEndFiller || isStartFiller,
118799
+ isFiller: isEndFiller || isStartFiller || isTruncatedEnd && isTruncatedStart,
118716
118800
  isTruncatedEnd,
118717
118801
  isTruncatedStart,
118718
118802
  onClick: function(event) {
@@ -120945,7 +121029,7 @@ function showFileDialog({ multiple = false, onSelect }) {
120945
121029
  }
120946
121030
  __name(showFileDialog, "showFileDialog");
120947
121031
  const name = "@teselagen/ove";
120948
- const version = "0.5.12";
121032
+ const version = "0.5.13";
120949
121033
  const main = "./src/index.js";
120950
121034
  const type = "module";
120951
121035
  const exports$1 = {