@jbrowse/plugin-bed 5.0.0-beta.10 → 5.0.0-beta.13

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.
@@ -14,9 +14,9 @@ export default class BedGraphTabixAdapter extends BaseFeatureDataAdapter {
14
14
  // getFeatures/byte-estimate awaits it) doesn't re-flash "Downloading index"
15
15
  configure = cachedSetup({
16
16
  label: 'Downloading index',
17
- setup: () => this.configurePre(),
17
+ setup: opts => this.configurePre(opts),
18
18
  });
19
- async configurePre() {
19
+ async configurePre(opts) {
20
20
  const pm = this.pluginManager;
21
21
  const bedGraphGzLocation = this.getConf('bedGraphGzLocation');
22
22
  const location = this.getConf(['index', 'location']);
@@ -31,7 +31,7 @@ export default class BedGraphTabixAdapter extends BaseFeatureDataAdapter {
31
31
  // Not bedGraph.getHeader(): that returns only a `#`-commented header, so a
32
32
  // file whose header is a plain row skipped via `tabix -S 1` reported none
33
33
  // and quietly lost the names of its value columns.
34
- const header = (await readTabixHeaderLines(bedGraph)).join('\n');
34
+ const header = (await readTabixHeaderLines(bedGraph, { signal: opts.signal })).join('\n');
35
35
  return {
36
36
  columnNames,
37
37
  bedGraph,
@@ -26,14 +26,14 @@ export default class BedTabixAdapter extends BaseFeatureDataAdapter {
26
26
  // re-entry (every getFeatures awaits it) doesn't re-flash "Downloading index"
27
27
  getMetadata = cachedSetup({
28
28
  label: 'Downloading index',
29
- setup: () => this.bed.getMetadata(),
29
+ setup: opts => this.bed.getMetadata({ signal: opts.signal }),
30
30
  });
31
31
  // Memoized: getFeatures needs the names on every query, and reading them goes
32
32
  // to the file's leading blocks — a fetch and a decompress that was being
33
33
  // repeated on every pan and zoom. Resolves undefined when the file declares
34
34
  // no column names — parseNamesFromHeader's answer for a header it can't read
35
35
  // names out of.
36
- getNames = cachedSetup({ setup: () => this.readNames() });
36
+ getNames = cachedSetup({ setup: opts => this.readNames(opts.signal) });
37
37
  constructor(config, getSubAdapter, pluginManager) {
38
38
  super(config, getSubAdapter, pluginManager);
39
39
  this.bedGzLoc = readConfObject(this.config, 'bedGzLocation');
@@ -61,7 +61,7 @@ export default class BedTabixAdapter extends BaseFeatureDataAdapter {
61
61
  async getRegionByteSize(regions, opts) {
62
62
  return this.bed.bytesForRegions(regions, opts);
63
63
  }
64
- async readNames() {
64
+ async readNames(signal) {
65
65
  const columnNames = readConfObject(this.config, 'columnNames');
66
66
  if (columnNames.length) {
67
67
  return columnNames;
@@ -69,7 +69,7 @@ export default class BedTabixAdapter extends BaseFeatureDataAdapter {
69
69
  // readTabixHeaderLines covers both ways a tabix file keeps a header: a
70
70
  // `#`-commented block, which getHeader() returns, and a plain row skipped
71
71
  // via `tabix -S N`, which it does not.
72
- return parseNamesFromHeader((await readTabixHeaderLines(this.bed)).join('\n'));
72
+ return parseNamesFromHeader((await readTabixHeaderLines(this.bed, { signal })).join('\n'));
73
73
  }
74
74
  getFeatures(query, opts) {
75
75
  const { signal, statusCallback } = opts ?? {};
@@ -10,13 +10,6 @@ import { openLocation } from '@jbrowse/core/util/io';
10
10
  const MAX_EXACT_NAMES = 50;
11
11
  const MAX_PREFIX_NAMES = 50;
12
12
  const MAX_TRIX_HITS = 500;
13
- function isSet(location) {
14
- return 'uri' in location
15
- ? !!location.uri
16
- : 'localPath' in location
17
- ? !!location.localPath
18
- : true;
19
- }
20
13
  // the column that matched is the name the hit goes by: a gene symbol for a
21
14
  // search by symbol, the accession for a search by accession
22
15
  function hitFor({ refName, start, end, rest = '', }, word) {
@@ -69,7 +62,7 @@ export default class BigBedTextSearchAdapter extends BaseAdapter {
69
62
  });
70
63
  const ix = this.getConf('ixFilePath');
71
64
  const ixx = this.getConf('ixxFilePath');
72
- if (isSet(ix) && isSet(ixx)) {
65
+ if (ix && ixx) {
73
66
  this.trix = new Trix(openLocation(ixx, pluginManager), openLocation(ix, pluginManager), MAX_TRIX_HITS);
74
67
  }
75
68
  }
@@ -31,14 +31,10 @@ declare const BigBedTextSearchAdapter: import("@jbrowse/core/configuration/confi
31
31
  defaultValue: unknown;
32
32
  };
33
33
  readonly ixFilePath: {
34
- type: "fileLocation";
35
- } & {
36
- defaultValue: unknown;
34
+ type: "maybeFileLocation";
37
35
  };
38
36
  readonly ixxFilePath: {
39
- type: "fileLocation";
40
- } & {
41
- defaultValue: unknown;
37
+ type: "maybeFileLocation";
42
38
  };
43
39
  readonly assemblyNames: {
44
40
  type: "stringArray";
@@ -34,16 +34,14 @@ const BigBedTextSearchAdapter = ConfigurationSchema('BigBedTextSearchAdapter', {
34
34
  * indexes hold. Unset, a search matches a name exactly as typed
35
35
  */
36
36
  ixFilePath: {
37
- type: 'fileLocation',
38
- defaultValue: { uri: '', locationType: 'UriLocation' },
37
+ type: 'maybeFileLocation',
39
38
  },
40
39
  /**
41
40
  * #slot
42
41
  * the `.ixx` beside `ixFilePath`
43
42
  */
44
43
  ixxFilePath: {
45
- type: 'fileLocation',
46
- defaultValue: { uri: '', locationType: 'UriLocation' },
44
+ type: 'maybeFileLocation',
47
45
  },
48
46
  /**
49
47
  * #slot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-bed",
3
- "version": "5.0.0-beta.10",
3
+ "version": "5.0.0-beta.13",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 bed adapters, tracks, etc.",
6
6
  "keywords": [
@@ -23,12 +23,16 @@
23
23
  "dependencies": {
24
24
  "@gmod/bbi": "^11.3.0",
25
25
  "@gmod/bed": "^2.3.1",
26
- "@gmod/tabix": "^3.8.3",
26
+ "@gmod/tabix": "^3.9.1",
27
27
  "@gmod/trix": "^3.0.22",
28
- "@jbrowse/mobx-state-tree": "^6.6.1",
29
- "mobx": "^7.0.5",
28
+ "@jbrowse/mobx-state-tree": "^6.7.0",
29
+ "mobx": "^7.0.6",
30
30
  "rxjs": "^7.8.2",
31
- "@jbrowse/core": "^5.0.0-beta.10"
31
+ "@jbrowse/core": "^5.0.0-beta.13"
32
+ },
33
+ "peerDependencies": {
34
+ "react": ">=19.0.0",
35
+ "react-dom": ">=19.0.0"
32
36
  },
33
37
  "publishConfig": {
34
38
  "access": "public"