@jbrowse/plugin-sequence 1.6.7 → 1.7.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.
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js +70 -0
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.test.js +64 -0
- package/dist/BgzipFastaAdapter/configSchema.js +36 -0
- package/dist/BgzipFastaAdapter/index.js +15 -0
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +170 -0
- package/dist/ChromSizesAdapter/ChromSizesAdapter.test.js +46 -0
- package/dist/ChromSizesAdapter/configSchema.js +22 -0
- package/dist/ChromSizesAdapter/index.js +15 -0
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +239 -0
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.test.js +245 -0
- package/dist/DivSequenceRenderer/configSchema.js +20 -0
- package/dist/DivSequenceRenderer/index.js +23 -0
- package/dist/GCContentAdapter/GCContentAdapter.js +261 -0
- package/dist/GCContentAdapter/configSchema.js +18 -0
- package/dist/GCContentAdapter/index.js +31 -0
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +0 -5
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +228 -0
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.test.js +71 -0
- package/dist/IndexedFastaAdapter/configSchema.js +29 -0
- package/dist/IndexedFastaAdapter/index.js +15 -0
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +18 -0
- package/dist/LinearReferenceSequenceDisplay/index.js +21 -0
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +8 -8
- package/dist/LinearReferenceSequenceDisplay/model.js +102 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.js +289 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.test.js +94 -0
- package/dist/TwoBitAdapter/configSchema.js +30 -0
- package/dist/TwoBitAdapter/index.js +15 -0
- package/dist/declare.d.js +1 -0
- package/dist/index.js +325 -6
- package/dist/index.test.js +29 -0
- package/dist/plugin-sequence.cjs.development.js +0 -6
- package/dist/plugin-sequence.cjs.development.js.map +1 -1
- package/dist/plugin-sequence.cjs.production.min.js.map +1 -1
- package/dist/plugin-sequence.esm.js +0 -6
- package/dist/plugin-sequence.esm.js.map +1 -1
- package/dist/referenceSeqTrackConfig.js +88 -0
- package/package.json +3 -6
- package/src/IndexedFastaAdapter/IndexedFastaAdapter.ts +0 -5
- package/src/index.ts +7 -8
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createReferenceSeqTrackConfig = createReferenceSeqTrackConfig;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _mobxStateTree = require("mobx-state-tree");
|
|
13
|
+
|
|
14
|
+
var _configuration = require("@jbrowse/core/configuration");
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
Note: this is primarily a copy of createBaseTrackConfig, except with a subset
|
|
22
|
+
of the config slots, to avoid including fields that don't make sense for the
|
|
23
|
+
ReferenceSequenceTrack
|
|
24
|
+
*/
|
|
25
|
+
function createReferenceSeqTrackConfig(pluginManager) {
|
|
26
|
+
return (0, _configuration.ConfigurationSchema)('ReferenceSequenceTrack', {
|
|
27
|
+
adapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
28
|
+
displays: _mobxStateTree.types.array(pluginManager.pluggableConfigSchemaType('display')),
|
|
29
|
+
metadata: {
|
|
30
|
+
type: 'frozen',
|
|
31
|
+
description: 'anything to add about this track',
|
|
32
|
+
defaultValue: {}
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
preProcessSnapshot: function preProcessSnapshot(s) {
|
|
36
|
+
var snap = JSON.parse(JSON.stringify(s));
|
|
37
|
+
var displayTypes = new Set();
|
|
38
|
+
var _snap$displays = snap.displays,
|
|
39
|
+
displays = _snap$displays === void 0 ? [] : _snap$displays;
|
|
40
|
+
|
|
41
|
+
if (snap.trackId !== 'placeholderId') {
|
|
42
|
+
// Gets the displays on the track snapshot and the possible displays
|
|
43
|
+
// from the track type and adds any missing possible displays to the
|
|
44
|
+
// snapshot
|
|
45
|
+
displays.forEach(function (d) {
|
|
46
|
+
return d && displayTypes.add(d.type);
|
|
47
|
+
});
|
|
48
|
+
var trackType = pluginManager.getTrackType(snap.type);
|
|
49
|
+
trackType.displayTypes.forEach(function (displayType) {
|
|
50
|
+
if (!displayTypes.has(displayType.name)) {
|
|
51
|
+
displays.push({
|
|
52
|
+
displayId: "".concat(snap.trackId, "-").concat(displayType.name),
|
|
53
|
+
type: displayType.name
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return _objectSpread(_objectSpread({}, snap), {}, {
|
|
60
|
+
displays: displays
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
explicitIdentifier: 'trackId',
|
|
64
|
+
explicitlyTyped: true,
|
|
65
|
+
actions: function actions(self) {
|
|
66
|
+
return {
|
|
67
|
+
addDisplayConf: function addDisplayConf(displayConf) {
|
|
68
|
+
var type = displayConf.type;
|
|
69
|
+
|
|
70
|
+
if (!type) {
|
|
71
|
+
throw new Error("unknown display type ".concat(type));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var display = self.displays.find(function (d) {
|
|
75
|
+
return d && d.displayId === displayConf.displayId;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (display) {
|
|
79
|
+
return display;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var length = self.displays.push(displayConf);
|
|
83
|
+
return self.displays[length - 1];
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-sequence",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "JBrowse 2 sequence adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -18,15 +18,12 @@
|
|
|
18
18
|
"distMain": "dist/index.js",
|
|
19
19
|
"srcMain": "src/index.ts",
|
|
20
20
|
"main": "dist/index.js",
|
|
21
|
-
"distModule": "dist/plugin-sequence.esm.js",
|
|
22
|
-
"module": "dist/plugin-sequence.esm.js",
|
|
23
21
|
"files": [
|
|
24
22
|
"dist",
|
|
25
23
|
"src"
|
|
26
24
|
],
|
|
27
25
|
"scripts": {
|
|
28
|
-
"
|
|
29
|
-
"build": "tsdx build",
|
|
26
|
+
"build": "babel src --root-mode upward --out-dir dist --extensions .ts,.js,.tsx,.jsx",
|
|
30
27
|
"test": "cd ../..; jest plugins/sequence",
|
|
31
28
|
"prepublishOnly": "yarn test",
|
|
32
29
|
"prepack": "yarn build; yarn useDist",
|
|
@@ -55,5 +52,5 @@
|
|
|
55
52
|
"publishConfig": {
|
|
56
53
|
"access": "public"
|
|
57
54
|
},
|
|
58
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "cc13844074d11881d211342a6a7eea113561b70b"
|
|
59
56
|
}
|
|
@@ -57,11 +57,6 @@ export default class extends BaseSequenceAdapter {
|
|
|
57
57
|
}))
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* Fetch features for a certain region
|
|
62
|
-
* @param param -
|
|
63
|
-
* @returns Observable of Feature objects in the region
|
|
64
|
-
*/
|
|
65
60
|
public getFeatures(region: NoAssemblyRegion, opts?: BaseOptions) {
|
|
66
61
|
const { refName, start, end } = region
|
|
67
62
|
return ObservableCreate<Feature>(async observer => {
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
|
|
2
|
-
import { Region } from '@jbrowse/core/util/types'
|
|
2
|
+
import { Region, FileLocation } from '@jbrowse/core/util/types'
|
|
3
3
|
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
4
4
|
import FeatureRendererType from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType'
|
|
5
5
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType'
|
|
6
6
|
import Plugin from '@jbrowse/core/Plugin'
|
|
7
7
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
8
8
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view'
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
makeIndex,
|
|
11
|
+
AdapterGuesser,
|
|
12
|
+
getFileName,
|
|
13
|
+
TrackTypeGuesser,
|
|
14
|
+
} from '@jbrowse/core/util/tracks'
|
|
11
15
|
import { configSchema as bgzipFastaAdapterConfigSchema } from './BgzipFastaAdapter'
|
|
12
16
|
import { configSchema as chromSizesAdapterConfigSchema } from './ChromSizesAdapter'
|
|
13
17
|
import {
|
|
@@ -22,11 +26,6 @@ import {
|
|
|
22
26
|
import { configSchema as twoBitAdapterConfigSchema } from './TwoBitAdapter'
|
|
23
27
|
import GCContentAdapterF from './GCContentAdapter'
|
|
24
28
|
import { createReferenceSeqTrackConfig } from './referenceSeqTrackConfig'
|
|
25
|
-
import {
|
|
26
|
-
AdapterGuesser,
|
|
27
|
-
getFileName,
|
|
28
|
-
TrackTypeGuesser,
|
|
29
|
-
} from '@jbrowse/core/util/tracks'
|
|
30
29
|
|
|
31
30
|
/* adjust in both directions */
|
|
32
31
|
class DivSequenceRenderer extends FeatureRendererType {
|