@teselagen/sequence-utils 0.3.7 → 0.3.8

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.
Files changed (104) hide show
  1. package/README.md +89 -0
  2. package/bioData.d.ts +0 -339
  3. package/index.d.ts +7 -7
  4. package/index.js +238 -384
  5. package/index.mjs +238 -384
  6. package/index.umd.js +238 -384
  7. package/package.json +1 -2
  8. package/src/addGapsToSeqReads.js +2 -2
  9. package/src/adjustAnnotationsToInsert.js +3 -3
  10. package/src/adjustBpsToReplaceOrInsert.js +3 -3
  11. package/src/adjustBpsToReplaceOrInsert.test.js +0 -1
  12. package/src/aminoAcidToDnaRna.test.js +1 -1
  13. package/src/annotateSingleSeq.js +1 -1
  14. package/src/annotateSingleSeq.test.js +1 -4
  15. package/src/autoAnnotate.js +5 -2
  16. package/src/autoAnnotate.test.js +6 -30
  17. package/src/bioData.js +0 -365
  18. package/src/calculateNebTa.js +1 -1
  19. package/src/calculateNebTm.js +1 -1
  20. package/src/calculatePercentGC.js +2 -2
  21. package/src/calculateTm.js +19 -102
  22. package/src/computeDigestFragments.js +7 -4
  23. package/src/computeDigestFragments.test.js +1 -1
  24. package/src/condensePairwiseAlignmentDifferences.js +1 -1
  25. package/src/convertAACaretPositionOrRangeToDna.js +1 -1
  26. package/src/convertDnaCaretPositionOrRangeToAA.js +1 -1
  27. package/src/cutSequenceByRestrictionEnzyme.js +3 -3
  28. package/src/cutSequenceByRestrictionEnzyme.test.js +0 -1
  29. package/src/degenerateDnaToAminoAcidMap.js +1 -1
  30. package/src/degenerateRnaToAminoAcidMap.js +1 -1
  31. package/src/deleteSequenceDataAtRange.js +1 -1
  32. package/src/deleteSequenceDataAtRange.test.js +23 -9
  33. package/src/diffUtils.js +4 -4
  34. package/src/diffUtils.test.js +2 -2
  35. package/src/doesEnzymeChopOutsideOfRecognitionSite.js +1 -1
  36. package/src/doesEnzymeChopOutsideOfRecognitionSite.test.js +0 -2
  37. package/src/featureTypesAndColors.js +5 -5
  38. package/src/featureTypesAndColors.test.js +1 -1
  39. package/src/filterAminoAcidSequenceString.js +4 -7
  40. package/src/filterAminoAcidSequenceString.test.js +3 -1
  41. package/src/filterSequenceString.js +5 -3
  42. package/src/findNearestRangeOfSequenceOverlapToPosition.js +1 -1
  43. package/src/findOrfsInPlasmid.js +1 -1
  44. package/src/findSequenceMatches.js +9 -10
  45. package/src/generateAnnotations.js +1 -1
  46. package/src/generateSequenceData.js +1 -1
  47. package/src/generateSequenceData.test.js +1 -1
  48. package/src/getAllInsertionsInSeqReads.js +1 -1
  49. package/src/getAminoAcidDataForEachBaseOfDna.js +2 -2
  50. package/src/getAminoAcidDataForEachBaseOfDna.test.js +0 -2
  51. package/src/getAminoAcidFromSequenceTriplet.js +1 -1
  52. package/src/getAminoAcidStringFromSequenceString.js +1 -1
  53. package/src/getCodonRangeForAASliver.js +1 -1
  54. package/src/getComplementAminoAcidStringFromSequenceString.js +2 -5
  55. package/src/getComplementSequenceAndAnnotations.js +1 -2
  56. package/src/getComplementSequenceString.js +5 -3
  57. package/src/getComplementSequenceString.test.js +6 -6
  58. package/src/getCutsiteType.js +1 -1
  59. package/src/getCutsitesFromSequence.js +1 -1
  60. package/src/getDegenerateDnaStringFromAAString.js +1 -1
  61. package/src/getDegenerateRnaStringFromAAString.js +1 -1
  62. package/src/getDigestFragmentsForCutsites.js +5 -2
  63. package/src/getDigestFragmentsForRestrictionEnzymes.js +2 -2
  64. package/src/getInsertBetweenVals.js +2 -2
  65. package/src/getLeftAndRightOfSequenceInRangeGivenPosition.js +2 -2
  66. package/src/getLeftAndRightOfSequenceInRangeGivenPosition.test.js +0 -2
  67. package/src/getMassOfAaString.js +4 -1
  68. package/src/getMassofAaString.test.js +9 -8
  69. package/src/getOrfsFromSequence.js +1 -2
  70. package/src/getOrfsFromSequence.test.js +1 -3
  71. package/src/getOverlapBetweenTwoSequences.js +3 -3
  72. package/src/getOverlapBetweenTwoSequences.test.js +1 -1
  73. package/src/getPossiblePartsFromSequenceAndEnzymes.js +2 -2
  74. package/src/getReverseAminoAcidStringFromSequenceString.js +1 -1
  75. package/src/getReverseComplementAminoAcidStringFromSequenceString.js +9 -6
  76. package/src/getReverseComplementAnnotation.js +1 -1
  77. package/src/getReverseComplementSequenceAndAnnotations.js +2 -3
  78. package/src/getReverseComplementSequenceString.js +1 -2
  79. package/src/getReverseSequenceString.js +1 -1
  80. package/src/getSequenceDataBetweenRange.js +7 -4
  81. package/src/getSequenceDataBetweenRange.test.js +0 -1
  82. package/src/getVirtualDigest.js +6 -3
  83. package/src/guessIfSequenceIsDnaAndNotProtein.js +2 -2
  84. package/src/index.js +80 -80
  85. package/src/index.test.js +5 -4
  86. package/src/insertGapsIntoRefSeq.js +1 -1
  87. package/src/insertSequenceDataAtPosition.test.js +4 -2
  88. package/src/insertSequenceDataAtPositionOrRange.js +5 -5
  89. package/src/insertSequenceDataAtPositionOrRange.test.js +3 -17
  90. package/src/isEnzymeType2S.js +1 -1
  91. package/src/mapAnnotationsToRows.js +3 -3
  92. package/src/mapAnnotationsToRows.test.js +1 -3
  93. package/src/prepareCircularViewData.js +5 -5
  94. package/src/prepareCircularViewData.test.js +1 -1
  95. package/src/prepareRowData.js +1 -2
  96. package/src/prepareRowData.test.js +1 -3
  97. package/src/prepareRowData_output1.json +381 -381
  98. package/src/proteinAlphabet.js +34 -26
  99. package/src/rotateBpsToPosition.js +7 -11
  100. package/src/rotateBpsToPosition.test.js +6 -6
  101. package/src/rotateSequenceDataToPosition.js +4 -4
  102. package/src/shiftAnnotationsByLen.js +2 -2
  103. package/src/tidyUpAnnotation.js +8 -7
  104. package/src/tidyUpSequenceData.js +3 -3
package/index.umd.js CHANGED
@@ -6002,30 +6002,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6002
6002
  var lodashExports = lodash.exports;
6003
6003
  const protein_letters = "ACDEFGHIKLMNPQRSTVWY";
6004
6004
  const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO.*-";
6005
- const protein_letters_1to3 = {
6006
- A: "Ala",
6007
- C: "Cys",
6008
- D: "Asp",
6009
- E: "Glu",
6010
- F: "Phe",
6011
- G: "Gly",
6012
- H: "His",
6013
- I: "Ile",
6014
- K: "Lys",
6015
- L: "Leu",
6016
- M: "Met",
6017
- N: "Asn",
6018
- P: "Pro",
6019
- Q: "Gln",
6020
- R: "Arg",
6021
- S: "Ser",
6022
- T: "Thr",
6023
- V: "Val",
6024
- W: "Trp",
6025
- Y: "Tyr",
6026
- O: "Pyl",
6027
- U: "Sec"
6028
- };
6029
6005
  const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
6030
6006
  const unambiguous_dna_letters = "GATC";
6031
6007
  const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
@@ -6050,135 +6026,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6050
6026
  X: "GATC",
6051
6027
  N: "GATC"
6052
6028
  };
6053
- const ambiguous_rna_values = {
6054
- ".": ".",
6055
- A: "A",
6056
- C: "C",
6057
- G: "G",
6058
- U: "U",
6059
- M: "AC",
6060
- R: "AG",
6061
- W: "AU",
6062
- S: "CG",
6063
- Y: "CU",
6064
- K: "GU",
6065
- V: "ACG",
6066
- H: "ACU",
6067
- D: "AGU",
6068
- B: "CGU",
6069
- X: "GAUC",
6070
- N: "GAUC"
6071
- };
6072
- const ambiguous_dna_complement = {
6073
- ".": ".",
6074
- A: "T",
6075
- C: "G",
6076
- G: "C",
6077
- T: "A",
6078
- M: "K",
6079
- R: "Y",
6080
- W: "W",
6081
- S: "S",
6082
- Y: "R",
6083
- K: "M",
6084
- V: "B",
6085
- H: "D",
6086
- D: "H",
6087
- B: "V",
6088
- X: "X",
6089
- N: "N"
6090
- };
6091
- const ambiguous_rna_complement = {
6092
- ".": ".",
6093
- A: "U",
6094
- C: "G",
6095
- G: "C",
6096
- U: "A",
6097
- M: "K",
6098
- R: "Y",
6099
- W: "W",
6100
- S: "S",
6101
- Y: "R",
6102
- K: "M",
6103
- V: "B",
6104
- H: "D",
6105
- D: "H",
6106
- B: "V",
6107
- X: "X",
6108
- N: "N"
6109
- };
6110
- const unambiguous_dna_weights = {
6111
- A: 331.2218,
6112
- C: 307.1971,
6113
- G: 347.2212,
6114
- T: 322.2085
6115
- };
6116
- const monoisotopic_unambiguous_dna_weights = {
6117
- A: 331.06817,
6118
- C: 307.056936,
6119
- G: 347.063084,
6120
- T: 322.056602
6121
- };
6122
- const unambiguous_rna_weights = {
6123
- A: 347.2212,
6124
- C: 323.1965,
6125
- G: 363.2206,
6126
- U: 324.1813
6127
- };
6128
- const monoisotopic_unambiguous_rna_weights = {
6129
- A: 347.063084,
6130
- C: 323.051851,
6131
- G: 363.057999,
6132
- U: 324.035867
6133
- };
6134
- const protein_weights = {
6135
- A: 89.0932,
6136
- C: 121.1582,
6137
- D: 133.1027,
6138
- E: 147.1293,
6139
- F: 165.1891,
6140
- G: 75.0666,
6141
- H: 155.1546,
6142
- I: 131.1729,
6143
- K: 146.1876,
6144
- L: 131.1729,
6145
- M: 149.2113,
6146
- N: 132.1179,
6147
- O: 255.3134,
6148
- P: 115.1305,
6149
- Q: 146.1445,
6150
- R: 174.201,
6151
- S: 105.0926,
6152
- T: 119.1192,
6153
- U: 168.0532,
6154
- V: 117.1463,
6155
- W: 204.2252,
6156
- Y: 181.1885
6157
- };
6158
- const monoisotopic_protein_weights = {
6159
- A: 89.047678,
6160
- C: 121.019749,
6161
- D: 133.037508,
6162
- E: 147.053158,
6163
- F: 165.078979,
6164
- G: 75.032028,
6165
- H: 155.069477,
6166
- I: 131.094629,
6167
- K: 146.105528,
6168
- L: 131.094629,
6169
- M: 149.051049,
6170
- N: 132.053492,
6171
- O: 255.158292,
6172
- P: 115.063329,
6173
- Q: 146.069142,
6174
- R: 174.111676,
6175
- S: 105.042593,
6176
- T: 119.058243,
6177
- U: 168.964203,
6178
- V: 117.078979,
6179
- W: 204.089878,
6180
- Y: 181.073893
6181
- };
6182
6029
  const extended_protein_values = {
6183
6030
  A: "A",
6184
6031
  B: "ND",
@@ -6213,140 +6060,17 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6213
6060
  ".": "\\.\\.",
6214
6061
  "-": "\\-"
6215
6062
  };
6216
- const atom_weights = {
6217
- H: 1.00794,
6218
- D: 2.0141,
6219
- He: 4.002602,
6220
- Li: 6.941,
6221
- Be: 9.012182,
6222
- B: 10.811,
6223
- C: 12.0107,
6224
- N: 14.0067,
6225
- O: 15.9994,
6226
- F: 18.9984032,
6227
- Ne: 20.1797,
6228
- Na: 22.98977,
6229
- Mg: 24.305,
6230
- Al: 26.981538,
6231
- Si: 28.0855,
6232
- P: 30.973761,
6233
- S: 32.065,
6234
- Cl: 35.453,
6235
- Ar: 39.948,
6236
- K: 39.0983,
6237
- Ca: 40.078,
6238
- Sc: 44.95591,
6239
- Ti: 47.867,
6240
- V: 50.9415,
6241
- Cr: 51.9961,
6242
- Mn: 54.938049,
6243
- Fe: 55.845,
6244
- Co: 58.9332,
6245
- Ni: 58.6934,
6246
- Cu: 63.546,
6247
- Zn: 65.39,
6248
- Ga: 69.723,
6249
- Ge: 72.64,
6250
- As: 74.9216,
6251
- Se: 78.96,
6252
- Br: 79.904,
6253
- Kr: 83.8,
6254
- Rb: 85.4678,
6255
- Sr: 87.62,
6256
- Y: 88.90585,
6257
- Zr: 91.224,
6258
- Nb: 92.90638,
6259
- Mo: 95.94,
6260
- Tc: 98,
6261
- Ru: 101.07,
6262
- Rh: 102.9055,
6263
- Pd: 106.42,
6264
- Ag: 107.8682,
6265
- Cd: 112.411,
6266
- In: 114.818,
6267
- Sn: 118.71,
6268
- Sb: 121.76,
6269
- Te: 127.6,
6270
- I: 126.90447,
6271
- Xe: 131.293,
6272
- Cs: 132.90545,
6273
- Ba: 137.327,
6274
- La: 138.9055,
6275
- Ce: 140.116,
6276
- Pr: 140.90765,
6277
- Nd: 144.24,
6278
- Pm: 145,
6279
- Sm: 150.36,
6280
- Eu: 151.964,
6281
- Gd: 157.25,
6282
- Tb: 158.92534,
6283
- Dy: 162.5,
6284
- Ho: 164.93032,
6285
- Er: 167.259,
6286
- Tm: 168.93421,
6287
- Yb: 173.04,
6288
- Lu: 174.967,
6289
- Hf: 178.49,
6290
- Ta: 180.9479,
6291
- W: 183.84,
6292
- Re: 186.207,
6293
- Os: 190.23,
6294
- Ir: 192.217,
6295
- Pt: 195.078,
6296
- Au: 196.96655,
6297
- Hg: 200.59,
6298
- Tl: 204.3833,
6299
- Pb: 207.2,
6300
- Bi: 208.98038,
6301
- Po: 208.98,
6302
- At: 209.99,
6303
- Rn: 222.02,
6304
- Fr: 223.02,
6305
- Ra: 226.03,
6306
- Ac: 227.03,
6307
- Th: 232.0381,
6308
- Pa: 231.03588,
6309
- U: 238.02891,
6310
- Np: 237.05,
6311
- Pu: 244.06,
6312
- Am: 243.06,
6313
- Cm: 247.07,
6314
- Bk: 247.07,
6315
- Cf: 251.08,
6316
- Es: 252.08,
6317
- Fm: 257.1,
6318
- Md: 258.1,
6319
- No: 259.1,
6320
- Lr: 262.11,
6321
- Rf: 261.11,
6322
- Db: 262.11,
6323
- Sg: 266.12,
6324
- Bh: 264.12,
6325
- Hs: 269.13,
6326
- Mt: 268.14
6327
- };
6328
6063
  const bioData = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6329
6064
  __proto__: null,
6330
- ambiguous_dna_complement,
6331
6065
  ambiguous_dna_letters,
6332
6066
  ambiguous_dna_values,
6333
- ambiguous_rna_complement,
6334
6067
  ambiguous_rna_letters,
6335
- ambiguous_rna_values,
6336
- atom_weights,
6337
6068
  extended_dna_letters,
6338
6069
  extended_protein_letters,
6339
6070
  extended_protein_values,
6340
- monoisotopic_protein_weights,
6341
- monoisotopic_unambiguous_dna_weights,
6342
- monoisotopic_unambiguous_rna_weights,
6343
6071
  protein_letters,
6344
- protein_letters_1to3,
6345
- protein_weights,
6346
6072
  unambiguous_dna_letters,
6347
- unambiguous_dna_weights,
6348
- unambiguous_rna_letters,
6349
- unambiguous_rna_weights
6073
+ unambiguous_rna_letters
6350
6074
  }, Symbol.toStringTag, { value: "Module" }));
6351
6075
  const aminoAcidToDegenerateDnaMap = {
6352
6076
  "-": "---",
@@ -6460,8 +6184,8 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6460
6184
  maxRangeLength
6461
6185
  );
6462
6186
  let overlaps = [];
6463
- normalizedRangeA.forEach(function(nonCircularRangeA, iA) {
6464
- normalizedRangeB.forEach(function(nonCircularRangeB, iB) {
6187
+ normalizedRangeA.forEach(function(nonCircularRangeA) {
6188
+ normalizedRangeB.forEach(function(nonCircularRangeB) {
6465
6189
  const overlap = getOverlapOfNonCircularRanges(
6466
6190
  nonCircularRangeA,
6467
6191
  nonCircularRangeB
@@ -6473,7 +6197,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6473
6197
  });
6474
6198
  if (joinIfPossible && normalizedRangeA.length === 2 && normalizedRangeB.length === 2 && maxRangeLength) {
6475
6199
  const joinedOverlap = {};
6476
- overlaps = lodashExports.flatMap(overlaps, (o, i) => {
6200
+ overlaps = lodashExports.flatMap(overlaps, (o) => {
6477
6201
  if (o.start === 0) {
6478
6202
  joinedOverlap.end = o.end;
6479
6203
  return [];
@@ -6571,12 +6295,14 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6571
6295
  });
6572
6296
  splitRangesToBeTrimmed[index] = nonCircularRangeToBeTrimmed;
6573
6297
  });
6574
- const outputSplitRanges = splitRangesToBeTrimmed.filter(function(trimmedRange) {
6575
- if (trimmedRange) {
6576
- return true;
6298
+ const outputSplitRanges = splitRangesToBeTrimmed.filter(
6299
+ function(trimmedRange) {
6300
+ if (trimmedRange) {
6301
+ return true;
6302
+ }
6303
+ return false;
6577
6304
  }
6578
- return false;
6579
- });
6305
+ );
6580
6306
  let outputTrimmedRange;
6581
6307
  if (outputSplitRanges.length < 0)
6582
6308
  ;
@@ -6675,11 +6401,19 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6675
6401
  }
6676
6402
  __name(checkIfNonCircularRangesOverlap, "checkIfNonCircularRangesOverlap");
6677
6403
  function checkIfPotentiallyCircularRangesOverlap(range, comparisonRange) {
6678
- return splitRangeIntoTwoPartsIfItIsCircular(range, Infinity).some(function(splitRange) {
6679
- return splitRangeIntoTwoPartsIfItIsCircular(comparisonRange, Infinity).some(function(splitComparisonRange) {
6680
- return checkIfNonCircularRangesOverlap(splitRange, splitComparisonRange);
6681
- });
6682
- });
6404
+ return splitRangeIntoTwoPartsIfItIsCircular(range, Infinity).some(
6405
+ function(splitRange) {
6406
+ return splitRangeIntoTwoPartsIfItIsCircular(
6407
+ comparisonRange,
6408
+ Infinity
6409
+ ).some(function(splitComparisonRange) {
6410
+ return checkIfNonCircularRangesOverlap(
6411
+ splitRange,
6412
+ splitComparisonRange
6413
+ );
6414
+ });
6415
+ }
6416
+ );
6683
6417
  }
6684
6418
  __name(checkIfPotentiallyCircularRangesOverlap, "checkIfPotentiallyCircularRangesOverlap");
6685
6419
  function collapseOverlapsGeneratedFromRangeComparisonIfPossible(overlaps, sequenceLength, optionalOriginalRange) {
@@ -6688,15 +6422,19 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6688
6422
  return overlaps;
6689
6423
  } else if (overlaps.length === 2) {
6690
6424
  if (overlaps[0].start === 0 && overlaps[1].end + 1 === sequenceLength && !originalRangeLinear) {
6691
- return [{
6692
- start: overlaps[1].start,
6693
- end: overlaps[0].end
6694
- }];
6425
+ return [
6426
+ {
6427
+ start: overlaps[1].start,
6428
+ end: overlaps[0].end
6429
+ }
6430
+ ];
6695
6431
  } else if (overlaps[1].start === 0 && overlaps[0].end + 1 === sequenceLength && !originalRangeLinear) {
6696
- return [{
6697
- start: overlaps[0].start,
6698
- end: overlaps[1].end
6699
- }];
6432
+ return [
6433
+ {
6434
+ start: overlaps[0].start,
6435
+ end: overlaps[1].end
6436
+ }
6437
+ ];
6700
6438
  } else {
6701
6439
  return overlaps;
6702
6440
  }
@@ -6704,17 +6442,29 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6704
6442
  const firstOverlap = overlaps[0];
6705
6443
  const secondOverlap = overlaps[1];
6706
6444
  const thirdOverlap = overlaps[2];
6707
- let collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible([firstOverlap, secondOverlap], sequenceLength, optionalOriginalRange);
6445
+ let collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
6446
+ [firstOverlap, secondOverlap],
6447
+ sequenceLength,
6448
+ optionalOriginalRange
6449
+ );
6708
6450
  if (collapsedOverlaps.length === 1) {
6709
6451
  collapsedOverlaps.push(thirdOverlap);
6710
6452
  return collapsedOverlaps;
6711
6453
  } else {
6712
- collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible([firstOverlap, thirdOverlap], sequenceLength, optionalOriginalRange);
6454
+ collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
6455
+ [firstOverlap, thirdOverlap],
6456
+ sequenceLength,
6457
+ optionalOriginalRange
6458
+ );
6713
6459
  if (collapsedOverlaps.length === 1) {
6714
6460
  collapsedOverlaps.push(secondOverlap);
6715
6461
  return collapsedOverlaps;
6716
6462
  } else {
6717
- collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible([secondOverlap, thirdOverlap], sequenceLength, optionalOriginalRange);
6463
+ collapsedOverlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
6464
+ [secondOverlap, thirdOverlap],
6465
+ sequenceLength,
6466
+ optionalOriginalRange
6467
+ );
6718
6468
  if (collapsedOverlaps.length === 1) {
6719
6469
  collapsedOverlaps.push(firstOverlap);
6720
6470
  return collapsedOverlaps;
@@ -6821,13 +6571,23 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6821
6571
  __name(expandOrContractRangeByLength, "expandOrContractRangeByLength");
6822
6572
  function translateRange(rangeToBeAdjusted, translateBy, rangeLength) {
6823
6573
  return lodashExports.assign({}, rangeToBeAdjusted, {
6824
- start: normalizePositionByRangeLength(rangeToBeAdjusted.start + translateBy, rangeLength),
6825
- end: normalizePositionByRangeLength(rangeToBeAdjusted.end + translateBy, rangeLength)
6574
+ start: normalizePositionByRangeLength(
6575
+ rangeToBeAdjusted.start + translateBy,
6576
+ rangeLength
6577
+ ),
6578
+ end: normalizePositionByRangeLength(
6579
+ rangeToBeAdjusted.end + translateBy,
6580
+ rangeLength
6581
+ )
6826
6582
  });
6827
6583
  }
6828
6584
  __name(translateRange, "translateRange");
6829
- function flipRelativeRange(innerRange, outerRange, sequenceLength, options) {
6830
- const isFullyContained = isRangeWithinRange(innerRange, outerRange, sequenceLength);
6585
+ function flipRelativeRange(innerRange, outerRange, sequenceLength) {
6586
+ const isFullyContained = isRangeWithinRange(
6587
+ innerRange,
6588
+ outerRange,
6589
+ sequenceLength
6590
+ );
6831
6591
  if (isFullyContained) {
6832
6592
  return flipFullyContainedRange(innerRange, outerRange, sequenceLength);
6833
6593
  } else {
@@ -6835,42 +6595,92 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6835
6595
  }
6836
6596
  }
6837
6597
  __name(flipRelativeRange, "flipRelativeRange");
6838
- function flipNonFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
6839
- const outerFullyContained = isRangeWithinRange(outerRange, innerRange, sequenceLength);
6598
+ function flipNonFullyContainedRange(innerRange, outerRange, sequenceLength) {
6599
+ const outerFullyContained = isRangeWithinRange(
6600
+ outerRange,
6601
+ innerRange,
6602
+ sequenceLength
6603
+ );
6840
6604
  let flippedInnerRange;
6841
6605
  if (outerFullyContained) {
6842
- const expandBy1 = getRangeLength({
6843
- start: innerRange.start,
6844
- end: outerRange.start
6845
- }, sequenceLength) - 1;
6846
- flippedInnerRange = expandOrContractRangeByLength(outerRange, expandBy1, false, sequenceLength);
6847
- const expandBy2 = getRangeLength({
6848
- end: innerRange.end,
6849
- start: outerRange.end
6850
- }, sequenceLength) - 1;
6851
- flippedInnerRange = expandOrContractRangeByLength(flippedInnerRange, expandBy2, true, sequenceLength);
6606
+ const expandBy1 = getRangeLength(
6607
+ {
6608
+ start: innerRange.start,
6609
+ end: outerRange.start
6610
+ },
6611
+ sequenceLength
6612
+ ) - 1;
6613
+ flippedInnerRange = expandOrContractRangeByLength(
6614
+ outerRange,
6615
+ expandBy1,
6616
+ false,
6617
+ sequenceLength
6618
+ );
6619
+ const expandBy2 = getRangeLength(
6620
+ {
6621
+ end: innerRange.end,
6622
+ start: outerRange.end
6623
+ },
6624
+ sequenceLength
6625
+ ) - 1;
6626
+ flippedInnerRange = expandOrContractRangeByLength(
6627
+ flippedInnerRange,
6628
+ expandBy2,
6629
+ true,
6630
+ sequenceLength
6631
+ );
6852
6632
  } else {
6853
- const overlaps = getOverlapsOfPotentiallyCircularRanges(innerRange, outerRange, sequenceLength);
6633
+ const overlaps = getOverlapsOfPotentiallyCircularRanges(
6634
+ innerRange,
6635
+ outerRange,
6636
+ sequenceLength
6637
+ );
6854
6638
  if (overlaps.length >= 1) {
6855
- let overlapExtendsForward;
6856
6639
  const firstOverlap = overlaps[0];
6857
- overlapExtendsForward = firstOverlap.start !== outerRange.start;
6858
- const flippedTruncatedInner = flipFullyContainedRange(firstOverlap, outerRange, sequenceLength);
6640
+ const overlapExtendsForward = firstOverlap.start !== outerRange.start;
6641
+ const flippedTruncatedInner = flipFullyContainedRange(
6642
+ firstOverlap,
6643
+ outerRange,
6644
+ sequenceLength
6645
+ );
6859
6646
  const lengthToExtend = getRangeLength(innerRange, sequenceLength) - getRangeLength(flippedTruncatedInner, sequenceLength);
6860
- flippedInnerRange = expandOrContractRangeByLength(flippedTruncatedInner, lengthToExtend, overlapExtendsForward, sequenceLength);
6647
+ flippedInnerRange = expandOrContractRangeByLength(
6648
+ flippedTruncatedInner,
6649
+ lengthToExtend,
6650
+ overlapExtendsForward,
6651
+ sequenceLength
6652
+ );
6861
6653
  } else {
6862
- throw new Error("This case (relative ranges that do not overlap) is unsupported! ");
6654
+ throw new Error(
6655
+ "This case (relative ranges that do not overlap) is unsupported! "
6656
+ );
6863
6657
  }
6864
6658
  }
6865
6659
  return flippedInnerRange;
6866
6660
  }
6867
6661
  __name(flipNonFullyContainedRange, "flipNonFullyContainedRange");
6868
- function flipFullyContainedRange(innerRange, outerRange, sequenceLength, options) {
6662
+ function flipFullyContainedRange(innerRange, outerRange, sequenceLength) {
6869
6663
  const translateBy = -outerRange.start;
6870
- const translatedOuterRange = translateRange(outerRange, translateBy, sequenceLength);
6871
- const translatedInnerRange = translateRange(innerRange, translateBy, sequenceLength);
6872
- const translatedFlippedInnerRange = flipNonOriginSpanningContainedRange(translatedInnerRange, translatedOuterRange, sequenceLength);
6873
- const flippedInnerRange = translateRange(translatedFlippedInnerRange, -translateBy, sequenceLength);
6664
+ const translatedOuterRange = translateRange(
6665
+ outerRange,
6666
+ translateBy,
6667
+ sequenceLength
6668
+ );
6669
+ const translatedInnerRange = translateRange(
6670
+ innerRange,
6671
+ translateBy,
6672
+ sequenceLength
6673
+ );
6674
+ const translatedFlippedInnerRange = flipNonOriginSpanningContainedRange(
6675
+ translatedInnerRange,
6676
+ translatedOuterRange,
6677
+ sequenceLength
6678
+ );
6679
+ const flippedInnerRange = translateRange(
6680
+ translatedFlippedInnerRange,
6681
+ -translateBy,
6682
+ sequenceLength
6683
+ );
6874
6684
  return flippedInnerRange;
6875
6685
  }
6876
6686
  __name(flipFullyContainedRange, "flipFullyContainedRange");
@@ -6888,7 +6698,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6888
6698
  const start = getRandomInt$1(minStart, maxEnd);
6889
6699
  let end;
6890
6700
  if (maxLength) {
6891
- end = normalizePositionByRangeLength(getRandomInt$1(start, start + maxLength), maxEnd);
6701
+ end = normalizePositionByRangeLength(
6702
+ getRandomInt$1(start, start + maxLength),
6703
+ maxEnd
6704
+ );
6892
6705
  } else {
6893
6706
  end = getRandomInt$1(minStart, maxEnd);
6894
6707
  }
@@ -6931,18 +6744,26 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6931
6744
  __name(getShortestDistanceBetweenTwoPositions, "getShortestDistanceBetweenTwoPositions");
6932
6745
  function getYOffsetForPotentiallyCircularRange(range, YOffsetLevelsWithRanges, assignYOffsetToRange) {
6933
6746
  let yOffset = [];
6934
- const openYOffsetFound = YOffsetLevelsWithRanges.some(function(rangesAlreadyAddedToYOffset, index) {
6935
- const rangeBlocked = rangesAlreadyAddedToYOffset.some(function(comparisonRange) {
6936
- return checkIfPotentiallyCircularRangesOverlap(range, comparisonRange);
6937
- });
6938
- if (!rangeBlocked) {
6939
- yOffset = index;
6940
- if (assignYOffsetToRange)
6941
- range.yOffset = index;
6942
- rangesAlreadyAddedToYOffset.push(range);
6943
- return true;
6747
+ const openYOffsetFound = YOffsetLevelsWithRanges.some(
6748
+ function(rangesAlreadyAddedToYOffset, index) {
6749
+ const rangeBlocked = rangesAlreadyAddedToYOffset.some(
6750
+ function(comparisonRange) {
6751
+ return checkIfPotentiallyCircularRangesOverlap(
6752
+ range,
6753
+ comparisonRange
6754
+ );
6755
+ }
6756
+ );
6757
+ if (!rangeBlocked) {
6758
+ yOffset = index;
6759
+ if (assignYOffsetToRange)
6760
+ range.yOffset = index;
6761
+ rangesAlreadyAddedToYOffset.push(range);
6762
+ return true;
6763
+ }
6764
+ return false;
6944
6765
  }
6945
- });
6766
+ );
6946
6767
  if (!openYOffsetFound) {
6947
6768
  yOffset = YOffsetLevelsWithRanges.length;
6948
6769
  if (assignYOffsetToRange)
@@ -6956,7 +6777,11 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6956
6777
  let maxYOffset = 0;
6957
6778
  const yOffsetLevels = [];
6958
6779
  ranges.forEach(function(range) {
6959
- const yOffset = getYOffsetForPotentiallyCircularRange(range, yOffsetLevels, assignYOffsetToRange);
6780
+ const yOffset = getYOffsetForPotentiallyCircularRange(
6781
+ range,
6782
+ yOffsetLevels,
6783
+ assignYOffsetToRange
6784
+ );
6960
6785
  yOffsets.push(yOffset);
6961
6786
  if (yOffset > maxYOffset) {
6962
6787
  maxYOffset = yOffset;
@@ -6989,8 +6814,16 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
6989
6814
  }
6990
6815
  __name(invertRange$1, "invertRange$1");
6991
6816
  function isPositionCloserToRangeStartThanRangeEnd(position, range, maxLength) {
6992
- const distanceFromStart = getShortestDistanceBetweenTwoPositions(range.start, position, maxLength);
6993
- const distanceFromEnd = getShortestDistanceBetweenTwoPositions(range.end, position, maxLength);
6817
+ const distanceFromStart = getShortestDistanceBetweenTwoPositions(
6818
+ range.start,
6819
+ position,
6820
+ maxLength
6821
+ );
6822
+ const distanceFromEnd = getShortestDistanceBetweenTwoPositions(
6823
+ range.end,
6824
+ position,
6825
+ maxLength
6826
+ );
6994
6827
  return distanceFromStart <= distanceFromEnd;
6995
6828
  }
6996
6829
  __name(isPositionCloserToRangeStartThanRangeEnd, "isPositionCloserToRangeStartThanRangeEnd");
@@ -7021,9 +6854,15 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
7021
6854
  }
7022
6855
  __name(reversePositionInRange, "reversePositionInRange");
7023
6856
  function zeroSubrangeByContainerRange(subRange, containerRange, sequenceLength) {
7024
- const trimmedSubRange = trimRangeByAnotherRange(subRange, containerRange, sequenceLength);
6857
+ const trimmedSubRange = trimRangeByAnotherRange(
6858
+ subRange,
6859
+ containerRange,
6860
+ sequenceLength
6861
+ );
7025
6862
  if (trimmedSubRange) {
7026
- throw new Error("subRange must be fully contained by containerRange! Otherwise this function does not make sense");
6863
+ throw new Error(
6864
+ "subRange must be fully contained by containerRange! Otherwise this function does not make sense"
6865
+ );
7027
6866
  }
7028
6867
  const newSubrange = {};
7029
6868
  newSubrange.start = subRange.start - containerRange.start;
@@ -7051,12 +6890,24 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
7051
6890
  }
7052
6891
  __name(modulo, "modulo");
7053
6892
  function getZeroedRangeOverlaps(annotation, selection, sequenceLength) {
7054
- const overlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(getOverlapsOfPotentiallyCircularRanges(annotation, selection, sequenceLength), sequenceLength, annotation);
6893
+ const overlaps = collapseOverlapsGeneratedFromRangeComparisonIfPossible(
6894
+ getOverlapsOfPotentiallyCircularRanges(
6895
+ annotation,
6896
+ selection,
6897
+ sequenceLength
6898
+ ),
6899
+ sequenceLength,
6900
+ annotation
6901
+ );
7055
6902
  const zeroedOverlaps = overlaps.map((overlap) => {
7056
- return zeroSubrangeByContainerRange(overlap, {
7057
- start: selection.start,
7058
- end: normalizePositionByRangeLength(selection.start - 1, sequenceLength)
7059
- }, sequenceLength);
6903
+ return zeroSubrangeByContainerRange(
6904
+ overlap,
6905
+ {
6906
+ start: selection.start,
6907
+ end: normalizePositionByRangeLength(selection.start - 1, sequenceLength)
6908
+ },
6909
+ sequenceLength
6910
+ );
7060
6911
  });
7061
6912
  return zeroedOverlaps;
7062
6913
  }
@@ -11964,7 +11815,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
11964
11815
  hydrophobicity: 1.8,
11965
11816
  colorByFamily: "#00FFFF",
11966
11817
  color: "hsl(327.3, 100%, 69%)",
11967
- mass: 89.1
11818
+ mass: 71.0779
11968
11819
  },
11969
11820
  R: {
11970
11821
  value: "R",
@@ -11973,7 +11824,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
11973
11824
  hydrophobicity: -4.5,
11974
11825
  colorByFamily: "#FFC0CB",
11975
11826
  color: "hsl(258.1, 100%, 69%)",
11976
- mass: 174.2
11827
+ mass: 156.18568
11977
11828
  },
11978
11829
  N: {
11979
11830
  value: "N",
@@ -11982,7 +11833,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
11982
11833
  hydrophobicity: -3.5,
11983
11834
  colorByFamily: "#D3D3D3",
11984
11835
  color: "hsl(268.9, 100%, 69%)",
11985
- mass: 132.1
11836
+ mass: 114.10264
11986
11837
  },
11987
11838
  D: {
11988
11839
  value: "D",
@@ -11991,7 +11842,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
11991
11842
  hydrophobicity: -3.5,
11992
11843
  colorByFamily: "#EE82EE",
11993
11844
  color: "hsl(268.9, 100%, 69%)",
11994
- mass: 133.1
11845
+ mass: 115.0874
11995
11846
  },
11996
11847
  C: {
11997
11848
  value: "C",
@@ -12000,7 +11851,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12000
11851
  hydrophobicity: 2.5,
12001
11852
  colorByFamily: "#FFFF00",
12002
11853
  color: "hsl(335.1, 100%, 69%)",
12003
- mass: 121.2
11854
+ mass: 103.1429
12004
11855
  },
12005
11856
  E: {
12006
11857
  value: "E",
@@ -12009,7 +11860,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12009
11860
  hydrophobicity: -3.5,
12010
11861
  colorByFamily: "#EE82EE",
12011
11862
  color: "hsl(268.9, 100%, 69%)",
12012
- mass: 147.1
11863
+ mass: 129.11398
12013
11864
  },
12014
11865
  Q: {
12015
11866
  value: "Q",
@@ -12018,7 +11869,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12018
11869
  hydrophobicity: -3.5,
12019
11870
  colorByFamily: "#D3D3D3",
12020
11871
  color: "hsl(268.9, 100%, 69%)",
12021
- mass: 146.2
11872
+ mass: 128.12922
12022
11873
  },
12023
11874
  G: {
12024
11875
  value: "G",
@@ -12027,7 +11878,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12027
11878
  hydrophobicity: -0.4,
12028
11879
  colorByFamily: "#00FFFF",
12029
11880
  color: "hsl(303.1, 100%, 69%)",
12030
- mass: 75.1
11881
+ mass: 57.05132
12031
11882
  },
12032
11883
  H: {
12033
11884
  value: "H",
@@ -12036,7 +11887,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12036
11887
  hydrophobicity: -3.2,
12037
11888
  colorByFamily: "#FFC0CB",
12038
11889
  color: "hsl(272.2, 100%, 69%)",
12039
- mass: 155.2
11890
+ mass: 137.13928
12040
11891
  },
12041
11892
  I: {
12042
11893
  value: "I",
@@ -12045,7 +11896,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12045
11896
  hydrophobicity: 4.5,
12046
11897
  colorByFamily: "#00FFFF",
12047
11898
  color: "hsl(356.9, 100%, 69%)",
12048
- mass: 131.2
11899
+ mass: 113.15764
12049
11900
  },
12050
11901
  L: {
12051
11902
  value: "L",
@@ -12054,7 +11905,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12054
11905
  hydrophobicity: 3.8,
12055
11906
  colorByFamily: "#00FFFF",
12056
11907
  color: "hsl(349.4, 100%, 69%)",
12057
- mass: 131.2
11908
+ mass: 113.15764
12058
11909
  },
12059
11910
  K: {
12060
11911
  value: "K",
@@ -12063,7 +11914,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12063
11914
  hydrophobicity: -3.9,
12064
11915
  colorByFamily: "#FFC0CB",
12065
11916
  color: "hsl(264.7, 100%, 69%)",
12066
- mass: 146.2
11917
+ mass: 128.17228
12067
11918
  },
12068
11919
  M: {
12069
11920
  value: "M",
@@ -12072,7 +11923,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12072
11923
  hydrophobicity: 1.9,
12073
11924
  colorByFamily: "#FFFF00",
12074
11925
  color: "hsl(328.5, 100%, 69%)",
12075
- mass: 149.2
11926
+ mass: 131.19606
12076
11927
  },
12077
11928
  F: {
12078
11929
  value: "F",
@@ -12081,7 +11932,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12081
11932
  hydrophobicity: 2.8,
12082
11933
  colorByFamily: "#FFA500",
12083
11934
  color: "hsl(338.4, 100%, 69%)",
12084
- mass: 165.2
11935
+ mass: 147.17386
12085
11936
  },
12086
11937
  P: {
12087
11938
  value: "P",
@@ -12090,7 +11941,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12090
11941
  hydrophobicity: -1.6,
12091
11942
  colorByFamily: "#00FFFF",
12092
11943
  color: "hsl(289.9, 100%, 69%)",
12093
- mass: 115.1
11944
+ mass: 97.11518
12094
11945
  },
12095
11946
  S: {
12096
11947
  value: "S",
@@ -12099,7 +11950,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12099
11950
  hydrophobicity: -0.8,
12100
11951
  colorByFamily: "#90EE90",
12101
11952
  color: "hsl(298.6, 100%, 69%)",
12102
- mass: 105.1
11953
+ mass: 87.0773
12103
11954
  },
12104
11955
  T: {
12105
11956
  value: "T",
@@ -12108,7 +11959,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12108
11959
  hydrophobicity: -0.7,
12109
11960
  colorByFamily: "#90EE90",
12110
11961
  color: "hsl(299.8, 100%, 69%)",
12111
- mass: 119.1
11962
+ mass: 101.10388
12112
11963
  },
12113
11964
  U: {
12114
11965
  value: "U",
@@ -12116,7 +11967,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12116
11967
  threeLettersName: "Sec",
12117
11968
  colorByFamily: "#FF0000",
12118
11969
  color: "hsl(0, 100%, 69%)",
12119
- mass: 168.1
11970
+ mass: 150.3079
12120
11971
  },
12121
11972
  W: {
12122
11973
  value: "W",
@@ -12125,7 +11976,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12125
11976
  hydrophobicity: -0.9,
12126
11977
  colorByFamily: "#FFA500",
12127
11978
  color: "hsl(297.6, 100%, 69%)",
12128
- mass: 204.2
11979
+ mass: 186.2099
12129
11980
  },
12130
11981
  Y: {
12131
11982
  value: "Y",
@@ -12134,7 +11985,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12134
11985
  hydrophobicity: -1.3,
12135
11986
  colorByFamily: "#FFA500",
12136
11987
  color: "hsl(293.2, 100%, 69%)",
12137
- mass: 181.2
11988
+ mass: 163.17326
12138
11989
  },
12139
11990
  V: {
12140
11991
  value: "V",
@@ -12143,7 +11994,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12143
11994
  hydrophobicity: 4.2,
12144
11995
  colorByFamily: "#00FFFF",
12145
11996
  color: "hsl(353.6, 100%, 69%)",
12146
- mass: 117.1
11997
+ mass: 99.13106
12147
11998
  },
12148
11999
  "*": {
12149
12000
  value: "*",
@@ -12598,13 +12449,13 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12598
12449
  messages.push(
12599
12450
  "Invalid annotation start: " + location.start + " detected for " + location.name + " and set to size: " + size
12600
12451
  );
12601
- location.start = size - (isProtein ? 3 : 1);
12452
+ location.start = Math.max(0, size - (isProtein ? 3 : 1));
12602
12453
  }
12603
12454
  if (location.end < 0 || !(location.end <= size - 1) || location.end > size - 1) {
12604
12455
  messages.push(
12605
12456
  "Invalid annotation end: " + location.end + " detected for " + location.name + " and set to seq size: " + size
12606
12457
  );
12607
- location.end = size - 1;
12458
+ location.end = Math.max(0, size - 1);
12608
12459
  }
12609
12460
  if (location.start > location.end && circular === false) {
12610
12461
  messages.push(
@@ -12617,9 +12468,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
12617
12468
  function filterAminoAcidSequenceString(sequenceString, options) {
12618
12469
  options = options || {};
12619
12470
  if (options.includeStopCodon) {
12620
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
12471
+ return sequenceString == null ? void 0 : sequenceString.replace(/[^xtgalmfwkqespvicyhrndu.*]/gi, "");
12621
12472
  }
12622
- return sequenceString.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
12473
+ return sequenceString == null ? void 0 : sequenceString.replace(/[^xtgalmfwkqespvicyhrndu]/gi, "");
12623
12474
  }
12624
12475
  __name(filterAminoAcidSequenceString, "filterAminoAcidSequenceString");
12625
12476
  function getDegenerateDnaStringFromAAString(aaString) {
@@ -13110,7 +12961,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
13110
12961
  calculateTemperature: function(sequence, type, A, R, C, Na) {
13111
12962
  if (typeof type === "undefined") {
13112
12963
  type = this.TABLE_BRESLAUER;
13113
- } else if (type != this.TABLE_BRESLAUER && (type != this.TABLE_UNIFIED && type != this.TABLE_SUGIMOTO)) {
12964
+ } else if (type != this.TABLE_BRESLAUER && type != this.TABLE_UNIFIED && type != this.TABLE_SUGIMOTO) {
13114
12965
  throw new Error("Invalid table type!");
13115
12966
  }
13116
12967
  if (!A) {
@@ -21472,12 +21323,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
21472
21323
  }
21473
21324
  __name(findSequenceMatches, "findSequenceMatches");
21474
21325
  function findSequenceMatchesTopStrand(sequence, searchString, options = {}) {
21475
- const {
21476
- isCircular,
21477
- isAmbiguous,
21478
- isProteinSequence,
21479
- isProteinSearch
21480
- } = options;
21326
+ const { isCircular, isAmbiguous, isProteinSequence, isProteinSearch } = options;
21481
21327
  let searchStringToUse = escapeStringRegexp(searchString);
21482
21328
  if (isAmbiguous) {
21483
21329
  if (isProteinSearch || isProteinSequence) {
@@ -21610,7 +21456,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
21610
21456
  __name(getComplementAminoAcidStringFromSequenceString, "getComplementAminoAcidStringFromSequenceString");
21611
21457
  function getComplementSequenceString(sequence, isRna) {
21612
21458
  let complementSeqString = "";
21613
- const complementMap = lodashExports.merge(DNAComplementMap, isRna ? { a: "u", A: "U" } : { a: "t", A: "T" });
21459
+ const complementMap = lodashExports.merge(
21460
+ DNAComplementMap,
21461
+ isRna ? { a: "u", A: "U" } : { a: "t", A: "T" }
21462
+ );
21614
21463
  for (let i = 0; i < sequence.length; i++) {
21615
21464
  let complementChar = complementMap[sequence[i]];
21616
21465
  if (!complementChar) {
@@ -21914,7 +21763,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
21914
21763
  }
21915
21764
  __name(getReverseAminoAcidStringFromSequenceString, "getReverseAminoAcidStringFromSequenceString");
21916
21765
  function getReverseComplementAminoAcidStringFromSequenceString(sequenceString) {
21917
- return getAminoAcidStringFromSequenceString(getReverseComplementSequenceString(sequenceString));
21766
+ return getAminoAcidStringFromSequenceString(
21767
+ getReverseComplementSequenceString(sequenceString)
21768
+ );
21918
21769
  }
21919
21770
  __name(getReverseComplementAminoAcidStringFromSequenceString, "getReverseComplementAminoAcidStringFromSequenceString");
21920
21771
  function getReverseComplementAnnotation(annotation, sequenceLength) {
@@ -22764,6 +22615,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
22764
22615
  if (divideByThree) {
22765
22616
  sumMass /= 3;
22766
22617
  }
22618
+ if (aaString.length > 0) {
22619
+ sumMass = sumMass + 18.0153;
22620
+ }
22767
22621
  return Math.round(sumMass * __pow(10, numsAfterDecimal)) / __pow(10, numsAfterDecimal);
22768
22622
  }
22769
22623
  __name(getMassOfAaString, "getMassOfAaString");