@jbrowse/plugin-sequence 1.5.0 → 1.5.4
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/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +3 -3
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +1 -1
- package/dist/plugin-sequence.cjs.development.js +143 -33
- package/dist/plugin-sequence.cjs.development.js.map +1 -1
- package/dist/plugin-sequence.cjs.production.min.js +1 -1
- package/dist/plugin-sequence.cjs.production.min.js.map +1 -1
- package/dist/plugin-sequence.esm.js +143 -33
- package/dist/plugin-sequence.esm.js.map +1 -1
- package/package.json +5 -5
- package/src/ChromSizesAdapter/ChromSizesAdapter.ts +1 -1
- package/src/IndexedFastaAdapter/IndexedFastaAdapter.ts +1 -1
- package/src/TwoBitAdapter/TwoBitAdapter.ts +3 -7
- package/src/declare.d.ts +0 -2
- package/src/index.ts +136 -0
|
@@ -4,6 +4,7 @@ import FeatureRendererType from '@jbrowse/core/pluggableElementTypes/renderers/F
|
|
|
4
4
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
5
5
|
import Plugin from '@jbrowse/core/Plugin';
|
|
6
6
|
import { BaseLinearDisplay, BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
7
|
+
import { getFileName, makeIndex } from '@jbrowse/core/util/tracks';
|
|
7
8
|
import { ConfigurationSchema, ConfigurationReference, readConfObject } from '@jbrowse/core/configuration';
|
|
8
9
|
import { contrastingTextColor } from '@jbrowse/core/util/color';
|
|
9
10
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
@@ -26,14 +27,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
26
27
|
|
|
27
28
|
if (Object.getOwnPropertySymbols) {
|
|
28
29
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
keys.push.apply(keys, symbols);
|
|
30
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
})), keys.push.apply(keys, symbols);
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
return keys;
|
|
@@ -41,19 +37,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
41
37
|
|
|
42
38
|
function _objectSpread2(target) {
|
|
43
39
|
for (var i = 1; i < arguments.length; i++) {
|
|
44
|
-
var source = arguments[i]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
51
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
52
|
-
} else {
|
|
53
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
54
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
55
|
-
});
|
|
56
|
-
}
|
|
40
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
41
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
42
|
+
_defineProperty(target, key, source[key]);
|
|
43
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
44
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
45
|
+
});
|
|
57
46
|
}
|
|
58
47
|
|
|
59
48
|
return target;
|
|
@@ -114,6 +103,9 @@ function _defineProperties(target, props) {
|
|
|
114
103
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
115
104
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
116
105
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
106
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
107
|
+
writable: false
|
|
108
|
+
});
|
|
117
109
|
return Constructor;
|
|
118
110
|
}
|
|
119
111
|
|
|
@@ -137,12 +129,15 @@ function _inherits(subClass, superClass) {
|
|
|
137
129
|
throw new TypeError("Super expression must either be null or a function");
|
|
138
130
|
}
|
|
139
131
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
132
|
+
Object.defineProperty(subClass, "prototype", {
|
|
133
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
134
|
+
constructor: {
|
|
135
|
+
value: subClass,
|
|
136
|
+
writable: true,
|
|
137
|
+
configurable: true
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
writable: false
|
|
146
141
|
});
|
|
147
142
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
148
143
|
}
|
|
@@ -815,6 +810,12 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
815
810
|
return new AdapterType({
|
|
816
811
|
name: 'TwoBitAdapter',
|
|
817
812
|
configSchema: twoBitAdapterConfigSchema,
|
|
813
|
+
adapterMetadata: {
|
|
814
|
+
category: null,
|
|
815
|
+
hiddenFromGUI: true,
|
|
816
|
+
displayName: null,
|
|
817
|
+
description: null
|
|
818
|
+
},
|
|
818
819
|
getAdapterClass: function getAdapterClass() {
|
|
819
820
|
return Promise.resolve().then(function () { return TwoBitAdapter$1; }).then(function (r) {
|
|
820
821
|
return r["default"];
|
|
@@ -822,10 +823,41 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
822
823
|
}
|
|
823
824
|
});
|
|
824
825
|
});
|
|
826
|
+
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
|
|
827
|
+
return function (file, index, adapterHint) {
|
|
828
|
+
var regexGuess = /\.2bit$/i;
|
|
829
|
+
var adapterName = 'TwoBitAdapter';
|
|
830
|
+
var fileName = getFileName(file);
|
|
831
|
+
|
|
832
|
+
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
833
|
+
return {
|
|
834
|
+
type: adapterName,
|
|
835
|
+
twoBitLocation: file
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
return adapterGuesser(file, index, adapterHint);
|
|
840
|
+
};
|
|
841
|
+
});
|
|
842
|
+
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', function (trackTypeGuesser) {
|
|
843
|
+
return function (adapterName) {
|
|
844
|
+
if (adapterName === 'TwoBitAdapter') {
|
|
845
|
+
return 'ReferenceSequenceTrack';
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
return trackTypeGuesser(adapterName);
|
|
849
|
+
};
|
|
850
|
+
});
|
|
825
851
|
pluginManager.addAdapterType(function () {
|
|
826
852
|
return new AdapterType({
|
|
827
853
|
name: 'ChromSizesAdapter',
|
|
828
854
|
configSchema: chromSizesAdapterConfigSchema,
|
|
855
|
+
adapterMetadata: {
|
|
856
|
+
category: null,
|
|
857
|
+
hiddenFromGUI: true,
|
|
858
|
+
displayName: null,
|
|
859
|
+
description: null
|
|
860
|
+
},
|
|
829
861
|
getAdapterClass: function getAdapterClass() {
|
|
830
862
|
return Promise.resolve().then(function () { return ChromSizesAdapter; }).then(function (r) {
|
|
831
863
|
return r["default"];
|
|
@@ -837,6 +869,12 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
837
869
|
return new AdapterType({
|
|
838
870
|
name: 'IndexedFastaAdapter',
|
|
839
871
|
configSchema: indexedFastaAdapterConfigSchema,
|
|
872
|
+
adapterMetadata: {
|
|
873
|
+
category: null,
|
|
874
|
+
hiddenFromGUI: true,
|
|
875
|
+
displayName: null,
|
|
876
|
+
description: null
|
|
877
|
+
},
|
|
840
878
|
getAdapterClass: function getAdapterClass() {
|
|
841
879
|
return Promise.resolve().then(function () { return IndexedFastaAdapter; }).then(function (r) {
|
|
842
880
|
return r["default"];
|
|
@@ -844,10 +882,42 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
844
882
|
}
|
|
845
883
|
});
|
|
846
884
|
});
|
|
885
|
+
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
|
|
886
|
+
return function (file, index, adapterHint) {
|
|
887
|
+
var regexGuess = /\.(fa|fasta|fas|fna|mfa)$/i;
|
|
888
|
+
var adapterName = 'IndexedFastaAdapter';
|
|
889
|
+
var fileName = getFileName(file);
|
|
890
|
+
|
|
891
|
+
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
892
|
+
return {
|
|
893
|
+
type: adapterName,
|
|
894
|
+
fastaLocation: file,
|
|
895
|
+
faiLocation: index || makeIndex(file, '.fai')
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
return adapterGuesser(file, index, adapterHint);
|
|
900
|
+
};
|
|
901
|
+
});
|
|
902
|
+
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', function (trackTypeGuesser) {
|
|
903
|
+
return function (adapterName) {
|
|
904
|
+
if (adapterName === 'IndexedFastaAdapter') {
|
|
905
|
+
return 'ReferenceSequenceTrack';
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
return trackTypeGuesser(adapterName);
|
|
909
|
+
};
|
|
910
|
+
});
|
|
847
911
|
pluginManager.addAdapterType(function () {
|
|
848
912
|
return new AdapterType({
|
|
849
913
|
name: 'BgzipFastaAdapter',
|
|
850
914
|
configSchema: bgzipFastaAdapterConfigSchema,
|
|
915
|
+
adapterMetadata: {
|
|
916
|
+
category: null,
|
|
917
|
+
hiddenFromGUI: true,
|
|
918
|
+
displayName: null,
|
|
919
|
+
description: null
|
|
920
|
+
},
|
|
851
921
|
getAdapterClass: function getAdapterClass() {
|
|
852
922
|
return Promise.resolve().then(function () { return BgzipFastaAdapter; }).then(function (r) {
|
|
853
923
|
return r["default"];
|
|
@@ -855,9 +925,41 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
855
925
|
}
|
|
856
926
|
});
|
|
857
927
|
});
|
|
928
|
+
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
|
|
929
|
+
return function (file, index, adapterHint) {
|
|
930
|
+
var regexGuess = /\.(fa|fasta|fas|fna|mfa)\.b?gz$/i;
|
|
931
|
+
var adapterName = 'BgzipFastaAdapter';
|
|
932
|
+
var fileName = getFileName(file);
|
|
933
|
+
|
|
934
|
+
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
935
|
+
return {
|
|
936
|
+
type: adapterName,
|
|
937
|
+
faiLocation: makeIndex(file, '.fai'),
|
|
938
|
+
gziLocation: makeIndex(file, '.gzi')
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
return adapterGuesser(file, index, adapterHint);
|
|
943
|
+
};
|
|
944
|
+
});
|
|
945
|
+
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', function (trackTypeGuesser) {
|
|
946
|
+
return function (adapterName) {
|
|
947
|
+
if (adapterName === 'BgzipFastaAdapter') {
|
|
948
|
+
return 'ReferenceSequenceTrack';
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
return trackTypeGuesser(adapterName);
|
|
952
|
+
};
|
|
953
|
+
});
|
|
858
954
|
pluginManager.addAdapterType(function () {
|
|
859
955
|
return new AdapterType(_objectSpread2({
|
|
860
|
-
name: 'GCContentAdapter'
|
|
956
|
+
name: 'GCContentAdapter',
|
|
957
|
+
adapterMetadata: {
|
|
958
|
+
category: null,
|
|
959
|
+
hiddenFromGUI: true,
|
|
960
|
+
displayName: null,
|
|
961
|
+
description: null
|
|
962
|
+
}
|
|
861
963
|
}, pluginManager.load(GCContentAdapterF)));
|
|
862
964
|
});
|
|
863
965
|
pluginManager.addTrackType(function () {
|
|
@@ -1827,7 +1929,9 @@ var default_1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1827
1929
|
|
|
1828
1930
|
}, {
|
|
1829
1931
|
key: "freeResources",
|
|
1830
|
-
value: function
|
|
1932
|
+
value: function
|
|
1933
|
+
/* { region } */
|
|
1934
|
+
freeResources() {}
|
|
1831
1935
|
}]);
|
|
1832
1936
|
|
|
1833
1937
|
return default_1;
|
|
@@ -2072,7 +2176,9 @@ var TwoBitAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
2072
2176
|
|
|
2073
2177
|
}, {
|
|
2074
2178
|
key: "freeResources",
|
|
2075
|
-
value: function
|
|
2179
|
+
value: function
|
|
2180
|
+
/* { region } */
|
|
2181
|
+
freeResources() {}
|
|
2076
2182
|
}]);
|
|
2077
2183
|
|
|
2078
2184
|
return TwoBitAdapter;
|
|
@@ -2199,7 +2305,9 @@ var _default = /*#__PURE__*/function (_BaseAdapter) {
|
|
|
2199
2305
|
}
|
|
2200
2306
|
}, {
|
|
2201
2307
|
key: "freeResources",
|
|
2202
|
-
value: function
|
|
2308
|
+
value: function
|
|
2309
|
+
/* { region } */
|
|
2310
|
+
freeResources() {}
|
|
2203
2311
|
}]);
|
|
2204
2312
|
|
|
2205
2313
|
return _default;
|
|
@@ -2385,7 +2493,9 @@ var _default$1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
2385
2493
|
|
|
2386
2494
|
}, {
|
|
2387
2495
|
key: "freeResources",
|
|
2388
|
-
value: function
|
|
2496
|
+
value: function
|
|
2497
|
+
/* { region } */
|
|
2498
|
+
freeResources() {}
|
|
2389
2499
|
}]);
|
|
2390
2500
|
|
|
2391
2501
|
return _default;
|
|
@@ -2432,7 +2542,7 @@ var _default$2 = /*#__PURE__*/function (_IndexedFasta) {
|
|
|
2432
2542
|
return _this;
|
|
2433
2543
|
}
|
|
2434
2544
|
|
|
2435
|
-
return _default;
|
|
2545
|
+
return _createClass(_default);
|
|
2436
2546
|
}(_default$1);
|
|
2437
2547
|
|
|
2438
2548
|
var BgzipFastaAdapter = {
|