@jbrowse/plugin-sequence 1.5.8 → 1.6.2
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 +2 -2
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +29 -5
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +2 -2
- package/dist/plugin-sequence.cjs.development.js +49 -41
- 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 +50 -42
- package/dist/plugin-sequence.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/DivSequenceRenderer/components/DivSequenceRendering.tsx +2 -1
- package/src/DivSequenceRenderer/components/__snapshots__/DivSequenceRendering.test.js.snap +6 -0
- package/src/GCContentAdapter/GCContentAdapter.ts +7 -8
- package/src/IndexedFastaAdapter/IndexedFastaAdapter.ts +2 -3
- package/src/TwoBitAdapter/TwoBitAdapter.ts +2 -8
- package/src/index.ts +28 -17
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IndexedFasta } from '@gmod/indexedfasta';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseSequenceAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
4
4
|
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
5
5
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
6
6
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
7
7
|
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
8
|
-
export default class extends
|
|
8
|
+
export default class extends BaseSequenceAdapter {
|
|
9
9
|
protected fasta: IndexedFasta;
|
|
10
10
|
private seqCache;
|
|
11
11
|
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
@@ -53,6 +53,7 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
53
53
|
beforeDestroy(): void;
|
|
54
54
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
55
55
|
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
56
|
+
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
56
57
|
} & {
|
|
57
58
|
type: import("mobx-state-tree").ISimpleType<"LinearReferenceSequenceDisplay">;
|
|
58
59
|
configuration: import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
@@ -113,15 +114,17 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
113
114
|
setRpcDriverName(rpcDriverName: string): void;
|
|
114
115
|
reload(): void;
|
|
115
116
|
} & {
|
|
117
|
+
currBpPerPx: number;
|
|
116
118
|
message: string;
|
|
117
119
|
featureIdUnderMouse: string | undefined;
|
|
118
120
|
contextMenuFeature: import("@jbrowse/core/util/simpleFeature").Feature | undefined;
|
|
119
121
|
scrollTop: number;
|
|
122
|
+
estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
|
|
123
|
+
estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
|
|
120
124
|
} & {
|
|
121
125
|
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
122
126
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
123
127
|
} & {
|
|
124
|
-
readonly maxViewBpPerPx: any;
|
|
125
128
|
readonly renderDelay: number;
|
|
126
129
|
readonly TooltipComponent: import("react").FC<any>;
|
|
127
130
|
readonly selectedFeatureId: string | undefined;
|
|
@@ -132,14 +135,28 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
132
135
|
getFeatureOverlapping(blockKey: string, x: number, y: number): any;
|
|
133
136
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
134
137
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
138
|
+
readonly currentBytesRequested: number;
|
|
139
|
+
readonly currentFeatureScreenDensity: number;
|
|
140
|
+
readonly maxFeatureScreenDensity: any;
|
|
141
|
+
readonly estimatedStatsReady: boolean;
|
|
142
|
+
readonly maxAllowableBytes: number;
|
|
135
143
|
} & {
|
|
144
|
+
setMessage(message: string): void;
|
|
136
145
|
afterAttach(): void;
|
|
146
|
+
estimateRegionsStats(regions: import("@jbrowse/core/util").Region[], opts: {
|
|
147
|
+
headers?: Record<string, string> | undefined;
|
|
148
|
+
signal?: AbortSignal | undefined;
|
|
149
|
+
filters?: string[] | undefined;
|
|
150
|
+
}): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats>;
|
|
151
|
+
setRegionStatsP(p?: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined): void;
|
|
152
|
+
setRegionStats(estimatedRegionStats?: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined): void;
|
|
153
|
+
clearRegionStats(): void;
|
|
137
154
|
setHeight(displayHeight: number): number;
|
|
138
155
|
resizeHeight(distance: number): number;
|
|
139
156
|
setScrollTop(scrollTop: number): void;
|
|
140
|
-
|
|
141
|
-
setMessage(message: string): void;
|
|
157
|
+
updateStatsLimit(stats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats): void;
|
|
142
158
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
159
|
+
setCurrBpPerPx(n: number): void;
|
|
143
160
|
deleteBlock(key: string): void;
|
|
144
161
|
selectFeature(feature: import("@jbrowse/core/util/simpleFeature").Feature): void;
|
|
145
162
|
clearFeatureSelection(): void;
|
|
@@ -147,7 +164,13 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
147
164
|
reload(): void;
|
|
148
165
|
setContextMenuFeature(feature?: import("@jbrowse/core/util/simpleFeature").Feature | undefined): void;
|
|
149
166
|
} & {
|
|
150
|
-
|
|
167
|
+
readonly regionTooLarge: boolean;
|
|
168
|
+
readonly regionTooLargeReason: string;
|
|
169
|
+
} & {
|
|
170
|
+
reload(): Promise<void>;
|
|
171
|
+
afterAttach(): void;
|
|
172
|
+
} & {
|
|
173
|
+
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
151
174
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): JSX.Element | undefined;
|
|
152
175
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
153
176
|
contextMenuItems(): {
|
|
@@ -157,7 +180,7 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
157
180
|
}[];
|
|
158
181
|
renderProps(): any;
|
|
159
182
|
} & {
|
|
160
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/
|
|
183
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/dist/LinearGenomeView").ExportSvgOptions & {
|
|
161
184
|
overrideHeight: number;
|
|
162
185
|
}): Promise<JSX.Element>;
|
|
163
186
|
} & {
|
|
@@ -181,4 +204,5 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
181
204
|
rpcDriverName: string | undefined;
|
|
182
205
|
height: number;
|
|
183
206
|
userBpPerPxLimit: number | undefined;
|
|
207
|
+
userByteSizeLimit: number | undefined;
|
|
184
208
|
} & import("mobx-state-tree")._NotCustomized>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
3
3
|
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
4
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema';
|
|
5
5
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
6
6
|
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
7
|
-
export default class TwoBitAdapter extends
|
|
7
|
+
export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
8
8
|
private twobit;
|
|
9
9
|
protected chromSizesData: Promise<Record<string, number> | undefined>;
|
|
10
10
|
private initChromSizes;
|
|
@@ -12,10 +12,10 @@ var Plugin = _interopDefault(require('@jbrowse/core/Plugin'));
|
|
|
12
12
|
var pluginLinearGenomeView = require('@jbrowse/plugin-linear-genome-view');
|
|
13
13
|
var tracks = require('@jbrowse/core/util/tracks');
|
|
14
14
|
var configuration = require('@jbrowse/core/configuration');
|
|
15
|
+
var React = _interopDefault(require('react'));
|
|
15
16
|
var color = require('@jbrowse/core/util/color');
|
|
16
17
|
var ui = require('@jbrowse/core/ui');
|
|
17
18
|
var mobxReact = require('mobx-react');
|
|
18
|
-
var React = _interopDefault(require('react'));
|
|
19
19
|
var util = require('@jbrowse/core/util');
|
|
20
20
|
var mobxStateTree = require('mobx-state-tree');
|
|
21
21
|
var BaseAdapter = require('@jbrowse/core/data_adapters/BaseAdapter');
|
|
@@ -135,14 +135,14 @@ function _inherits(subClass, superClass) {
|
|
|
135
135
|
throw new TypeError("Super expression must either be null or a function");
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
139
|
+
constructor: {
|
|
140
|
+
value: subClass,
|
|
141
|
+
writable: true,
|
|
142
|
+
configurable: true
|
|
143
|
+
}
|
|
144
|
+
});
|
|
138
145
|
Object.defineProperty(subClass, "prototype", {
|
|
139
|
-
value: Object.create(superClass && superClass.prototype, {
|
|
140
|
-
constructor: {
|
|
141
|
-
value: subClass,
|
|
142
|
-
writable: true,
|
|
143
|
-
configurable: true
|
|
144
|
-
}
|
|
145
|
-
}),
|
|
146
146
|
writable: false
|
|
147
147
|
});
|
|
148
148
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
@@ -512,6 +512,7 @@ var Wrapper = function Wrapper(_ref3) {
|
|
|
512
512
|
totalHeight = _ref3.totalHeight,
|
|
513
513
|
children = _ref3.children;
|
|
514
514
|
return exportSVG ? React.createElement(React.Fragment, null, children) : React.createElement("svg", {
|
|
515
|
+
"data-testid": "sequence_track",
|
|
515
516
|
width: width,
|
|
516
517
|
height: totalHeight,
|
|
517
518
|
style: {
|
|
@@ -834,12 +835,15 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
834
835
|
var regexGuess = /\.2bit$/i;
|
|
835
836
|
var adapterName = 'TwoBitAdapter';
|
|
836
837
|
var fileName = tracks.getFileName(file);
|
|
838
|
+
var obj = {
|
|
839
|
+
type: adapterName,
|
|
840
|
+
twoBitLocation: file
|
|
841
|
+
};
|
|
837
842
|
|
|
838
|
-
if (regexGuess.test(fileName)
|
|
839
|
-
return
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
};
|
|
843
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
844
|
+
return obj;
|
|
845
|
+
} else if (adapterHint === adapterName) {
|
|
846
|
+
return obj;
|
|
843
847
|
}
|
|
844
848
|
|
|
845
849
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -893,13 +897,16 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
893
897
|
var regexGuess = /\.(fa|fasta|fas|fna|mfa)$/i;
|
|
894
898
|
var adapterName = 'IndexedFastaAdapter';
|
|
895
899
|
var fileName = tracks.getFileName(file);
|
|
900
|
+
var obj = {
|
|
901
|
+
type: adapterName,
|
|
902
|
+
fastaLocation: file,
|
|
903
|
+
faiLocation: index || tracks.makeIndex(file, '.fai')
|
|
904
|
+
};
|
|
896
905
|
|
|
897
|
-
if (regexGuess.test(fileName)
|
|
898
|
-
return
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
faiLocation: index || tracks.makeIndex(file, '.fai')
|
|
902
|
-
};
|
|
906
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
907
|
+
return obj;
|
|
908
|
+
} else if (adapterHint === adapterName) {
|
|
909
|
+
return obj;
|
|
903
910
|
}
|
|
904
911
|
|
|
905
912
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -936,13 +943,16 @@ var SequencePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
936
943
|
var regexGuess = /\.(fa|fasta|fas|fna|mfa)\.b?gz$/i;
|
|
937
944
|
var adapterName = 'BgzipFastaAdapter';
|
|
938
945
|
var fileName = tracks.getFileName(file);
|
|
946
|
+
var obj = {
|
|
947
|
+
type: adapterName,
|
|
948
|
+
faiLocation: tracks.makeIndex(file, '.fai'),
|
|
949
|
+
gziLocation: tracks.makeIndex(file, '.gzi')
|
|
950
|
+
};
|
|
939
951
|
|
|
940
|
-
if (regexGuess.test(fileName)
|
|
941
|
-
return
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
gziLocation: tracks.makeIndex(file, '.gzi')
|
|
945
|
-
};
|
|
952
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
953
|
+
return obj;
|
|
954
|
+
} else if (adapterHint === adapterName) {
|
|
955
|
+
return obj;
|
|
946
956
|
}
|
|
947
957
|
|
|
948
958
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -1836,8 +1846,9 @@ var default_1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1836
1846
|
this.gcMode = 'content';
|
|
1837
1847
|
return rxjs.ObservableCreate( /*#__PURE__*/function () {
|
|
1838
1848
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(observer) {
|
|
1839
|
-
var
|
|
1849
|
+
var _feats$;
|
|
1840
1850
|
|
|
1851
|
+
var sequenceAdapter, hw, f, queryStart, queryEnd, ret, feats, residues, i, r, nc, ng, len, j, pos, score;
|
|
1841
1852
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1842
1853
|
while (1) {
|
|
1843
1854
|
switch (_context3.prev = _context3.next) {
|
|
@@ -1866,15 +1877,13 @@ var default_1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1866
1877
|
ret = sequenceAdapter.getFeatures(_objectSpread2(_objectSpread2({}, query), {}, {
|
|
1867
1878
|
start: queryStart,
|
|
1868
1879
|
end: queryEnd
|
|
1869
|
-
})
|
|
1880
|
+
}));
|
|
1870
1881
|
_context3.next = 14;
|
|
1871
1882
|
return ret.pipe(operators.toArray()).toPromise();
|
|
1872
1883
|
|
|
1873
1884
|
case 14:
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
feat = _yield$ret$pipe$toPro2[0];
|
|
1877
|
-
residues = feat.get('seq');
|
|
1885
|
+
feats = _context3.sent;
|
|
1886
|
+
residues = ((_feats$ = feats[0]) === null || _feats$ === void 0 ? void 0 : _feats$.get('seq')) || '';
|
|
1878
1887
|
|
|
1879
1888
|
for (i = hw; i < residues.length - hw; i += _this2.windowDelta) {
|
|
1880
1889
|
r = f ? residues[i] : residues.slice(i - hw, i + hw);
|
|
@@ -1901,20 +1910,19 @@ var default_1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
1901
1910
|
score = (ng + nc) / (len || 1);
|
|
1902
1911
|
} else if (_this2.gcMode === 'skew') {
|
|
1903
1912
|
score = (ng - nc) / (ng + nc || 1);
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1913
|
+
}
|
|
1906
1914
|
|
|
1907
1915
|
observer.next(new SimpleFeature({
|
|
1908
1916
|
uniqueId: "".concat(_this2.id, "_").concat(pos + i),
|
|
1909
1917
|
start: pos + i,
|
|
1910
1918
|
end: pos + i + _this2.windowDelta,
|
|
1911
1919
|
score: score
|
|
1912
|
-
}));
|
|
1920
|
+
}));
|
|
1913
1921
|
}
|
|
1914
1922
|
|
|
1915
1923
|
observer.complete();
|
|
1916
1924
|
|
|
1917
|
-
case
|
|
1925
|
+
case 18:
|
|
1918
1926
|
case "end":
|
|
1919
1927
|
return _context3.stop();
|
|
1920
1928
|
}
|
|
@@ -1949,8 +1957,8 @@ var GCContentAdapter = {
|
|
|
1949
1957
|
'default': default_1
|
|
1950
1958
|
};
|
|
1951
1959
|
|
|
1952
|
-
var TwoBitAdapter = /*#__PURE__*/function (
|
|
1953
|
-
_inherits(TwoBitAdapter,
|
|
1960
|
+
var TwoBitAdapter = /*#__PURE__*/function (_BaseSequenceAdapter) {
|
|
1961
|
+
_inherits(TwoBitAdapter, _BaseSequenceAdapter);
|
|
1954
1962
|
|
|
1955
1963
|
var _super = /*#__PURE__*/_createSuper(TwoBitAdapter);
|
|
1956
1964
|
|
|
@@ -2188,7 +2196,7 @@ var TwoBitAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
2188
2196
|
}]);
|
|
2189
2197
|
|
|
2190
2198
|
return TwoBitAdapter;
|
|
2191
|
-
}(BaseAdapter.
|
|
2199
|
+
}(BaseAdapter.BaseSequenceAdapter);
|
|
2192
2200
|
|
|
2193
2201
|
var TwoBitAdapter$1 = {
|
|
2194
2202
|
__proto__: null,
|
|
@@ -2324,8 +2332,8 @@ var ChromSizesAdapter = {
|
|
|
2324
2332
|
'default': _default
|
|
2325
2333
|
};
|
|
2326
2334
|
|
|
2327
|
-
var _default$1 = /*#__PURE__*/function (
|
|
2328
|
-
_inherits(_default,
|
|
2335
|
+
var _default$1 = /*#__PURE__*/function (_BaseSequenceAdapter) {
|
|
2336
|
+
_inherits(_default, _BaseSequenceAdapter);
|
|
2329
2337
|
|
|
2330
2338
|
var _super = /*#__PURE__*/_createSuper(_default);
|
|
2331
2339
|
|
|
@@ -2505,7 +2513,7 @@ var _default$1 = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
2505
2513
|
}]);
|
|
2506
2514
|
|
|
2507
2515
|
return _default;
|
|
2508
|
-
}(BaseAdapter.
|
|
2516
|
+
}(BaseAdapter.BaseSequenceAdapter);
|
|
2509
2517
|
|
|
2510
2518
|
var IndexedFastaAdapter = {
|
|
2511
2519
|
__proto__: null,
|