@jbrowse/text-indexing 2.6.2 → 2.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.
@@ -11,16 +11,15 @@ const gff3Adapter_1 = require("./types/gff3Adapter");
11
11
  const vcfAdapter_1 = require("./types/vcfAdapter");
12
12
  const common_1 = require("./types/common");
13
13
  const ixixx_1 = require("ixixx");
14
- const util_1 = require("./util");
15
- const util_2 = require("@jbrowse/core/util");
14
+ const util_1 = require("@jbrowse/core/util");
16
15
  async function indexTracks(args) {
17
16
  const { tracks, outLocation, attributes, exclude, assemblies, indexType, statusCallback, signal, } = args;
18
17
  const idxType = indexType || 'perTrack';
19
- (0, util_2.checkAbortSignal)(signal);
18
+ (0, util_1.checkAbortSignal)(signal);
20
19
  await (idxType === 'perTrack'
21
20
  ? perTrackIndex(tracks, statusCallback, outLocation, attributes, exclude, signal)
22
21
  : aggregateIndex(tracks, statusCallback, outLocation, attributes, assemblies, exclude, signal));
23
- (0, util_2.checkAbortSignal)(signal);
22
+ (0, util_1.checkAbortSignal)(signal);
24
23
  return [];
25
24
  }
26
25
  exports.indexTracks = indexTracks;
@@ -37,7 +36,7 @@ async function perTrackIndex(tracks, statusCallback, outLocation, attributes, ex
37
36
  const attrs = attributes || ['Name', 'ID'];
38
37
  const excludeTypes = exclude || ['exon', 'CDS'];
39
38
  const force = true;
40
- const supportedTracks = tracks.filter(track => { var _a; return (0, util_1.supportedIndexingAdapters)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
39
+ const supportedTracks = tracks.filter(track => { var _a; return (0, util_1.isSupportedIndexingAdapter)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
41
40
  for (const trackConfig of supportedTracks) {
42
41
  const { textSearching, trackId, assemblyNames } = trackConfig;
43
42
  const id = `${trackId}-index`;
@@ -70,7 +69,7 @@ async function aggregateIndex(tracks, statusCallback, outLocation, attributes, a
70
69
  const quiet = true;
71
70
  // supported tracks for given assembly
72
71
  const supportedTracks = tracks
73
- .filter(track => { var _a; return (0, util_1.supportedIndexingAdapters)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); })
72
+ .filter(track => { var _a; return (0, util_1.isSupportedIndexingAdapter)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); })
74
73
  .filter(track => (asm ? track.assemblyNames.includes(asm) : true));
75
74
  await indexDriver(supportedTracks, outDir, attrs, id, quiet, excludeTypes, [asm], statusCallback, signal);
76
75
  }
@@ -80,7 +79,7 @@ async function indexDriver(tracks, idxLocation, attributes, name, quiet, exclude
80
79
  statusCallback('Indexing files.');
81
80
  try {
82
81
  const ixIxxStream = await runIxIxx(readable, idxLocation, name);
83
- (0, util_2.checkAbortSignal)(signal);
82
+ (0, util_1.checkAbortSignal)(signal);
84
83
  await (0, common_1.generateMeta)({
85
84
  configs: tracks,
86
85
  attributes,
@@ -89,7 +88,7 @@ async function indexDriver(tracks, idxLocation, attributes, name, quiet, exclude
89
88
  exclude,
90
89
  assemblyNames,
91
90
  });
92
- (0, util_2.checkAbortSignal)(signal);
91
+ (0, util_1.checkAbortSignal)(signal);
93
92
  return ixIxxStream;
94
93
  }
95
94
  catch (e) {
@@ -49,8 +49,7 @@ async function* indexVcf(config, attributesToIndex, inLocation, outLocation, typ
49
49
  .map(attr => fields[attr])
50
50
  .filter((f) => !!f);
51
51
  const ids = id.split(',');
52
- for (let i = 0; i < ids.length; i++) {
53
- const id = ids[i];
52
+ for (const id of ids) {
54
53
  const attrs = [id];
55
54
  const record = JSON.stringify([
56
55
  encodeURIComponent(locStr),
package/dist/util.d.ts CHANGED
@@ -70,9 +70,7 @@ export interface VcfAdapter {
70
70
  type: 'VcfAdapter';
71
71
  vcfLocation: UriLocation | LocalPathLocation;
72
72
  }
73
- export interface Track {
74
- [key: string]: any;
75
- }
73
+ export type Track = Record<string, any>;
76
74
  export interface TextSearching {
77
75
  indexingFeatureTypesToExclude?: string[];
78
76
  indexingAttributes?: string[];
@@ -96,7 +94,6 @@ export interface Config {
96
94
  tracks?: Track[];
97
95
  }
98
96
  export type indexType = 'aggregate' | 'perTrack';
99
- export declare function supportedIndexingAdapters(type: string): boolean;
100
97
  export declare function createTextSearchConf(name: string, trackIds: string[], assemblyNames: string[], locationPath: string): {
101
98
  type: string;
102
99
  textSearchAdapterId: string;
package/dist/util.js CHANGED
@@ -1,17 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findTrackConfigsToIndex = exports.createTextSearchConf = exports.supportedIndexingAdapters = void 0;
4
- // supported adapter types by text indexer
5
- // ensure that this matches the method found in @jbrowse/core/util
6
- function supportedIndexingAdapters(type) {
7
- return [
8
- 'Gff3TabixAdapter',
9
- 'VcfTabixAdapter',
10
- 'Gff3Adapter',
11
- 'VcfAdapter',
12
- ].includes(type);
13
- }
14
- exports.supportedIndexingAdapters = supportedIndexingAdapters;
3
+ exports.findTrackConfigsToIndex = exports.createTextSearchConf = void 0;
4
+ const util_1 = require("@jbrowse/core/util");
15
5
  function createTextSearchConf(name, trackIds, assemblyNames, locationPath) {
16
6
  // const locationPath = self.sessionPath.substring(
17
7
  // 0,
@@ -47,6 +37,6 @@ function findTrackConfigsToIndex(tracks, trackIds, assemblyName) {
47
37
  return currentTrack;
48
38
  })
49
39
  .filter(track => assemblyName ? track.assemblyNames.includes(assemblyName) : true)
50
- .filter(track => supportedIndexingAdapters(track.adapter.type));
40
+ .filter(track => { var _a; return (0, util_1.isSupportedIndexingAdapter)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
51
41
  }
52
42
  exports.findTrackConfigsToIndex = findTrackConfigsToIndex;
@@ -5,8 +5,7 @@ import { indexGff3 } from './types/gff3Adapter';
5
5
  import { indexVcf } from './types/vcfAdapter';
6
6
  import { generateMeta } from './types/common';
7
7
  import { ixIxxStream } from 'ixixx';
8
- import { supportedIndexingAdapters } from './util';
9
- import { checkAbortSignal } from '@jbrowse/core/util';
8
+ import { checkAbortSignal, isSupportedIndexingAdapter, } from '@jbrowse/core/util';
10
9
  export async function indexTracks(args) {
11
10
  const { tracks, outLocation, attributes, exclude, assemblies, indexType, statusCallback, signal, } = args;
12
11
  const idxType = indexType || 'perTrack';
@@ -30,7 +29,7 @@ async function perTrackIndex(tracks, statusCallback, outLocation, attributes, ex
30
29
  const attrs = attributes || ['Name', 'ID'];
31
30
  const excludeTypes = exclude || ['exon', 'CDS'];
32
31
  const force = true;
33
- const supportedTracks = tracks.filter(track => { var _a; return supportedIndexingAdapters((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
32
+ const supportedTracks = tracks.filter(track => { var _a; return isSupportedIndexingAdapter((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
34
33
  for (const trackConfig of supportedTracks) {
35
34
  const { textSearching, trackId, assemblyNames } = trackConfig;
36
35
  const id = `${trackId}-index`;
@@ -63,7 +62,7 @@ async function aggregateIndex(tracks, statusCallback, outLocation, attributes, a
63
62
  const quiet = true;
64
63
  // supported tracks for given assembly
65
64
  const supportedTracks = tracks
66
- .filter(track => { var _a; return supportedIndexingAdapters((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); })
65
+ .filter(track => { var _a; return isSupportedIndexingAdapter((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); })
67
66
  .filter(track => (asm ? track.assemblyNames.includes(asm) : true));
68
67
  await indexDriver(supportedTracks, outDir, attrs, id, quiet, excludeTypes, [asm], statusCallback, signal);
69
68
  }
@@ -43,8 +43,7 @@ export async function* indexVcf(config, attributesToIndex, inLocation, outLocati
43
43
  .map(attr => fields[attr])
44
44
  .filter((f) => !!f);
45
45
  const ids = id.split(',');
46
- for (let i = 0; i < ids.length; i++) {
47
- const id = ids[i];
46
+ for (const id of ids) {
48
47
  const attrs = [id];
49
48
  const record = JSON.stringify([
50
49
  encodeURIComponent(locStr),
package/esm/util.d.ts CHANGED
@@ -70,9 +70,7 @@ export interface VcfAdapter {
70
70
  type: 'VcfAdapter';
71
71
  vcfLocation: UriLocation | LocalPathLocation;
72
72
  }
73
- export interface Track {
74
- [key: string]: any;
75
- }
73
+ export type Track = Record<string, any>;
76
74
  export interface TextSearching {
77
75
  indexingFeatureTypesToExclude?: string[];
78
76
  indexingAttributes?: string[];
@@ -96,7 +94,6 @@ export interface Config {
96
94
  tracks?: Track[];
97
95
  }
98
96
  export type indexType = 'aggregate' | 'perTrack';
99
- export declare function supportedIndexingAdapters(type: string): boolean;
100
97
  export declare function createTextSearchConf(name: string, trackIds: string[], assemblyNames: string[], locationPath: string): {
101
98
  type: string;
102
99
  textSearchAdapterId: string;
package/esm/util.js CHANGED
@@ -1,13 +1,4 @@
1
- // supported adapter types by text indexer
2
- // ensure that this matches the method found in @jbrowse/core/util
3
- export function supportedIndexingAdapters(type) {
4
- return [
5
- 'Gff3TabixAdapter',
6
- 'VcfTabixAdapter',
7
- 'Gff3Adapter',
8
- 'VcfAdapter',
9
- ].includes(type);
10
- }
1
+ import { isSupportedIndexingAdapter } from '@jbrowse/core/util';
11
2
  export function createTextSearchConf(name, trackIds, assemblyNames, locationPath) {
12
3
  // const locationPath = self.sessionPath.substring(
13
4
  // 0,
@@ -42,5 +33,5 @@ export function findTrackConfigsToIndex(tracks, trackIds, assemblyName) {
42
33
  return currentTrack;
43
34
  })
44
35
  .filter(track => assemblyName ? track.assemblyNames.includes(assemblyName) : true)
45
- .filter(track => supportedIndexingAdapters(track.adapter.type));
36
+ .filter(track => { var _a; return isSupportedIndexingAdapter((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
46
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/text-indexing",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "description": "JBrowse 2 text indexing for desktop",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -47,14 +47,14 @@
47
47
  },
48
48
  "peerDependencies": {
49
49
  "mobx": "^6.0.0",
50
- "mobx-react": "^7.0.0",
50
+ "mobx-react": "^9.0.0",
51
51
  "mobx-state-tree": "^5.0.0",
52
- "react": "^17.0.0",
53
- "react-dom": "^17.0.0",
52
+ "react": ">=16.8.0",
53
+ "react-dom": ">=16.8.0",
54
54
  "rxjs": "^7.0.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "bbea587a402d9974acdd804a33f4b77f31a2fd5f"
59
+ "gitHead": "dbe7fb1af01fc89f833d2744635eb44a17365b41"
60
60
  }