@jbrowse/text-indexing 2.10.3 → 2.11.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.
- package/dist/TextIndexing.js +12 -17
- package/dist/types/gff3Adapter.js +4 -3
- package/dist/types/vcfAdapter.js +6 -3
- package/dist/util.d.ts +1 -0
- package/dist/util.js +11 -1
- package/esm/TextIndexing.js +12 -17
- package/esm/types/gff3Adapter.js +2 -1
- package/esm/types/vcfAdapter.js +4 -1
- package/esm/util.d.ts +1 -0
- package/esm/util.js +9 -0
- package/package.json +2 -2
package/dist/TextIndexing.js
CHANGED
|
@@ -77,23 +77,18 @@ async function aggregateIndex(tracks, statusCallback, outLocation, attributes, a
|
|
|
77
77
|
async function indexDriver(tracks, idxLocation, attributes, name, quiet, exclude, assemblyNames, statusCallback, signal) {
|
|
78
78
|
const readable = stream_1.Readable.from(indexFiles(tracks, attributes, idxLocation, quiet, exclude, statusCallback, signal));
|
|
79
79
|
statusCallback('Indexing files.');
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return ixIxxStream;
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
throw e;
|
|
96
|
-
}
|
|
80
|
+
const ixIxxStream = await runIxIxx(readable, idxLocation, name);
|
|
81
|
+
(0, util_1.checkAbortSignal)(signal);
|
|
82
|
+
await (0, common_1.generateMeta)({
|
|
83
|
+
configs: tracks,
|
|
84
|
+
attributes,
|
|
85
|
+
outDir: idxLocation,
|
|
86
|
+
name,
|
|
87
|
+
exclude,
|
|
88
|
+
assemblyNames,
|
|
89
|
+
});
|
|
90
|
+
(0, util_1.checkAbortSignal)(signal);
|
|
91
|
+
return ixIxxStream;
|
|
97
92
|
}
|
|
98
93
|
async function* indexFiles(tracks, attributes, outLocation, quiet, typesToExclude, statusCallback, signal) {
|
|
99
94
|
for (const track of tracks) {
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.indexGff3 = void 0;
|
|
7
7
|
const zlib_1 = require("zlib");
|
|
8
8
|
const readline_1 = __importDefault(require("readline"));
|
|
9
|
+
const util_1 = require("../util");
|
|
9
10
|
const common_1 = require("./common");
|
|
10
|
-
const
|
|
11
|
+
const util_2 = require("@jbrowse/core/util");
|
|
11
12
|
async function* indexGff3(config, attributes, inLocation, outLocation, typesToExclude, quiet, statusCallback, signal) {
|
|
12
13
|
const { trackId } = config;
|
|
13
14
|
let receivedBytes = 0;
|
|
@@ -40,7 +41,7 @@ async function* indexGff3(config, attributes, inLocation, outLocation, typesToEx
|
|
|
40
41
|
.map(f => f.split('='))
|
|
41
42
|
.map(([key, val]) => [
|
|
42
43
|
key.trim(),
|
|
43
|
-
|
|
44
|
+
(0, util_1.decodeURIComponentNoThrow)(val).trim().split(',').join(' '),
|
|
44
45
|
]));
|
|
45
46
|
const attrs = attributes
|
|
46
47
|
.map(attr => col9attrs[attr])
|
|
@@ -52,7 +53,7 @@ async function* indexGff3(config, attributes, inLocation, outLocation, typesToEx
|
|
|
52
53
|
...attrs.map(a => encodeURIComponent(a)),
|
|
53
54
|
]).replaceAll(',', '|');
|
|
54
55
|
// Check abort signal
|
|
55
|
-
(0,
|
|
56
|
+
(0, util_2.checkAbortSignal)(signal);
|
|
56
57
|
yield `${record} ${[...new Set(attrs)].join(' ')}\n`;
|
|
57
58
|
}
|
|
58
59
|
}
|
package/dist/types/vcfAdapter.js
CHANGED
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.indexVcf = void 0;
|
|
7
7
|
const zlib_1 = require("zlib");
|
|
8
8
|
const readline_1 = __importDefault(require("readline"));
|
|
9
|
+
const util_1 = require("../util");
|
|
9
10
|
const common_1 = require("./common");
|
|
10
|
-
const
|
|
11
|
+
const util_2 = require("@jbrowse/core/util");
|
|
11
12
|
async function* indexVcf(config, attributesToIndex, inLocation, outLocation, typesToExclude, quiet, statusCallback, signal) {
|
|
12
13
|
const { trackId } = config;
|
|
13
14
|
let receivedBytes = 0;
|
|
@@ -38,7 +39,9 @@ async function* indexVcf(config, attributesToIndex, inLocation, outLocation, typ
|
|
|
38
39
|
.map(f => f.split('='))
|
|
39
40
|
.map(([key, val]) => [
|
|
40
41
|
key.trim(),
|
|
41
|
-
val
|
|
42
|
+
val
|
|
43
|
+
? (0, util_1.decodeURIComponentNoThrow)(val).trim().split(',').join(' ')
|
|
44
|
+
: undefined,
|
|
42
45
|
]));
|
|
43
46
|
const end = fields.END;
|
|
44
47
|
const locStr = `${ref}:${pos}..${end || +pos + 1}`;
|
|
@@ -58,7 +61,7 @@ async function* indexVcf(config, attributesToIndex, inLocation, outLocation, typ
|
|
|
58
61
|
...infoAttrs.map(a => encodeURIComponent(a || '')),
|
|
59
62
|
]).replaceAll(',', '|');
|
|
60
63
|
// Check abort signal
|
|
61
|
-
(0,
|
|
64
|
+
(0, util_2.checkAbortSignal)(signal);
|
|
62
65
|
yield `${record} ${[...new Set(attrs)].join(' ')}\n`;
|
|
63
66
|
}
|
|
64
67
|
}
|
package/dist/util.d.ts
CHANGED
|
@@ -113,3 +113,4 @@ export declare function createTextSearchConf(name: string, trackIds: string[], a
|
|
|
113
113
|
assemblyNames: string[];
|
|
114
114
|
};
|
|
115
115
|
export declare function findTrackConfigsToIndex(tracks: Track[], trackIds: string[], assemblyName?: string): Track[];
|
|
116
|
+
export declare function decodeURIComponentNoThrow(uri: string): string;
|
package/dist/util.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findTrackConfigsToIndex = exports.createTextSearchConf = void 0;
|
|
6
|
+
exports.decodeURIComponentNoThrow = exports.findTrackConfigsToIndex = exports.createTextSearchConf = void 0;
|
|
7
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
8
|
const sanitize_filename_1 = __importDefault(require("sanitize-filename"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -43,3 +43,13 @@ function findTrackConfigsToIndex(tracks, trackIds, assemblyName) {
|
|
|
43
43
|
.filter(track => { var _a; return (0, util_1.isSupportedIndexingAdapter)((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
|
|
44
44
|
}
|
|
45
45
|
exports.findTrackConfigsToIndex = findTrackConfigsToIndex;
|
|
46
|
+
function decodeURIComponentNoThrow(uri) {
|
|
47
|
+
try {
|
|
48
|
+
return decodeURIComponent(uri);
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
// avoid throwing exception on a failure to decode URI component
|
|
52
|
+
return uri;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.decodeURIComponentNoThrow = decodeURIComponentNoThrow;
|
package/esm/TextIndexing.js
CHANGED
|
@@ -70,23 +70,18 @@ async function aggregateIndex(tracks, statusCallback, outLocation, attributes, a
|
|
|
70
70
|
async function indexDriver(tracks, idxLocation, attributes, name, quiet, exclude, assemblyNames, statusCallback, signal) {
|
|
71
71
|
const readable = Readable.from(indexFiles(tracks, attributes, idxLocation, quiet, exclude, statusCallback, signal));
|
|
72
72
|
statusCallback('Indexing files.');
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return ixIxxStream;
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
throw e;
|
|
89
|
-
}
|
|
73
|
+
const ixIxxStream = await runIxIxx(readable, idxLocation, name);
|
|
74
|
+
checkAbortSignal(signal);
|
|
75
|
+
await generateMeta({
|
|
76
|
+
configs: tracks,
|
|
77
|
+
attributes,
|
|
78
|
+
outDir: idxLocation,
|
|
79
|
+
name,
|
|
80
|
+
exclude,
|
|
81
|
+
assemblyNames,
|
|
82
|
+
});
|
|
83
|
+
checkAbortSignal(signal);
|
|
84
|
+
return ixIxxStream;
|
|
90
85
|
}
|
|
91
86
|
async function* indexFiles(tracks, attributes, outLocation, quiet, typesToExclude, statusCallback, signal) {
|
|
92
87
|
for (const track of tracks) {
|
package/esm/types/gff3Adapter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createGunzip } from 'zlib';
|
|
2
2
|
import readline from 'readline';
|
|
3
|
+
import { decodeURIComponentNoThrow } from '../util';
|
|
3
4
|
import { getLocalOrRemoteStream } from './common';
|
|
4
5
|
import { checkAbortSignal } from '@jbrowse/core/util';
|
|
5
6
|
export async function* indexGff3(config, attributes, inLocation, outLocation, typesToExclude, quiet, statusCallback, signal) {
|
|
@@ -34,7 +35,7 @@ export async function* indexGff3(config, attributes, inLocation, outLocation, ty
|
|
|
34
35
|
.map(f => f.split('='))
|
|
35
36
|
.map(([key, val]) => [
|
|
36
37
|
key.trim(),
|
|
37
|
-
|
|
38
|
+
decodeURIComponentNoThrow(val).trim().split(',').join(' '),
|
|
38
39
|
]));
|
|
39
40
|
const attrs = attributes
|
|
40
41
|
.map(attr => col9attrs[attr])
|
package/esm/types/vcfAdapter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createGunzip } from 'zlib';
|
|
2
2
|
import readline from 'readline';
|
|
3
|
+
import { decodeURIComponentNoThrow } from '../util';
|
|
3
4
|
import { getLocalOrRemoteStream } from './common';
|
|
4
5
|
import { checkAbortSignal } from '@jbrowse/core/util';
|
|
5
6
|
export async function* indexVcf(config, attributesToIndex, inLocation, outLocation, typesToExclude, quiet, statusCallback, signal) {
|
|
@@ -32,7 +33,9 @@ export async function* indexVcf(config, attributesToIndex, inLocation, outLocati
|
|
|
32
33
|
.map(f => f.split('='))
|
|
33
34
|
.map(([key, val]) => [
|
|
34
35
|
key.trim(),
|
|
35
|
-
val
|
|
36
|
+
val
|
|
37
|
+
? decodeURIComponentNoThrow(val).trim().split(',').join(' ')
|
|
38
|
+
: undefined,
|
|
36
39
|
]));
|
|
37
40
|
const end = fields.END;
|
|
38
41
|
const locStr = `${ref}:${pos}..${end || +pos + 1}`;
|
package/esm/util.d.ts
CHANGED
|
@@ -113,3 +113,4 @@ export declare function createTextSearchConf(name: string, trackIds: string[], a
|
|
|
113
113
|
assemblyNames: string[];
|
|
114
114
|
};
|
|
115
115
|
export declare function findTrackConfigsToIndex(tracks: Track[], trackIds: string[], assemblyName?: string): Track[];
|
|
116
|
+
export declare function decodeURIComponentNoThrow(uri: string): string;
|
package/esm/util.js
CHANGED
|
@@ -35,3 +35,12 @@ export function findTrackConfigsToIndex(tracks, trackIds, assemblyName) {
|
|
|
35
35
|
.filter(track => assemblyName ? track.assemblyNames.includes(assemblyName) : true)
|
|
36
36
|
.filter(track => { var _a; return isSupportedIndexingAdapter((_a = track.adapter) === null || _a === void 0 ? void 0 : _a.type); });
|
|
37
37
|
}
|
|
38
|
+
export function decodeURIComponentNoThrow(uri) {
|
|
39
|
+
try {
|
|
40
|
+
return decodeURIComponent(uri);
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
// avoid throwing exception on a failure to decode URI component
|
|
44
|
+
return uri;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/text-indexing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "JBrowse 2 text indexing for desktop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
|
|
61
61
|
}
|