@jbrowse/plugin-sequence 1.6.9 → 1.7.3
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/dist/BgzipFastaAdapter/BgzipFastaAdapter.d.ts +7 -7
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js +70 -0
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.test.js +64 -0
- package/dist/BgzipFastaAdapter/configSchema.d.ts +2 -2
- package/dist/BgzipFastaAdapter/configSchema.js +36 -0
- package/dist/BgzipFastaAdapter/index.d.ts +1 -1
- package/dist/BgzipFastaAdapter/index.js +15 -0
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +19 -19
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +170 -0
- package/dist/ChromSizesAdapter/ChromSizesAdapter.test.js +46 -0
- package/dist/ChromSizesAdapter/configSchema.d.ts +2 -2
- package/dist/ChromSizesAdapter/configSchema.js +22 -0
- package/dist/ChromSizesAdapter/index.d.ts +1 -1
- package/dist/ChromSizesAdapter/index.js +15 -0
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.d.ts +21 -21
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +239 -0
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.test.js +245 -0
- package/dist/DivSequenceRenderer/configSchema.d.ts +2 -2
- package/dist/DivSequenceRenderer/configSchema.js +20 -0
- package/dist/DivSequenceRenderer/index.d.ts +2 -2
- package/dist/DivSequenceRenderer/index.js +23 -0
- package/dist/GCContentAdapter/GCContentAdapter.d.ts +23 -23
- package/dist/GCContentAdapter/GCContentAdapter.js +261 -0
- package/dist/GCContentAdapter/configSchema.d.ts +3 -3
- package/dist/GCContentAdapter/configSchema.js +18 -0
- package/dist/GCContentAdapter/index.d.ts +6 -6
- package/dist/GCContentAdapter/index.js +31 -0
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +25 -25
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +228 -0
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.test.js +71 -0
- package/dist/IndexedFastaAdapter/configSchema.d.ts +2 -2
- package/dist/IndexedFastaAdapter/configSchema.js +29 -0
- package/dist/IndexedFastaAdapter/index.d.ts +1 -1
- package/dist/IndexedFastaAdapter/index.js +15 -0
- package/dist/LinearReferenceSequenceDisplay/configSchema.d.ts +1 -1
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +18 -0
- package/dist/LinearReferenceSequenceDisplay/index.d.ts +2 -2
- package/dist/LinearReferenceSequenceDisplay/index.js +21 -0
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +208 -208
- package/dist/LinearReferenceSequenceDisplay/model.js +102 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +26 -26
- package/dist/TwoBitAdapter/TwoBitAdapter.js +289 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.test.js +94 -0
- package/dist/TwoBitAdapter/configSchema.d.ts +2 -2
- package/dist/TwoBitAdapter/configSchema.js +30 -0
- package/dist/TwoBitAdapter/index.d.ts +1 -1
- package/dist/TwoBitAdapter/index.js +15 -0
- package/dist/declare.d.js +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +325 -6
- package/dist/index.test.js +29 -0
- package/dist/referenceSeqTrackConfig.d.ts +2 -2
- package/dist/referenceSeqTrackConfig.js +88 -0
- package/package.json +5 -7
- package/src/index.ts +7 -8
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.test.d.ts +0 -1
- package/dist/index.test.d.ts +0 -1
- package/dist/plugin-sequence.cjs.development.js +0 -2567
- package/dist/plugin-sequence.cjs.development.js.map +0 -1
- package/dist/plugin-sequence.cjs.production.min.js +0 -2
- package/dist/plugin-sequence.cjs.production.min.js.map +0 -1
- package/dist/plugin-sequence.esm.js +0 -2561
- package/dist/plugin-sequence.esm.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
2
|
-
import IndexedFasta from '../IndexedFastaAdapter/IndexedFastaAdapter';
|
|
3
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
5
|
-
export default class extends IndexedFasta {
|
|
6
|
-
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
7
|
-
}
|
|
1
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
2
|
+
import IndexedFasta from '../IndexedFastaAdapter/IndexedFastaAdapter';
|
|
3
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
+
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
5
|
+
export default class extends IndexedFasta {
|
|
6
|
+
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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)
|
|
62
|
+
};
|
|
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;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
+
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
|
|
9
|
+
var _operators = require("rxjs/operators");
|
|
10
|
+
|
|
11
|
+
var _BgzipFastaAdapter = _interopRequireDefault(require("./BgzipFastaAdapter"));
|
|
12
|
+
|
|
13
|
+
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
14
|
+
|
|
15
|
+
test('can use a indexed fasta with gzi', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
16
|
+
var adapter, features, featuresArray, features2, featuresArray2;
|
|
17
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
18
|
+
while (1) {
|
|
19
|
+
switch (_context.prev = _context.next) {
|
|
20
|
+
case 0:
|
|
21
|
+
adapter = new _BgzipFastaAdapter["default"](_configSchema["default"].create({
|
|
22
|
+
fastaLocation: {
|
|
23
|
+
localPath: require.resolve('../../test_data/volvox.fa.gz'),
|
|
24
|
+
locationType: 'LocalPathLocation'
|
|
25
|
+
},
|
|
26
|
+
faiLocation: {
|
|
27
|
+
localPath: require.resolve('../../test_data/volvox.fa.gz.fai'),
|
|
28
|
+
locationType: 'LocalPathLocation'
|
|
29
|
+
},
|
|
30
|
+
gziLocation: {
|
|
31
|
+
localPath: require.resolve('../../test_data/volvox.fa.gz.gzi'),
|
|
32
|
+
locationType: 'LocalPathLocation'
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
features = adapter.getFeatures({
|
|
36
|
+
refName: 'ctgA',
|
|
37
|
+
start: 0,
|
|
38
|
+
end: 20000
|
|
39
|
+
});
|
|
40
|
+
_context.next = 4;
|
|
41
|
+
return features.pipe((0, _operators.toArray)()).toPromise();
|
|
42
|
+
|
|
43
|
+
case 4:
|
|
44
|
+
featuresArray = _context.sent;
|
|
45
|
+
expect(featuresArray).toMatchSnapshot();
|
|
46
|
+
features2 = adapter.getFeatures({
|
|
47
|
+
refName: 'ctgC',
|
|
48
|
+
start: 0,
|
|
49
|
+
end: 20000
|
|
50
|
+
});
|
|
51
|
+
_context.next = 9;
|
|
52
|
+
return features2.pipe((0, _operators.toArray)()).toPromise();
|
|
53
|
+
|
|
54
|
+
case 9:
|
|
55
|
+
featuresArray2 = _context.sent;
|
|
56
|
+
expect(featuresArray2).toMatchSnapshot();
|
|
57
|
+
|
|
58
|
+
case 11:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context.stop();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, _callee);
|
|
64
|
+
})));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
gziLocation: {
|
|
26
|
+
type: 'fileLocation',
|
|
27
|
+
defaultValue: {
|
|
28
|
+
uri: '/path/to/seq.fa.gz.gzi',
|
|
29
|
+
locationType: 'UriLocation'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
explicitlyTyped: true
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as configSchema } from './configSchema';
|
|
1
|
+
export { default as configSchema } from './configSchema';
|
|
@@ -0,0 +1,15 @@
|
|
|
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"));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { RegionsAdapter, BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { Instance } from 'mobx-state-tree';
|
|
3
|
-
import MyConfigSchema from './configSchema';
|
|
4
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
5
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
6
|
-
export default class extends BaseAdapter implements RegionsAdapter {
|
|
7
|
-
protected refSeqs: Promise<Record<string, number>>;
|
|
8
|
-
protected source: string;
|
|
9
|
-
constructor(config: Instance<typeof MyConfigSchema>, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
10
|
-
private init;
|
|
11
|
-
getRegions(): Promise<{
|
|
12
|
-
refName: string;
|
|
13
|
-
start: number;
|
|
14
|
-
end: number;
|
|
15
|
-
}[]>;
|
|
16
|
-
getFeatures(): void;
|
|
17
|
-
getHeader(): {};
|
|
18
|
-
freeResources(): void;
|
|
19
|
-
}
|
|
1
|
+
import { RegionsAdapter, BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import { Instance } from 'mobx-state-tree';
|
|
3
|
+
import MyConfigSchema from './configSchema';
|
|
4
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
5
|
+
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
6
|
+
export default class extends BaseAdapter implements RegionsAdapter {
|
|
7
|
+
protected refSeqs: Promise<Record<string, number>>;
|
|
8
|
+
protected source: string;
|
|
9
|
+
constructor(config: Instance<typeof MyConfigSchema>, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
10
|
+
private init;
|
|
11
|
+
getRegions(): Promise<{
|
|
12
|
+
refName: string;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
}[]>;
|
|
16
|
+
getFeatures(): void;
|
|
17
|
+
getHeader(): {};
|
|
18
|
+
freeResources(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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();
|
|
104
|
+
}
|
|
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');
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "getHeader",
|
|
158
|
+
value: function getHeader() {
|
|
159
|
+
return {};
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "freeResources",
|
|
163
|
+
value: function
|
|
164
|
+
/* { region } */
|
|
165
|
+
freeResources() {}
|
|
166
|
+
}]);
|
|
167
|
+
return _default;
|
|
168
|
+
}(_BaseAdapter2.BaseAdapter);
|
|
169
|
+
|
|
170
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
+
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
|
|
9
|
+
var _ChromSizesAdapter = _interopRequireDefault(require("./ChromSizesAdapter"));
|
|
10
|
+
|
|
11
|
+
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
12
|
+
|
|
13
|
+
test('adapter can fetch sequence from volvox.chrom.sizes', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
14
|
+
var adapter, regions;
|
|
15
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
16
|
+
while (1) {
|
|
17
|
+
switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
adapter = new _ChromSizesAdapter["default"](_configSchema["default"].create({
|
|
20
|
+
chromSizesLocation: {
|
|
21
|
+
localPath: require.resolve('./test_data/volvox.chrom.sizes'),
|
|
22
|
+
locationType: 'LocalPathLocation'
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
_context.next = 3;
|
|
26
|
+
return adapter.getRegions();
|
|
27
|
+
|
|
28
|
+
case 3:
|
|
29
|
+
regions = _context.sent;
|
|
30
|
+
expect(regions).toEqual([{
|
|
31
|
+
refName: 'ctgA',
|
|
32
|
+
start: 0,
|
|
33
|
+
end: 50001
|
|
34
|
+
}, {
|
|
35
|
+
refName: 'ctgB',
|
|
36
|
+
start: 0,
|
|
37
|
+
end: 6079
|
|
38
|
+
}]);
|
|
39
|
+
|
|
40
|
+
case 5:
|
|
41
|
+
case "end":
|
|
42
|
+
return _context.stop();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, _callee);
|
|
46
|
+
})));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as configSchema } from './configSchema';
|
|
1
|
+
export { default as configSchema } from './configSchema';
|
|
@@ -0,0 +1,15 @@
|
|
|
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"));
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
3
|
-
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
|
-
import { Region } from '@jbrowse/core/util/types';
|
|
5
|
-
interface MyProps {
|
|
6
|
-
exportSVG?: {
|
|
7
|
-
rasterizeLayers: boolean;
|
|
8
|
-
};
|
|
9
|
-
features: Map<string, Feature>;
|
|
10
|
-
regions: Region[];
|
|
11
|
-
bpPerPx: number;
|
|
12
|
-
config: AnyConfigurationModel;
|
|
13
|
-
highResolutionScaling: number;
|
|
14
|
-
theme: any;
|
|
15
|
-
showForward: boolean;
|
|
16
|
-
showReverse: boolean;
|
|
17
|
-
showTranslation: boolean;
|
|
18
|
-
}
|
|
19
|
-
declare function Sequence(props: MyProps): JSX.Element;
|
|
20
|
-
declare const _default: typeof Sequence;
|
|
21
|
-
export default _default;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
3
|
+
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
|
+
import { Region } from '@jbrowse/core/util/types';
|
|
5
|
+
interface MyProps {
|
|
6
|
+
exportSVG?: {
|
|
7
|
+
rasterizeLayers: boolean;
|
|
8
|
+
};
|
|
9
|
+
features: Map<string, Feature>;
|
|
10
|
+
regions: Region[];
|
|
11
|
+
bpPerPx: number;
|
|
12
|
+
config: AnyConfigurationModel;
|
|
13
|
+
highResolutionScaling: number;
|
|
14
|
+
theme: any;
|
|
15
|
+
showForward: boolean;
|
|
16
|
+
showReverse: boolean;
|
|
17
|
+
showTranslation: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function Sequence(props: MyProps): JSX.Element;
|
|
20
|
+
declare const _default: typeof Sequence;
|
|
21
|
+
export default _default;
|