@jbrowse/plugin-variants 1.5.6 → 1.6.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.
@@ -54,6 +54,7 @@ export default function (configSchema: LinearVariantDisplayConfigModel): import(
54
54
  beforeDestroy(): void;
55
55
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
56
56
  userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
57
+ userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
57
58
  } & {
58
59
  type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
59
60
  trackShowLabels: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
@@ -117,15 +118,17 @@ export default function (configSchema: LinearVariantDisplayConfigModel): import(
117
118
  setRpcDriverName(rpcDriverName: string): void;
118
119
  reload(): void;
119
120
  } & {
121
+ currBpPerPx: number;
120
122
  message: string;
121
123
  featureIdUnderMouse: string | undefined;
122
124
  contextMenuFeature: Feature | undefined;
123
125
  scrollTop: number;
126
+ estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
127
+ estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
124
128
  } & {
125
129
  readonly blockType: "staticBlocks" | "dynamicBlocks";
126
130
  readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
127
131
  } & {
128
- readonly maxViewBpPerPx: any;
129
132
  readonly renderDelay: number;
130
133
  readonly TooltipComponent: import("react").FC<any>;
131
134
  readonly selectedFeatureId: string | undefined;
@@ -136,14 +139,28 @@ export default function (configSchema: LinearVariantDisplayConfigModel): import(
136
139
  getFeatureOverlapping(blockKey: string, x: number, y: number): any;
137
140
  getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
138
141
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
142
+ readonly currentBytesRequested: number;
143
+ readonly currentFeatureScreenDensity: number;
144
+ readonly maxFeatureScreenDensity: any;
145
+ readonly estimatedStatsReady: boolean;
146
+ readonly maxAllowableBytes: number;
139
147
  } & {
148
+ setMessage(message: string): void;
140
149
  afterAttach(): void;
150
+ estimateRegionsStats(regions: import("@jbrowse/core/util").Region[], opts: {
151
+ headers?: Record<string, string> | undefined;
152
+ signal?: AbortSignal | undefined;
153
+ filters?: string[] | undefined;
154
+ }): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats>;
155
+ setRegionStatsP(p?: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined): void;
156
+ setRegionStats(estimatedRegionStats?: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined): void;
157
+ clearRegionStats(): void;
141
158
  setHeight(displayHeight: number): number;
142
159
  resizeHeight(distance: number): number;
143
160
  setScrollTop(scrollTop: number): void;
144
- setUserBpPerPxLimit(limit: number): void;
145
- setMessage(message: string): void;
161
+ updateStatsLimit(stats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats): void;
146
162
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
163
+ setCurrBpPerPx(n: number): void;
147
164
  deleteBlock(key: string): void;
148
165
  selectFeature(feature: Feature): void;
149
166
  clearFeatureSelection(): void;
@@ -151,7 +168,13 @@ export default function (configSchema: LinearVariantDisplayConfigModel): import(
151
168
  reload(): void;
152
169
  setContextMenuFeature(feature?: Feature | undefined): void;
153
170
  } & {
154
- regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Zoom in to see features";
171
+ readonly regionTooLarge: boolean;
172
+ readonly regionTooLargeReason: string;
173
+ } & {
174
+ reload(): Promise<void>;
175
+ afterAttach(): void;
176
+ } & {
177
+ regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
155
178
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): JSX.Element | undefined;
156
179
  trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
157
180
  contextMenuItems(): {
@@ -161,7 +184,7 @@ export default function (configSchema: LinearVariantDisplayConfigModel): import(
161
184
  }[];
162
185
  renderProps(): any;
163
186
  } & {
164
- renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").ExportSvgOptions & {
187
+ renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/dist/LinearGenomeView").ExportSvgOptions & {
165
188
  overrideHeight: number;
166
189
  }): Promise<JSX.Element>;
167
190
  } & {
@@ -2,18 +2,15 @@ import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters
2
2
  import { NoAssemblyRegion, Region } from '@jbrowse/core/util/types';
3
3
  import { Feature } from '@jbrowse/core/util/simpleFeature';
4
4
  import { TabixIndexedFile } from '@gmod/tabix';
5
- import { GenericFilehandle } from 'generic-filehandle';
6
5
  import VcfParser from '@gmod/vcf';
6
+ import { GenericFilehandle } from 'generic-filehandle';
7
7
  export default class extends BaseFeatureDataAdapter {
8
- protected configured?: Promise<{
9
- vcf: TabixIndexedFile;
10
- parser: VcfParser;
11
- filehandle: GenericFilehandle;
12
- }>;
8
+ private configured?;
9
+ private configurePre;
13
10
  protected configure(): Promise<{
11
+ filehandle: GenericFilehandle;
14
12
  vcf: TabixIndexedFile;
15
13
  parser: VcfParser;
16
- filehandle: GenericFilehandle;
17
14
  }>;
18
15
  getRefNames(opts?: BaseOptions): Promise<any>;
19
16
  getHeader(): Promise<string>;
@@ -34,11 +31,5 @@ export default class extends BaseFeatureDataAdapter {
34
31
  * @returns Observable of Feature objects in the regions
35
32
  */
36
33
  getFeaturesInMultipleRegions(regions: Region[], opts?: BaseOptions): import("rxjs").Observable<Feature>;
37
- /**
38
- * get the approximate number of bytes queried from the file for the given
39
- * query regions
40
- * @param regions - list of query regions
41
- */
42
- private bytesForRegions;
43
34
  freeResources(): void;
44
35
  }
@@ -144,14 +144,14 @@ function _inherits(subClass, superClass) {
144
144
  throw new TypeError("Super expression must either be null or a function");
145
145
  }
146
146
 
147
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
148
+ constructor: {
149
+ value: subClass,
150
+ writable: true,
151
+ configurable: true
152
+ }
153
+ });
147
154
  Object.defineProperty(subClass, "prototype", {
148
- value: Object.create(superClass && superClass.prototype, {
149
- constructor: {
150
- value: subClass,
151
- writable: true,
152
- configurable: true
153
- }
154
- }),
155
155
  writable: false
156
156
  });
157
157
  if (superClass) _setPrototypeOf(subClass, superClass);
@@ -1826,16 +1826,19 @@ var VariantsPlugin = /*#__PURE__*/function (_Plugin) {
1826
1826
  var adapterName = 'VcfTabixAdapter';
1827
1827
  var fileName = tracks.getFileName(file);
1828
1828
  var indexName = index && tracks.getFileName(index);
1829
+ var obj = {
1830
+ type: adapterName,
1831
+ vcfGzLocation: file,
1832
+ index: {
1833
+ location: index || tracks.makeIndex(file, '.tbi'),
1834
+ indexType: tracks.makeIndexType(indexName, 'CSI', 'TBI')
1835
+ }
1836
+ };
1829
1837
 
1830
- if (regexGuess.test(fileName) || adapterHint === adapterName) {
1831
- return {
1832
- type: adapterName,
1833
- vcfGzLocation: file,
1834
- index: {
1835
- location: index || tracks.makeIndex(file, '.tbi'),
1836
- indexType: tracks.makeIndexType(indexName, 'CSI', 'TBI')
1837
- }
1838
- };
1838
+ if (regexGuess.test(fileName) && !adapterHint) {
1839
+ return obj;
1840
+ } else if (adapterHint === adapterName) {
1841
+ return obj;
1839
1842
  }
1840
1843
 
1841
1844
  return adapterGuesser(file, index, adapterHint);
@@ -1933,51 +1936,78 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
1933
1936
  }
1934
1937
 
1935
1938
  _createClass(_default, [{
1939
+ key: "configurePre",
1940
+ value: function () {
1941
+ var _configurePre = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1942
+ var vcfGzLocation, location, indexType, filehandle, isCSI, vcf, header;
1943
+ return runtime_1.wrap(function _callee$(_context) {
1944
+ while (1) {
1945
+ switch (_context.prev = _context.next) {
1946
+ case 0:
1947
+ vcfGzLocation = configuration.readConfObject(this.config, 'vcfGzLocation');
1948
+ location = configuration.readConfObject(this.config, ['index', 'location']);
1949
+ indexType = configuration.readConfObject(this.config, ['index', 'indexType']);
1950
+ filehandle = io.openLocation(vcfGzLocation, this.pluginManager);
1951
+ isCSI = indexType === 'CSI';
1952
+ vcf = new tabix.TabixIndexedFile({
1953
+ filehandle: filehandle,
1954
+ csiFilehandle: isCSI ? io.openLocation(location, this.pluginManager) : undefined,
1955
+ tbiFilehandle: !isCSI ? io.openLocation(location, this.pluginManager) : undefined,
1956
+ chunkCacheSize: 50 * Math.pow(2, 20),
1957
+ chunkSizeLimit: 1000000000
1958
+ });
1959
+ _context.next = 8;
1960
+ return vcf.getHeader();
1961
+
1962
+ case 8:
1963
+ header = _context.sent;
1964
+ return _context.abrupt("return", {
1965
+ filehandle: filehandle,
1966
+ vcf: vcf,
1967
+ parser: new VCF__default({
1968
+ header: header
1969
+ })
1970
+ });
1971
+
1972
+ case 10:
1973
+ case "end":
1974
+ return _context.stop();
1975
+ }
1976
+ }
1977
+ }, _callee, this);
1978
+ }));
1979
+
1980
+ function configurePre() {
1981
+ return _configurePre.apply(this, arguments);
1982
+ }
1983
+
1984
+ return configurePre;
1985
+ }()
1986
+ }, {
1936
1987
  key: "configure",
1937
1988
  value: function () {
1938
- var _configure = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1989
+ var _configure = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
1939
1990
  var _this = this;
1940
1991
 
1941
- var vcfGzLocation, location, indexType, filehandle, isCSI, vcf;
1942
- return runtime_1.wrap(function _callee$(_context) {
1992
+ return runtime_1.wrap(function _callee2$(_context2) {
1943
1993
  while (1) {
1944
- switch (_context.prev = _context.next) {
1994
+ switch (_context2.prev = _context2.next) {
1945
1995
  case 0:
1946
1996
  if (!this.configured) {
1947
- vcfGzLocation = configuration.readConfObject(this.config, 'vcfGzLocation');
1948
- location = configuration.readConfObject(this.config, ['index', 'location']);
1949
- indexType = configuration.readConfObject(this.config, ['index', 'indexType']);
1950
- filehandle = io.openLocation(vcfGzLocation, this.pluginManager);
1951
- isCSI = indexType === 'CSI';
1952
- vcf = new tabix.TabixIndexedFile({
1953
- filehandle: filehandle,
1954
- csiFilehandle: isCSI ? io.openLocation(location, this.pluginManager) : undefined,
1955
- tbiFilehandle: !isCSI ? io.openLocation(location, this.pluginManager) : undefined,
1956
- chunkCacheSize: 50 * Math.pow(2, 20),
1957
- chunkSizeLimit: 1000000000
1958
- });
1959
- this.configured = vcf.getHeader().then(function (header) {
1960
- return {
1961
- filehandle: filehandle,
1962
- vcf: vcf,
1963
- parser: new VCF__default({
1964
- header: header
1965
- })
1966
- };
1967
- })["catch"](function (e) {
1997
+ this.configured = this.configurePre()["catch"](function (e) {
1968
1998
  _this.configured = undefined;
1969
1999
  throw e;
1970
2000
  });
1971
2001
  }
1972
2002
 
1973
- return _context.abrupt("return", this.configured);
2003
+ return _context2.abrupt("return", this.configured);
1974
2004
 
1975
2005
  case 2:
1976
2006
  case "end":
1977
- return _context.stop();
2007
+ return _context2.stop();
1978
2008
  }
1979
2009
  }
1980
- }, _callee, this);
2010
+ }, _callee2, this);
1981
2011
  }));
1982
2012
 
1983
2013
  function configure() {
@@ -1989,31 +2019,31 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
1989
2019
  }, {
1990
2020
  key: "getRefNames",
1991
2021
  value: function () {
1992
- var _getRefNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
2022
+ var _getRefNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
1993
2023
  var opts,
1994
2024
  _yield$this$configure,
1995
2025
  vcf,
1996
- _args2 = arguments;
2026
+ _args3 = arguments;
1997
2027
 
1998
- return runtime_1.wrap(function _callee2$(_context2) {
2028
+ return runtime_1.wrap(function _callee3$(_context3) {
1999
2029
  while (1) {
2000
- switch (_context2.prev = _context2.next) {
2030
+ switch (_context3.prev = _context3.next) {
2001
2031
  case 0:
2002
- opts = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
2003
- _context2.next = 3;
2032
+ opts = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
2033
+ _context3.next = 3;
2004
2034
  return this.configure();
2005
2035
 
2006
2036
  case 3:
2007
- _yield$this$configure = _context2.sent;
2037
+ _yield$this$configure = _context3.sent;
2008
2038
  vcf = _yield$this$configure.vcf;
2009
- return _context2.abrupt("return", vcf.getReferenceSequenceNames(opts));
2039
+ return _context3.abrupt("return", vcf.getReferenceSequenceNames(opts));
2010
2040
 
2011
2041
  case 6:
2012
2042
  case "end":
2013
- return _context2.stop();
2043
+ return _context3.stop();
2014
2044
  }
2015
2045
  }
2016
- }, _callee2, this);
2046
+ }, _callee3, this);
2017
2047
  }));
2018
2048
 
2019
2049
  function getRefNames() {
@@ -2025,27 +2055,27 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2025
2055
  }, {
2026
2056
  key: "getHeader",
2027
2057
  value: function () {
2028
- var _getHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
2058
+ var _getHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2029
2059
  var _yield$this$configure2, vcf;
2030
2060
 
2031
- return runtime_1.wrap(function _callee3$(_context3) {
2061
+ return runtime_1.wrap(function _callee4$(_context4) {
2032
2062
  while (1) {
2033
- switch (_context3.prev = _context3.next) {
2063
+ switch (_context4.prev = _context4.next) {
2034
2064
  case 0:
2035
- _context3.next = 2;
2065
+ _context4.next = 2;
2036
2066
  return this.configure();
2037
2067
 
2038
2068
  case 2:
2039
- _yield$this$configure2 = _context3.sent;
2069
+ _yield$this$configure2 = _context4.sent;
2040
2070
  vcf = _yield$this$configure2.vcf;
2041
- return _context3.abrupt("return", vcf.getHeader());
2071
+ return _context4.abrupt("return", vcf.getHeader());
2042
2072
 
2043
2073
  case 5:
2044
2074
  case "end":
2045
- return _context3.stop();
2075
+ return _context4.stop();
2046
2076
  }
2047
2077
  }
2048
- }, _callee3, this);
2078
+ }, _callee4, this);
2049
2079
  }));
2050
2080
 
2051
2081
  function getHeader() {
@@ -2057,27 +2087,27 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2057
2087
  }, {
2058
2088
  key: "getMetadata",
2059
2089
  value: function () {
2060
- var _getMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2090
+ var _getMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
2061
2091
  var _yield$this$configure3, parser;
2062
2092
 
2063
- return runtime_1.wrap(function _callee4$(_context4) {
2093
+ return runtime_1.wrap(function _callee5$(_context5) {
2064
2094
  while (1) {
2065
- switch (_context4.prev = _context4.next) {
2095
+ switch (_context5.prev = _context5.next) {
2066
2096
  case 0:
2067
- _context4.next = 2;
2097
+ _context5.next = 2;
2068
2098
  return this.configure();
2069
2099
 
2070
2100
  case 2:
2071
- _yield$this$configure3 = _context4.sent;
2101
+ _yield$this$configure3 = _context5.sent;
2072
2102
  parser = _yield$this$configure3.parser;
2073
- return _context4.abrupt("return", parser.getMetadata());
2103
+ return _context5.abrupt("return", parser.getMetadata());
2074
2104
 
2075
2105
  case 5:
2076
2106
  case "end":
2077
- return _context4.stop();
2107
+ return _context5.stop();
2078
2108
  }
2079
2109
  }
2080
- }, _callee4, this);
2110
+ }, _callee5, this);
2081
2111
  }));
2082
2112
 
2083
2113
  function getMetadata() {
@@ -2093,22 +2123,22 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2093
2123
 
2094
2124
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2095
2125
  return rxjs.ObservableCreate( /*#__PURE__*/function () {
2096
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(observer) {
2126
+ var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(observer) {
2097
2127
  var refName, start, end, _yield$_this2$configu, vcf, parser;
2098
2128
 
2099
- return runtime_1.wrap(function _callee5$(_context5) {
2129
+ return runtime_1.wrap(function _callee6$(_context6) {
2100
2130
  while (1) {
2101
- switch (_context5.prev = _context5.next) {
2131
+ switch (_context6.prev = _context6.next) {
2102
2132
  case 0:
2103
2133
  refName = query.refName, start = query.start, end = query.end;
2104
- _context5.next = 3;
2134
+ _context6.next = 3;
2105
2135
  return _this2.configure();
2106
2136
 
2107
2137
  case 3:
2108
- _yield$_this2$configu = _context5.sent;
2138
+ _yield$_this2$configu = _context6.sent;
2109
2139
  vcf = _yield$_this2$configu.vcf;
2110
2140
  parser = _yield$_this2$configu.parser;
2111
- _context5.next = 8;
2141
+ _context6.next = 8;
2112
2142
  return vcf.getLines(refName, start, end, _objectSpread2({
2113
2143
  lineCallback: function lineCallback(line, fileOffset) {
2114
2144
  observer.next(new VCFFeature({
@@ -2124,10 +2154,10 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2124
2154
 
2125
2155
  case 9:
2126
2156
  case "end":
2127
- return _context5.stop();
2157
+ return _context6.stop();
2128
2158
  }
2129
2159
  }
2130
- }, _callee5);
2160
+ }, _callee6);
2131
2161
  }));
2132
2162
 
2133
2163
  return function (_x) {
@@ -2162,29 +2192,35 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2162
2192
  var superGetFeaturesInMultipleRegions = _get(_getPrototypeOf(_default.prototype), "getFeaturesInMultipleRegions", this);
2163
2193
 
2164
2194
  return rxjs.ObservableCreate( /*#__PURE__*/function () {
2165
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(observer) {
2166
- var bytes, _yield$_this3$configu, filehandle, stat, pct;
2195
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(observer) {
2196
+ var _yield$_this3$configu, vcf, bytes, _yield$_this3$configu2, filehandle, stat, pct;
2167
2197
 
2168
- return runtime_1.wrap(function _callee6$(_context6) {
2198
+ return runtime_1.wrap(function _callee7$(_context7) {
2169
2199
  while (1) {
2170
- switch (_context6.prev = _context6.next) {
2200
+ switch (_context7.prev = _context7.next) {
2171
2201
  case 0:
2172
- _context6.next = 2;
2173
- return _this3.bytesForRegions(regions);
2202
+ _context7.next = 2;
2203
+ return _this3.configure();
2174
2204
 
2175
2205
  case 2:
2176
- bytes = _context6.sent;
2177
- _context6.next = 5;
2206
+ _yield$_this3$configu = _context7.sent;
2207
+ vcf = _yield$_this3$configu.vcf;
2208
+ _context7.next = 6;
2209
+ return util.bytesForRegions(regions, vcf.index);
2210
+
2211
+ case 6:
2212
+ bytes = _context7.sent;
2213
+ _context7.next = 9;
2178
2214
  return _this3.configure();
2179
2215
 
2180
- case 5:
2181
- _yield$_this3$configu = _context6.sent;
2182
- filehandle = _yield$_this3$configu.filehandle;
2183
- _context6.next = 9;
2216
+ case 9:
2217
+ _yield$_this3$configu2 = _context7.sent;
2218
+ filehandle = _yield$_this3$configu2.filehandle;
2219
+ _context7.next = 13;
2184
2220
  return filehandle.stat();
2185
2221
 
2186
- case 9:
2187
- stat = _context6.sent;
2222
+ case 13:
2223
+ stat = _context7.sent;
2188
2224
  pct = Math.round(bytes / stat.size * 100);
2189
2225
 
2190
2226
  if (pct > 100) {
@@ -2198,12 +2234,12 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2198
2234
 
2199
2235
  superGetFeaturesInMultipleRegions.call(_this3, regions, opts).subscribe(observer); // super.getFeaturesInMultipleRegions(regions, opts).subscribe(observer)
2200
2236
 
2201
- case 14:
2237
+ case 18:
2202
2238
  case "end":
2203
- return _context6.stop();
2239
+ return _context7.stop();
2204
2240
  }
2205
2241
  }
2206
- }, _callee6);
2242
+ }, _callee7);
2207
2243
  }));
2208
2244
 
2209
2245
  return function (_x2) {
@@ -2211,77 +2247,6 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2211
2247
  };
2212
2248
  }());
2213
2249
  }
2214
- /**
2215
- * get the approximate number of bytes queried from the file for the given
2216
- * query regions
2217
- * @param regions - list of query regions
2218
- */
2219
-
2220
- }, {
2221
- key: "bytesForRegions",
2222
- value: function () {
2223
- var _bytesForRegions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(regions) {
2224
- var _yield$this$configure4, vcf, blockResults, byteRanges;
2225
-
2226
- return runtime_1.wrap(function _callee7$(_context7) {
2227
- while (1) {
2228
- switch (_context7.prev = _context7.next) {
2229
- case 0:
2230
- _context7.next = 2;
2231
- return this.configure();
2232
-
2233
- case 2:
2234
- _yield$this$configure4 = _context7.sent;
2235
- vcf = _yield$this$configure4.vcf;
2236
- _context7.next = 6;
2237
- return Promise.all(regions.map(function (region) {
2238
- return (// @ts-ignore
2239
- vcf.index.blocksForRange(region.refName, region.start, region.end)
2240
- );
2241
- }));
2242
-
2243
- case 6:
2244
- blockResults = _context7.sent;
2245
- byteRanges = [];
2246
- blockResults.forEach(function (blocks) {
2247
- blocks.forEach(function (block) {
2248
- var start = block.minv.blockPosition;
2249
- var end = block.maxv.blockPosition + 64000;
2250
-
2251
- if (!byteRanges.find(function (range) {
2252
- if (range.start <= end && range.end >= start) {
2253
- range.start = Math.min(range.start, start);
2254
- range.end = Math.max(range.end, end);
2255
- return true;
2256
- }
2257
-
2258
- return false;
2259
- })) {
2260
- byteRanges.push({
2261
- start: start,
2262
- end: end
2263
- });
2264
- }
2265
- });
2266
- });
2267
- return _context7.abrupt("return", byteRanges.reduce(function (a, b) {
2268
- return a + b.end - b.start + 1;
2269
- }, 0));
2270
-
2271
- case 10:
2272
- case "end":
2273
- return _context7.stop();
2274
- }
2275
- }
2276
- }, _callee7, this);
2277
- }));
2278
-
2279
- function bytesForRegions(_x3) {
2280
- return _bytesForRegions.apply(this, arguments);
2281
- }
2282
-
2283
- return bytesForRegions;
2284
- }()
2285
2250
  }, {
2286
2251
  key: "freeResources",
2287
2252
  value: function