@jbrowse/plugin-sequence 1.7.11 → 2.0.0

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 (126) hide show
  1. package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js +50 -68
  2. package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js.map +1 -0
  3. package/dist/BgzipFastaAdapter/configSchema.js +31 -43
  4. package/dist/BgzipFastaAdapter/configSchema.js.map +1 -0
  5. package/dist/BgzipFastaAdapter/index.js +8 -14
  6. package/dist/BgzipFastaAdapter/index.js.map +1 -0
  7. package/dist/ChromSizesAdapter/ChromSizesAdapter.js +132 -166
  8. package/dist/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -0
  9. package/dist/ChromSizesAdapter/configSchema.js +12 -21
  10. package/dist/ChromSizesAdapter/configSchema.js.map +1 -0
  11. package/dist/ChromSizesAdapter/index.js +8 -14
  12. package/dist/ChromSizesAdapter/index.js.map +1 -0
  13. package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +130 -229
  14. package/dist/DivSequenceRenderer/components/DivSequenceRendering.js.map +1 -0
  15. package/dist/DivSequenceRenderer/configSchema.js +10 -19
  16. package/dist/DivSequenceRenderer/configSchema.js.map +1 -0
  17. package/dist/DivSequenceRenderer/index.js +10 -22
  18. package/dist/DivSequenceRenderer/index.js.map +1 -0
  19. package/dist/GCContentAdapter/GCContentAdapter.js +181 -248
  20. package/dist/GCContentAdapter/GCContentAdapter.js.map +1 -0
  21. package/dist/GCContentAdapter/configSchema.js +7 -16
  22. package/dist/GCContentAdapter/configSchema.js.map +1 -0
  23. package/dist/GCContentAdapter/index.js +33 -28
  24. package/dist/GCContentAdapter/index.js.map +1 -0
  25. package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +177 -266
  26. package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js.map +1 -0
  27. package/dist/IndexedFastaAdapter/configSchema.js +21 -36
  28. package/dist/IndexedFastaAdapter/configSchema.js.map +1 -0
  29. package/dist/IndexedFastaAdapter/index.js +8 -14
  30. package/dist/IndexedFastaAdapter/index.js.map +1 -0
  31. package/dist/LinearReferenceSequenceDisplay/configSchema.js +5 -16
  32. package/dist/LinearReferenceSequenceDisplay/configSchema.js.map +1 -0
  33. package/dist/LinearReferenceSequenceDisplay/index.js +7 -20
  34. package/dist/LinearReferenceSequenceDisplay/index.js.map +1 -0
  35. package/dist/LinearReferenceSequenceDisplay/model.d.ts +17 -15
  36. package/dist/LinearReferenceSequenceDisplay/model.js +88 -99
  37. package/dist/LinearReferenceSequenceDisplay/model.js.map +1 -0
  38. package/dist/TwoBitAdapter/TwoBitAdapter.js +178 -274
  39. package/dist/TwoBitAdapter/TwoBitAdapter.js.map +1 -0
  40. package/dist/TwoBitAdapter/configSchema.js +16 -28
  41. package/dist/TwoBitAdapter/configSchema.js.map +1 -0
  42. package/dist/TwoBitAdapter/index.js +8 -14
  43. package/dist/TwoBitAdapter/index.js.map +1 -0
  44. package/dist/index.js +255 -312
  45. package/dist/index.js.map +1 -0
  46. package/dist/referenceSeqTrackConfig.js +71 -86
  47. package/dist/referenceSeqTrackConfig.js.map +1 -0
  48. package/esm/BgzipFastaAdapter/BgzipFastaAdapter.d.ts +7 -0
  49. package/esm/BgzipFastaAdapter/BgzipFastaAdapter.js +28 -0
  50. package/esm/BgzipFastaAdapter/BgzipFastaAdapter.js.map +1 -0
  51. package/esm/BgzipFastaAdapter/configSchema.d.ts +2 -0
  52. package/esm/BgzipFastaAdapter/configSchema.js +30 -0
  53. package/esm/BgzipFastaAdapter/configSchema.js.map +1 -0
  54. package/esm/BgzipFastaAdapter/index.d.ts +1 -0
  55. package/esm/BgzipFastaAdapter/index.js +2 -0
  56. package/esm/BgzipFastaAdapter/index.js.map +1 -0
  57. package/esm/ChromSizesAdapter/ChromSizesAdapter.d.ts +19 -0
  58. package/esm/ChromSizesAdapter/ChromSizesAdapter.js +45 -0
  59. package/esm/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -0
  60. package/esm/ChromSizesAdapter/configSchema.d.ts +2 -0
  61. package/esm/ChromSizesAdapter/configSchema.js +11 -0
  62. package/esm/ChromSizesAdapter/configSchema.js.map +1 -0
  63. package/esm/ChromSizesAdapter/index.d.ts +1 -0
  64. package/esm/ChromSizesAdapter/index.js +2 -0
  65. package/esm/ChromSizesAdapter/index.js.map +1 -0
  66. package/esm/DivSequenceRenderer/components/DivSequenceRendering.d.ts +21 -0
  67. package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +97 -0
  68. package/esm/DivSequenceRenderer/components/DivSequenceRendering.js.map +1 -0
  69. package/esm/DivSequenceRenderer/configSchema.d.ts +2 -0
  70. package/esm/DivSequenceRenderer/configSchema.js +9 -0
  71. package/esm/DivSequenceRenderer/configSchema.js.map +1 -0
  72. package/esm/DivSequenceRenderer/index.d.ts +2 -0
  73. package/esm/DivSequenceRenderer/index.js +3 -0
  74. package/esm/DivSequenceRenderer/index.js.map +1 -0
  75. package/esm/GCContentAdapter/GCContentAdapter.d.ts +23 -0
  76. package/esm/GCContentAdapter/GCContentAdapter.js +97 -0
  77. package/esm/GCContentAdapter/GCContentAdapter.js.map +1 -0
  78. package/esm/GCContentAdapter/configSchema.d.ts +3 -0
  79. package/esm/GCContentAdapter/configSchema.js +7 -0
  80. package/esm/GCContentAdapter/configSchema.js.map +1 -0
  81. package/esm/GCContentAdapter/index.d.ts +6 -0
  82. package/esm/GCContentAdapter/index.js +8 -0
  83. package/esm/GCContentAdapter/index.js.map +1 -0
  84. package/esm/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +27 -0
  85. package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +90 -0
  86. package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js.map +1 -0
  87. package/esm/IndexedFastaAdapter/configSchema.d.ts +2 -0
  88. package/esm/IndexedFastaAdapter/configSchema.js +20 -0
  89. package/esm/IndexedFastaAdapter/configSchema.js.map +1 -0
  90. package/esm/IndexedFastaAdapter/index.d.ts +1 -0
  91. package/esm/IndexedFastaAdapter/index.js +2 -0
  92. package/esm/IndexedFastaAdapter/index.js.map +1 -0
  93. package/esm/LinearReferenceSequenceDisplay/configSchema.d.ts +1 -0
  94. package/esm/LinearReferenceSequenceDisplay/configSchema.js +4 -0
  95. package/esm/LinearReferenceSequenceDisplay/configSchema.js.map +1 -0
  96. package/esm/LinearReferenceSequenceDisplay/index.d.ts +2 -0
  97. package/esm/LinearReferenceSequenceDisplay/index.js +3 -0
  98. package/esm/LinearReferenceSequenceDisplay/index.js.map +1 -0
  99. package/esm/LinearReferenceSequenceDisplay/model.d.ts +210 -0
  100. package/esm/LinearReferenceSequenceDisplay/model.js +83 -0
  101. package/esm/LinearReferenceSequenceDisplay/model.js.map +1 -0
  102. package/esm/TwoBitAdapter/TwoBitAdapter.d.ts +26 -0
  103. package/esm/TwoBitAdapter/TwoBitAdapter.js +79 -0
  104. package/esm/TwoBitAdapter/TwoBitAdapter.js.map +1 -0
  105. package/esm/TwoBitAdapter/configSchema.d.ts +2 -0
  106. package/esm/TwoBitAdapter/configSchema.js +16 -0
  107. package/esm/TwoBitAdapter/configSchema.js.map +1 -0
  108. package/esm/TwoBitAdapter/index.d.ts +1 -0
  109. package/esm/TwoBitAdapter/index.js +2 -0
  110. package/esm/TwoBitAdapter/index.js.map +1 -0
  111. package/esm/index.d.ts +6 -0
  112. package/esm/index.js +197 -0
  113. package/esm/index.js.map +1 -0
  114. package/esm/referenceSeqTrackConfig.d.ts +2 -0
  115. package/esm/referenceSeqTrackConfig.js +63 -0
  116. package/esm/referenceSeqTrackConfig.js.map +1 -0
  117. package/package.json +16 -8
  118. package/src/DivSequenceRenderer/components/DivSequenceRendering.test.js +1 -1
  119. package/src/LinearReferenceSequenceDisplay/model.ts +4 -2
  120. package/dist/BgzipFastaAdapter/BgzipFastaAdapter.test.js +0 -64
  121. package/dist/ChromSizesAdapter/ChromSizesAdapter.test.js +0 -46
  122. package/dist/DivSequenceRenderer/components/DivSequenceRendering.test.js +0 -245
  123. package/dist/IndexedFastaAdapter/IndexedFastaAdapter.test.js +0 -81
  124. package/dist/TwoBitAdapter/TwoBitAdapter.test.js +0 -94
  125. package/dist/declare.d.js +0 -1
  126. package/dist/index.test.js +0 -29
@@ -1,70 +1,52 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
-
16
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
-
18
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
-
20
- var _indexedfasta = require("@gmod/indexedfasta");
21
-
22
- var _io = require("@jbrowse/core/util/io");
23
-
24
- var _configuration = require("@jbrowse/core/configuration");
25
-
26
- var _IndexedFastaAdapter = _interopRequireDefault(require("../IndexedFastaAdapter/IndexedFastaAdapter"));
27
-
28
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
-
30
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
-
32
- var _default = /*#__PURE__*/function (_IndexedFasta) {
33
- (0, _inherits2.default)(_default, _IndexedFasta);
34
-
35
- var _super = _createSuper(_default);
36
-
37
- function _default(config, getSubAdapter, pluginManager) {
38
- var _this;
39
-
40
- (0, _classCallCheck2.default)(this, _default);
41
- _this = _super.call(this, config, getSubAdapter, pluginManager);
42
- var fastaLocation = (0, _configuration.readConfObject)(config, 'fastaLocation');
43
- var faiLocation = (0, _configuration.readConfObject)(config, 'faiLocation');
44
- var gziLocation = (0, _configuration.readConfObject)(config, 'gziLocation');
45
-
46
- if (!fastaLocation) {
47
- throw new Error('must provide fastaLocation');
48
- }
49
-
50
- if (!faiLocation) {
51
- throw new Error('must provide faiLocation');
52
- }
53
-
54
- if (!gziLocation) {
55
- throw new Error('must provide gziLocation');
56
- }
57
-
58
- var fastaOpts = {
59
- fasta: (0, _io.openLocation)(fastaLocation, _this.pluginManager),
60
- fai: (0, _io.openLocation)(faiLocation, _this.pluginManager),
61
- gzi: (0, _io.openLocation)(gziLocation, _this.pluginManager)
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
62
8
  };
63
- _this.fasta = new _indexedfasta.BgzipIndexedFasta(fastaOpts);
64
- return _this;
65
- }
66
-
67
- return (0, _createClass2.default)(_default);
68
- }(_IndexedFastaAdapter.default);
69
-
70
- exports.default = _default;
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var indexedfasta_1 = require("@gmod/indexedfasta");
22
+ var io_1 = require("@jbrowse/core/util/io");
23
+ var configuration_1 = require("@jbrowse/core/configuration");
24
+ var IndexedFastaAdapter_1 = __importDefault(require("../IndexedFastaAdapter/IndexedFastaAdapter"));
25
+ var default_1 = /** @class */ (function (_super) {
26
+ __extends(default_1, _super);
27
+ function default_1(config, getSubAdapter, pluginManager) {
28
+ var _this = _super.call(this, config, getSubAdapter, pluginManager) || this;
29
+ var fastaLocation = (0, configuration_1.readConfObject)(config, 'fastaLocation');
30
+ var faiLocation = (0, configuration_1.readConfObject)(config, 'faiLocation');
31
+ var gziLocation = (0, configuration_1.readConfObject)(config, 'gziLocation');
32
+ if (!fastaLocation) {
33
+ throw new Error('must provide fastaLocation');
34
+ }
35
+ if (!faiLocation) {
36
+ throw new Error('must provide faiLocation');
37
+ }
38
+ if (!gziLocation) {
39
+ throw new Error('must provide gziLocation');
40
+ }
41
+ var fastaOpts = {
42
+ fasta: (0, io_1.openLocation)(fastaLocation, _this.pluginManager),
43
+ fai: (0, io_1.openLocation)(faiLocation, _this.pluginManager),
44
+ gzi: (0, io_1.openLocation)(gziLocation, _this.pluginManager),
45
+ };
46
+ _this.fasta = new indexedfasta_1.BgzipIndexedFasta(fastaOpts);
47
+ return _this;
48
+ }
49
+ return default_1;
50
+ }(IndexedFastaAdapter_1.default));
51
+ exports.default = default_1;
52
+ //# sourceMappingURL=BgzipFastaAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BgzipFastaAdapter.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/BgzipFastaAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,mDAAsD;AAEtD,4CAAoD;AACpD,6DAA4D;AAE5D,mGAAqE;AAIrE;IAA6B,6BAAY;IACvC,mBACE,MAA6B,EAC7B,aAAiC,EACjC,aAA6B;QAH/B,YAKE,kBAAM,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,SAoB5C;QAnBC,IAAM,aAAa,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,eAAe,CAAC,CAAA;QAC7D,IAAM,WAAW,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACzD,IAAM,WAAW,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACzD,IAAI,CAAC,aAAa,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC9C;QACD,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;SAC5C;QACD,IAAM,SAAS,GAAG;YAChB,KAAK,EAAE,IAAA,iBAAY,EAAC,aAA6B,EAAE,KAAI,CAAC,aAAa,CAAC;YACtE,GAAG,EAAE,IAAA,iBAAY,EAAC,WAA2B,EAAE,KAAI,CAAC,aAAa,CAAC;YAClE,GAAG,EAAE,IAAA,iBAAY,EAAC,WAA2B,EAAE,KAAI,CAAC,aAAa,CAAC;SACnE,CAAA;QAED,KAAI,CAAC,KAAK,GAAG,IAAI,gCAAiB,CAAC,SAAS,CAAC,CAAA;;IAC/C,CAAC;IACH,gBAAC;AAAD,CAAC,AA3BD,CAA6B,6BAAY,GA2BxC"}
@@ -1,44 +1,32 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _configuration = require("@jbrowse/core/configuration");
9
-
10
- var _default = (0, _configuration.ConfigurationSchema)('BgzipFastaAdapter', {
11
- fastaLocation: {
12
- type: 'fileLocation',
13
- defaultValue: {
14
- uri: '/path/to/seq.fa.gz',
15
- locationType: 'UriLocation'
16
- }
17
- },
18
- faiLocation: {
19
- type: 'fileLocation',
20
- defaultValue: {
21
- uri: '/path/to/seq.fa.gz.fai',
22
- locationType: 'UriLocation'
23
- }
24
- },
25
- metadataLocation: {
26
- description: 'Optional metadata file',
27
- type: 'fileLocation',
28
- defaultValue: {
29
- uri: '/path/to/fa.metadata.yaml',
30
- locationType: 'UriLocation'
31
- }
32
- },
33
- gziLocation: {
34
- type: 'fileLocation',
35
- defaultValue: {
36
- uri: '/path/to/seq.fa.gz.gzi',
37
- locationType: 'UriLocation'
38
- }
39
- }
40
- }, {
41
- explicitlyTyped: true
42
- });
43
-
44
- exports.default = _default;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var configuration_1 = require("@jbrowse/core/configuration");
4
+ exports.default = (0, configuration_1.ConfigurationSchema)('BgzipFastaAdapter', {
5
+ fastaLocation: {
6
+ type: 'fileLocation',
7
+ defaultValue: { uri: '/path/to/seq.fa.gz', locationType: 'UriLocation' },
8
+ },
9
+ faiLocation: {
10
+ type: 'fileLocation',
11
+ defaultValue: {
12
+ uri: '/path/to/seq.fa.gz.fai',
13
+ locationType: 'UriLocation',
14
+ },
15
+ },
16
+ metadataLocation: {
17
+ description: 'Optional metadata file',
18
+ type: 'fileLocation',
19
+ defaultValue: {
20
+ uri: '/path/to/fa.metadata.yaml',
21
+ locationType: 'UriLocation',
22
+ },
23
+ },
24
+ gziLocation: {
25
+ type: 'fileLocation',
26
+ defaultValue: {
27
+ uri: '/path/to/seq.fa.gz.gzi',
28
+ locationType: 'UriLocation',
29
+ },
30
+ },
31
+ }, { explicitlyTyped: true });
32
+ //# sourceMappingURL=configSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,6DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,mBAAmB,EACnB;IACE,aAAa,EAAE;QACb,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE;KACzE;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,wBAAwB;YAC7B,YAAY,EAAE,aAAa;SAC5B;KACF;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,2BAA2B;YAChC,YAAY,EAAE,aAAa;SAC5B;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,wBAAwB;YAC7B,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "configSchema", {
9
- enumerable: true,
10
- get: function get() {
11
- return _configSchema.default;
12
- }
13
- });
14
-
15
- var _configSchema = _interopRequireDefault(require("./configSchema"));
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.configSchema = void 0;
7
+ var configSchema_1 = require("./configSchema");
8
+ Object.defineProperty(exports, "configSchema", { enumerable: true, get: function () { return __importDefault(configSchema_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAwD;AAA/C,6HAAA,OAAO,OAAgB"}
@@ -1,170 +1,136 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
-
16
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
-
18
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
-
20
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
21
-
22
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
23
-
24
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
25
-
26
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
27
-
28
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
-
30
- var _BaseAdapter2 = require("@jbrowse/core/data_adapters/BaseAdapter");
31
-
32
- var _io = require("@jbrowse/core/util/io");
33
-
34
- var _configuration = require("@jbrowse/core/configuration");
35
-
36
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
-
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
-
40
- var _default = /*#__PURE__*/function (_BaseAdapter) {
41
- (0, _inherits2.default)(_default, _BaseAdapter);
42
-
43
- var _super = _createSuper(_default);
44
-
45
- // the map of refSeq to length
46
- function _default(config, getSubAdapter, pluginManager) {
47
- var _this;
48
-
49
- (0, _classCallCheck2.default)(this, _default);
50
- _this = _super.call(this, config, getSubAdapter, pluginManager);
51
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "refSeqs", void 0);
52
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "source", void 0);
53
- var chromSizesLocation = (0, _configuration.readConfObject)(config, 'chromSizesLocation');
54
-
55
- if (!chromSizesLocation) {
56
- throw new Error('must provide chromSizesLocation');
57
- }
58
-
59
- var file = (0, _io.openLocation)(chromSizesLocation, _this.pluginManager);
60
- _this.source = file.toString();
61
- _this.refSeqs = _this.init(file);
62
- return _this;
63
- }
64
-
65
- (0, _createClass2.default)(_default, [{
66
- key: "init",
67
- value: function () {
68
- var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(file) {
69
- var data, refSeqs;
70
- return _regenerator.default.wrap(function _callee$(_context) {
71
- while (1) {
72
- switch (_context.prev = _context.next) {
73
- case 0:
74
- _context.next = 2;
75
- return file.readFile('utf8');
76
-
77
- case 2:
78
- data = _context.sent;
79
- refSeqs = {};
80
-
81
- if (data.length) {
82
- _context.next = 6;
83
- break;
84
- }
85
-
86
- throw new Error("Could not read file ".concat(file.toString()));
87
-
88
- case 6:
89
- data.split('\n').forEach(function (line) {
90
- if (line.length) {
91
- var _line$split = line.split('\t'),
92
- _line$split2 = (0, _slicedToArray2.default)(_line$split, 2),
93
- name = _line$split2[0],
94
- length = _line$split2[1];
95
-
96
- refSeqs[name] = +length;
97
- }
98
- });
99
- return _context.abrupt("return", refSeqs);
100
-
101
- case 8:
102
- case "end":
103
- return _context.stop();
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
104
47
  }
105
- }
106
- }, _callee);
107
- }));
108
-
109
- function init(_x) {
110
- return _init.apply(this, arguments);
111
- }
112
-
113
- return init;
114
- }()
115
- }, {
116
- key: "getRegions",
117
- value: function () {
118
- var _getRegions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
119
- var refSeqs;
120
- return _regenerator.default.wrap(function _callee2$(_context2) {
121
- while (1) {
122
- switch (_context2.prev = _context2.next) {
123
- case 0:
124
- _context2.next = 2;
125
- return this.refSeqs;
126
-
127
- case 2:
128
- refSeqs = _context2.sent;
129
- return _context2.abrupt("return", Object.keys(refSeqs).map(function (refName) {
130
- return {
131
- refName: refName,
132
- start: 0,
133
- end: refSeqs[refName]
134
- };
135
- }));
136
-
137
- case 4:
138
- case "end":
139
- return _context2.stop();
140
- }
141
- }
142
- }, _callee2, this);
143
- }));
144
-
145
- function getRegions() {
146
- return _getRegions.apply(this, arguments);
147
- }
148
-
149
- return getRegions;
150
- }()
151
- }, {
152
- key: "getFeatures",
153
- value: function getFeatures() {
154
- throw new Error('sequence not available');
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ var __read = (this && this.__read) || function (o, n) {
54
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
55
+ if (!m) return o;
56
+ var i = m.call(o), r, ar = [], e;
57
+ try {
58
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
155
59
  }
156
- }, {
157
- key: "getHeader",
158
- value: function getHeader() {
159
- return {};
60
+ catch (error) { e = { error: error }; }
61
+ finally {
62
+ try {
63
+ if (r && !r.done && (m = i["return"])) m.call(i);
64
+ }
65
+ finally { if (e) throw e.error; }
160
66
  }
161
- }, {
162
- key: "freeResources",
163
- value: function
164
- /* { region } */
165
- freeResources() {}
166
- }]);
167
- return _default;
168
- }(_BaseAdapter2.BaseAdapter);
169
-
170
- exports.default = _default;
67
+ return ar;
68
+ };
69
+ Object.defineProperty(exports, "__esModule", { value: true });
70
+ var BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
71
+ var io_1 = require("@jbrowse/core/util/io");
72
+ var configuration_1 = require("@jbrowse/core/configuration");
73
+ var default_1 = /** @class */ (function (_super) {
74
+ __extends(default_1, _super);
75
+ function default_1(config, getSubAdapter, pluginManager) {
76
+ var _this = _super.call(this, config, getSubAdapter, pluginManager) || this;
77
+ var chromSizesLocation = (0, configuration_1.readConfObject)(config, 'chromSizesLocation');
78
+ if (!chromSizesLocation) {
79
+ throw new Error('must provide chromSizesLocation');
80
+ }
81
+ var file = (0, io_1.openLocation)(chromSizesLocation, _this.pluginManager);
82
+ _this.source = file.toString();
83
+ _this.refSeqs = _this.init(file);
84
+ return _this;
85
+ }
86
+ default_1.prototype.init = function (file) {
87
+ return __awaiter(this, void 0, void 0, function () {
88
+ var data, refSeqs;
89
+ return __generator(this, function (_a) {
90
+ switch (_a.label) {
91
+ case 0: return [4 /*yield*/, file.readFile('utf8')];
92
+ case 1:
93
+ data = _a.sent();
94
+ refSeqs = {};
95
+ if (!data.length) {
96
+ throw new Error("Could not read file ".concat(file.toString()));
97
+ }
98
+ data.split('\n').forEach(function (line) {
99
+ if (line.length) {
100
+ var _a = __read(line.split('\t'), 2), name_1 = _a[0], length_1 = _a[1];
101
+ refSeqs[name_1] = +length_1;
102
+ }
103
+ });
104
+ return [2 /*return*/, refSeqs];
105
+ }
106
+ });
107
+ });
108
+ };
109
+ default_1.prototype.getRegions = function () {
110
+ return __awaiter(this, void 0, void 0, function () {
111
+ var refSeqs;
112
+ return __generator(this, function (_a) {
113
+ switch (_a.label) {
114
+ case 0: return [4 /*yield*/, this.refSeqs];
115
+ case 1:
116
+ refSeqs = _a.sent();
117
+ return [2 /*return*/, Object.keys(refSeqs).map(function (refName) { return ({
118
+ refName: refName,
119
+ start: 0,
120
+ end: refSeqs[refName],
121
+ }); })];
122
+ }
123
+ });
124
+ });
125
+ };
126
+ default_1.prototype.getFeatures = function () {
127
+ throw new Error('sequence not available');
128
+ };
129
+ default_1.prototype.getHeader = function () {
130
+ return {};
131
+ };
132
+ default_1.prototype.freeResources = function ( /* { region } */) { };
133
+ return default_1;
134
+ }(BaseAdapter_1.BaseAdapter));
135
+ exports.default = default_1;
136
+ //# sourceMappingURL=ChromSizesAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChromSizesAdapter.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/ChromSizesAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAGgD;AAEhD,4CAAoD;AAEpD,6DAA4D;AAM5D;IAA6B,6BAAW;IAMtC,mBACE,MAAuC,EACvC,aAAiC,EACjC,aAA6B;QAH/B,YAKE,kBAAM,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,SAW5C;QAVC,IAAM,kBAAkB,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;QACvE,IAAI,CAAC,kBAAkB,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;SACnD;QACD,IAAM,IAAI,GAAG,IAAA,iBAAY,EACvB,kBAAkC,EAClC,KAAI,CAAC,aAAa,CACnB,CAAA;QACD,KAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC7B,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;IAChC,CAAC;IAEa,wBAAI,GAAlB,UAAmB,IAAuB;;;;;4BAC3B,qBAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA;;wBAAlC,IAAI,GAAG,SAA2B;wBAClC,OAAO,GAA8B,EAAE,CAAA;wBAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;4BAChB,MAAM,IAAI,KAAK,CAAC,8BAAuB,IAAI,CAAC,QAAQ,EAAE,CAAE,CAAC,CAAA;yBAC1D;wBACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,IAAY;4BACpC,IAAI,IAAI,CAAC,MAAM,EAAE;gCACT,IAAA,KAAA,OAAiB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAA,EAAhC,MAAI,QAAA,EAAE,QAAM,QAAoB,CAAA;gCACvC,OAAO,CAAC,MAAI,CAAC,GAAG,CAAC,QAAM,CAAA;6BACxB;wBACH,CAAC,CAAC,CAAA;wBACF,sBAAO,OAAO,EAAA;;;;KACf;IAEY,8BAAU,GAAvB;;;;;4BACkB,qBAAM,IAAI,CAAC,OAAO,EAAA;;wBAA5B,OAAO,GAAG,SAAkB;wBAClC,sBAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,CAAC;gCAC1C,OAAO,SAAA;gCACP,KAAK,EAAE,CAAC;gCACR,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;6BACtB,CAAC,EAJyC,CAIzC,CAAC,EAAA;;;;KACJ;IAEM,+BAAW,GAAlB;QACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IAC3C,CAAC;IAEM,6BAAS,GAAhB;QACE,OAAO,EAAE,CAAA;IACX,CAAC;IAEM,iCAAa,GAApB,WAAqB,gBAAgB,IAAS,CAAC;IACjD,gBAAC;AAAD,CAAC,AAzDD,CAA6B,yBAAW,GAyDvC"}
@@ -1,22 +1,13 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _configuration = require("@jbrowse/core/configuration");
9
-
10
- var _default = (0, _configuration.ConfigurationSchema)('ChromSizesAdapter', {
11
- chromSizesLocation: {
12
- type: 'fileLocation',
13
- defaultValue: {
14
- uri: '/path/to/species.chrom.sizes',
15
- locationType: 'UriLocation'
16
- }
17
- }
18
- }, {
19
- explicitlyTyped: true
20
- });
21
-
22
- exports.default = _default;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var configuration_1 = require("@jbrowse/core/configuration");
4
+ exports.default = (0, configuration_1.ConfigurationSchema)('ChromSizesAdapter', {
5
+ chromSizesLocation: {
6
+ type: 'fileLocation',
7
+ defaultValue: {
8
+ uri: '/path/to/species.chrom.sizes',
9
+ locationType: 'UriLocation',
10
+ },
11
+ },
12
+ }, { explicitlyTyped: true });
13
+ //# sourceMappingURL=configSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,6DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,mBAAmB,EACnB;IACE,kBAAkB,EAAE;QAClB,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,8BAA8B;YACnC,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "configSchema", {
9
- enumerable: true,
10
- get: function get() {
11
- return _configSchema.default;
12
- }
13
- });
14
-
15
- var _configSchema = _interopRequireDefault(require("./configSchema"));
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.configSchema = void 0;
7
+ var configSchema_1 = require("./configSchema");
8
+ Object.defineProperty(exports, "configSchema", { enumerable: true, get: function () { return __importDefault(configSchema_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAwD;AAA/C,6HAAA,OAAO,OAAgB"}