@jbrowse/plugin-comparative-adapters 3.0.2 → 3.0.4
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/BlastTabularAdapter/BlastTabularAdapter.js +1 -1
- package/dist/ChainAdapter/util.d.ts +2 -1
- package/dist/ChainAdapter/util.js +6 -1
- package/dist/DeltaAdapter/util.d.ts +2 -1
- package/dist/DeltaAdapter/util.js +6 -1
- package/dist/MashMapAdapter/MashMapAdapter.js +1 -1
- package/dist/PAFAdapter/PAFAdapter.js +1 -1
- package/dist/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +6 -4
- package/dist/util.d.ts +1 -1
- package/dist/util.js +27 -21
- package/esm/BlastTabularAdapter/BlastTabularAdapter.js +1 -1
- package/esm/ChainAdapter/util.d.ts +2 -1
- package/esm/ChainAdapter/util.js +6 -1
- package/esm/DeltaAdapter/util.d.ts +2 -1
- package/esm/DeltaAdapter/util.js +6 -1
- package/esm/MashMapAdapter/MashMapAdapter.js +1 -1
- package/esm/PAFAdapter/PAFAdapter.js +1 -1
- package/esm/PairwiseIndexedPAFAdapter/PairwiseIndexedPAFAdapter.js +4 -2
- package/esm/util.d.ts +1 -1
- package/esm/util.js +27 -21
- package/package.json +5 -5
|
@@ -87,7 +87,7 @@ class BlastTabularAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
87
87
|
const pm = this.pluginManager;
|
|
88
88
|
const buf = await (0, util_1.fetchAndMaybeUnzip)((0, io_1.openLocation)((0, configuration_1.readConfObject)(this.config, 'blastTableLocation'), pm), opts);
|
|
89
89
|
const columns = (0, configuration_1.readConfObject)(this.config, 'columns');
|
|
90
|
-
return (0, util_2.parseLineByLine)(buf, createBlastLineParser(columns));
|
|
90
|
+
return (0, util_2.parseLineByLine)(buf, createBlastLineParser(columns), opts);
|
|
91
91
|
}
|
|
92
92
|
async hasDataForRefName() {
|
|
93
93
|
return true;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
export declare function paf_chain2paf(buffer: Uint8Array, opts?: BaseOptions): {
|
|
2
3
|
qname: string;
|
|
3
4
|
qstart: number;
|
|
4
5
|
qend: number;
|
|
@@ -18,7 +18,8 @@ function generate_record(qname, qstart, qend, qstrand, tname, tstart, tend, ciga
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function paf_chain2paf(buffer) {
|
|
21
|
+
function paf_chain2paf(buffer, opts) {
|
|
22
|
+
const { statusCallback = () => { } } = opts || {};
|
|
22
23
|
let t_name = '';
|
|
23
24
|
let t_start = 0;
|
|
24
25
|
let t_end = 0;
|
|
@@ -30,9 +31,13 @@ function paf_chain2paf(buffer) {
|
|
|
30
31
|
let num_matches = 0;
|
|
31
32
|
let cigar = '';
|
|
32
33
|
const records = [];
|
|
34
|
+
let i = 0;
|
|
33
35
|
let blockStart = 0;
|
|
34
36
|
const decoder = new TextDecoder('utf8');
|
|
35
37
|
while (blockStart < buffer.length) {
|
|
38
|
+
if (i++ % 10000 === 0) {
|
|
39
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
40
|
+
}
|
|
36
41
|
const n = buffer.indexOf(10, blockStart);
|
|
37
42
|
if (n === -1) {
|
|
38
43
|
break;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter/BaseOptions';
|
|
2
|
+
export declare function paf_delta2paf(buffer: Uint8Array, opts?: BaseOptions): {
|
|
2
3
|
qname: string;
|
|
3
4
|
qstart: number;
|
|
4
5
|
qend: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.paf_delta2paf = paf_delta2paf;
|
|
4
|
-
function paf_delta2paf(buffer) {
|
|
4
|
+
function paf_delta2paf(buffer, opts) {
|
|
5
|
+
const { statusCallback = () => { } } = opts || {};
|
|
5
6
|
let rname = '';
|
|
6
7
|
let qname = '';
|
|
7
8
|
let qs = 0;
|
|
@@ -18,8 +19,12 @@ function paf_delta2paf(buffer) {
|
|
|
18
19
|
const regex = new RegExp(/^>(\S+)\s+(\S+)\s+(\d+)\s+(\d+)/);
|
|
19
20
|
let blockStart = 0;
|
|
20
21
|
let i = 0;
|
|
22
|
+
let j = 0;
|
|
21
23
|
const decoder = new TextDecoder('utf8');
|
|
22
24
|
while (blockStart < buffer.length) {
|
|
25
|
+
if (j++ % 10000 === 0) {
|
|
26
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
27
|
+
}
|
|
23
28
|
const n = buffer.indexOf(10, blockStart);
|
|
24
29
|
if (n === -1) {
|
|
25
30
|
break;
|
|
@@ -11,7 +11,7 @@ class MashMapAdapter extends PAFAdapter_1.default {
|
|
|
11
11
|
async setupPre(opts) {
|
|
12
12
|
const outLoc = (0, io_1.openLocation)(this.getConf('outLocation'), this.pluginManager);
|
|
13
13
|
const buf = await (0, util_1.fetchAndMaybeUnzip)(outLoc, opts);
|
|
14
|
-
return (0, util_2.parseLineByLine)(buf, parseMashMapLine);
|
|
14
|
+
return (0, util_2.parseLineByLine)(buf, parseMashMapLine, opts);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.default = MashMapAdapter;
|
|
@@ -28,7 +28,7 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
28
28
|
const pm = this.pluginManager;
|
|
29
29
|
const pafLocation = (0, io_1.openLocation)(this.getConf('pafLocation'), pm);
|
|
30
30
|
const buf = await (0, util_1.fetchAndMaybeUnzip)(pafLocation, opts);
|
|
31
|
-
return (0, util_2.parseLineByLine)(buf, util_2.parsePAFLine);
|
|
31
|
+
return (0, util_2.parseLineByLine)(buf, util_2.parsePAFLine, opts);
|
|
32
32
|
}
|
|
33
33
|
async hasDataForRefName() {
|
|
34
34
|
return true;
|
|
@@ -5,10 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tabix_1 = require("@gmod/tabix");
|
|
7
7
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
8
9
|
const io_1 = require("@jbrowse/core/util/io");
|
|
9
10
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
10
11
|
const SyntenyFeature_1 = __importDefault(require("../SyntenyFeature"));
|
|
11
|
-
const
|
|
12
|
+
const util_2 = require("../util");
|
|
12
13
|
class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
13
14
|
constructor(config, getSubAdapter, pluginManager) {
|
|
14
15
|
super(config, getSubAdapter, pluginManager);
|
|
@@ -58,15 +59,16 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
getFeatures(query, opts = {}) {
|
|
62
|
+
const { statusCallback = () => { } } = opts;
|
|
61
63
|
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
62
64
|
const { assemblyName } = query;
|
|
63
65
|
const assemblyNames = this.getAssemblyNames();
|
|
64
66
|
const index = assemblyNames.indexOf(assemblyName);
|
|
65
67
|
const flip = index === 0;
|
|
66
68
|
const letter = flip ? 'q' : 't';
|
|
67
|
-
await this.pif.getLines(letter + query.refName, query.start, query.end, {
|
|
69
|
+
await (0, util_1.updateStatus)('Downloading features', statusCallback, () => this.pif.getLines(letter + query.refName, query.start, query.end, {
|
|
68
70
|
lineCallback: (line, fileOffset) => {
|
|
69
|
-
const r = (0,
|
|
71
|
+
const r = (0, util_2.parsePAFLine)(line);
|
|
70
72
|
const refName = r.qname.slice(1);
|
|
71
73
|
const start = r.qstart;
|
|
72
74
|
const end = r.qend;
|
|
@@ -98,7 +100,7 @@ class PAFAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
98
100
|
}));
|
|
99
101
|
},
|
|
100
102
|
stopToken: opts.stopToken,
|
|
101
|
-
});
|
|
103
|
+
}));
|
|
102
104
|
observer.complete();
|
|
103
105
|
});
|
|
104
106
|
}
|
package/dist/util.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function parseBed(text: string): Map<string | undefined, {
|
|
|
11
11
|
}>;
|
|
12
12
|
export declare function readFile(file: GenericFilehandle, opts?: BaseOptions): Promise<string>;
|
|
13
13
|
export declare function zip(a: number[], b: number[]): [number, number][];
|
|
14
|
-
export declare function parseLineByLine<T>(buffer: Uint8Array, cb: (line: string) => T | undefined): T[];
|
|
14
|
+
export declare function parseLineByLine<T>(buffer: Uint8Array, cb: (line: string) => T | undefined, opts?: BaseOptions): T[];
|
|
15
15
|
export declare function parsePAFLine(line: string): PAFRecord;
|
|
16
16
|
export declare function flipCigar(cigar: string[]): (string | undefined)[];
|
|
17
17
|
export declare function swapIndelCigar(cigar: string): string;
|
package/dist/util.js
CHANGED
|
@@ -33,10 +33,12 @@ async function readFile(file, opts) {
|
|
|
33
33
|
function zip(a, b) {
|
|
34
34
|
return a.map((e, i) => [e, b[i]]);
|
|
35
35
|
}
|
|
36
|
-
function parseLineByLine(buffer, cb) {
|
|
36
|
+
function parseLineByLine(buffer, cb, opts) {
|
|
37
|
+
const { statusCallback = () => { } } = opts || {};
|
|
37
38
|
let blockStart = 0;
|
|
38
39
|
const entries = [];
|
|
39
40
|
const decoder = new TextDecoder('utf8');
|
|
41
|
+
let i = 0;
|
|
40
42
|
while (blockStart < buffer.length) {
|
|
41
43
|
const n = buffer.indexOf(10, blockStart);
|
|
42
44
|
if (n === -1) {
|
|
@@ -50,32 +52,36 @@ function parseLineByLine(buffer, cb) {
|
|
|
50
52
|
entries.push(entry);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
if (i++ % 10000 === 0) {
|
|
56
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
57
|
+
}
|
|
53
58
|
blockStart = n + 1;
|
|
54
59
|
}
|
|
55
60
|
return entries;
|
|
56
61
|
}
|
|
57
62
|
function parsePAFLine(line) {
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
63
|
+
const parts = line.split('\t');
|
|
64
|
+
const extraFields = parts.slice(12);
|
|
65
|
+
const extra = {
|
|
66
|
+
numMatches: +parts[9],
|
|
67
|
+
blockLen: +parts[10],
|
|
68
|
+
mappingQual: +parts[11],
|
|
69
|
+
};
|
|
70
|
+
if (extraFields.length) {
|
|
71
|
+
for (const field of extraFields) {
|
|
72
|
+
const colonIndex = field.indexOf(':');
|
|
73
|
+
extra[field.slice(0, colonIndex)] = field.slice(colonIndex + 3);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
65
76
|
return {
|
|
66
|
-
tname,
|
|
67
|
-
tstart: +
|
|
68
|
-
tend: +
|
|
69
|
-
qname,
|
|
70
|
-
qstart: +
|
|
71
|
-
qend: +
|
|
72
|
-
strand:
|
|
73
|
-
extra
|
|
74
|
-
numMatches: +numMatches,
|
|
75
|
-
blockLen: +blockLen,
|
|
76
|
-
mappingQual: +mappingQual,
|
|
77
|
-
...rest,
|
|
78
|
-
},
|
|
77
|
+
tname: parts[5],
|
|
78
|
+
tstart: +parts[7],
|
|
79
|
+
tend: +parts[8],
|
|
80
|
+
qname: parts[0],
|
|
81
|
+
qstart: +parts[2],
|
|
82
|
+
qend: +parts[3],
|
|
83
|
+
strand: parts[4] === '-' ? -1 : 1,
|
|
84
|
+
extra,
|
|
79
85
|
};
|
|
80
86
|
}
|
|
81
87
|
function flipCigar(cigar) {
|
|
@@ -82,7 +82,7 @@ class BlastTabularAdapter extends BaseFeatureDataAdapter {
|
|
|
82
82
|
const pm = this.pluginManager;
|
|
83
83
|
const buf = await fetchAndMaybeUnzip(openLocation(readConfObject(this.config, 'blastTableLocation'), pm), opts);
|
|
84
84
|
const columns = readConfObject(this.config, 'columns');
|
|
85
|
-
return parseLineByLine(buf, createBlastLineParser(columns));
|
|
85
|
+
return parseLineByLine(buf, createBlastLineParser(columns), opts);
|
|
86
86
|
}
|
|
87
87
|
async hasDataForRefName() {
|
|
88
88
|
return true;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
export declare function paf_chain2paf(buffer: Uint8Array, opts?: BaseOptions): {
|
|
2
3
|
qname: string;
|
|
3
4
|
qstart: number;
|
|
4
5
|
qend: number;
|
package/esm/ChainAdapter/util.js
CHANGED
|
@@ -15,7 +15,8 @@ function generate_record(qname, qstart, qend, qstrand, tname, tstart, tend, ciga
|
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export function paf_chain2paf(buffer) {
|
|
18
|
+
export function paf_chain2paf(buffer, opts) {
|
|
19
|
+
const { statusCallback = () => { } } = opts || {};
|
|
19
20
|
let t_name = '';
|
|
20
21
|
let t_start = 0;
|
|
21
22
|
let t_end = 0;
|
|
@@ -27,9 +28,13 @@ export function paf_chain2paf(buffer) {
|
|
|
27
28
|
let num_matches = 0;
|
|
28
29
|
let cigar = '';
|
|
29
30
|
const records = [];
|
|
31
|
+
let i = 0;
|
|
30
32
|
let blockStart = 0;
|
|
31
33
|
const decoder = new TextDecoder('utf8');
|
|
32
34
|
while (blockStart < buffer.length) {
|
|
35
|
+
if (i++ % 10000 === 0) {
|
|
36
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
37
|
+
}
|
|
33
38
|
const n = buffer.indexOf(10, blockStart);
|
|
34
39
|
if (n === -1) {
|
|
35
40
|
break;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter/BaseOptions';
|
|
2
|
+
export declare function paf_delta2paf(buffer: Uint8Array, opts?: BaseOptions): {
|
|
2
3
|
qname: string;
|
|
3
4
|
qstart: number;
|
|
4
5
|
qend: number;
|
package/esm/DeltaAdapter/util.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function paf_delta2paf(buffer) {
|
|
1
|
+
export function paf_delta2paf(buffer, opts) {
|
|
2
|
+
const { statusCallback = () => { } } = opts || {};
|
|
2
3
|
let rname = '';
|
|
3
4
|
let qname = '';
|
|
4
5
|
let qs = 0;
|
|
@@ -15,8 +16,12 @@ export function paf_delta2paf(buffer) {
|
|
|
15
16
|
const regex = new RegExp(/^>(\S+)\s+(\S+)\s+(\d+)\s+(\d+)/);
|
|
16
17
|
let blockStart = 0;
|
|
17
18
|
let i = 0;
|
|
19
|
+
let j = 0;
|
|
18
20
|
const decoder = new TextDecoder('utf8');
|
|
19
21
|
while (blockStart < buffer.length) {
|
|
22
|
+
if (j++ % 10000 === 0) {
|
|
23
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
24
|
+
}
|
|
20
25
|
const n = buffer.indexOf(10, blockStart);
|
|
21
26
|
if (n === -1) {
|
|
22
27
|
break;
|
|
@@ -6,7 +6,7 @@ export default class MashMapAdapter extends PAFAdapter {
|
|
|
6
6
|
async setupPre(opts) {
|
|
7
7
|
const outLoc = openLocation(this.getConf('outLocation'), this.pluginManager);
|
|
8
8
|
const buf = await fetchAndMaybeUnzip(outLoc, opts);
|
|
9
|
-
return parseLineByLine(buf, parseMashMapLine);
|
|
9
|
+
return parseLineByLine(buf, parseMashMapLine, opts);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
function parseMashMapLine(line) {
|
|
@@ -23,7 +23,7 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
23
23
|
const pm = this.pluginManager;
|
|
24
24
|
const pafLocation = openLocation(this.getConf('pafLocation'), pm);
|
|
25
25
|
const buf = await fetchAndMaybeUnzip(pafLocation, opts);
|
|
26
|
-
return parseLineByLine(buf, parsePAFLine);
|
|
26
|
+
return parseLineByLine(buf, parsePAFLine, opts);
|
|
27
27
|
}
|
|
28
28
|
async hasDataForRefName() {
|
|
29
29
|
return true;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TabixIndexedFile } from '@gmod/tabix';
|
|
2
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import { updateStatus } from '@jbrowse/core/util';
|
|
3
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
4
5
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
5
6
|
import SyntenyFeature from '../SyntenyFeature';
|
|
@@ -53,13 +54,14 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
getFeatures(query, opts = {}) {
|
|
57
|
+
const { statusCallback = () => { } } = opts;
|
|
56
58
|
return ObservableCreate(async (observer) => {
|
|
57
59
|
const { assemblyName } = query;
|
|
58
60
|
const assemblyNames = this.getAssemblyNames();
|
|
59
61
|
const index = assemblyNames.indexOf(assemblyName);
|
|
60
62
|
const flip = index === 0;
|
|
61
63
|
const letter = flip ? 'q' : 't';
|
|
62
|
-
await this.pif.getLines(letter + query.refName, query.start, query.end, {
|
|
64
|
+
await updateStatus('Downloading features', statusCallback, () => this.pif.getLines(letter + query.refName, query.start, query.end, {
|
|
63
65
|
lineCallback: (line, fileOffset) => {
|
|
64
66
|
const r = parsePAFLine(line);
|
|
65
67
|
const refName = r.qname.slice(1);
|
|
@@ -93,7 +95,7 @@ class PAFAdapter extends BaseFeatureDataAdapter {
|
|
|
93
95
|
}));
|
|
94
96
|
},
|
|
95
97
|
stopToken: opts.stopToken,
|
|
96
|
-
});
|
|
98
|
+
}));
|
|
97
99
|
observer.complete();
|
|
98
100
|
});
|
|
99
101
|
}
|
package/esm/util.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function parseBed(text: string): Map<string | undefined, {
|
|
|
11
11
|
}>;
|
|
12
12
|
export declare function readFile(file: GenericFilehandle, opts?: BaseOptions): Promise<string>;
|
|
13
13
|
export declare function zip(a: number[], b: number[]): [number, number][];
|
|
14
|
-
export declare function parseLineByLine<T>(buffer: Uint8Array, cb: (line: string) => T | undefined): T[];
|
|
14
|
+
export declare function parseLineByLine<T>(buffer: Uint8Array, cb: (line: string) => T | undefined, opts?: BaseOptions): T[];
|
|
15
15
|
export declare function parsePAFLine(line: string): PAFRecord;
|
|
16
16
|
export declare function flipCigar(cigar: string[]): (string | undefined)[];
|
|
17
17
|
export declare function swapIndelCigar(cigar: string): string;
|
package/esm/util.js
CHANGED
|
@@ -24,10 +24,12 @@ export async function readFile(file, opts) {
|
|
|
24
24
|
export function zip(a, b) {
|
|
25
25
|
return a.map((e, i) => [e, b[i]]);
|
|
26
26
|
}
|
|
27
|
-
export function parseLineByLine(buffer, cb) {
|
|
27
|
+
export function parseLineByLine(buffer, cb, opts) {
|
|
28
|
+
const { statusCallback = () => { } } = opts || {};
|
|
28
29
|
let blockStart = 0;
|
|
29
30
|
const entries = [];
|
|
30
31
|
const decoder = new TextDecoder('utf8');
|
|
32
|
+
let i = 0;
|
|
31
33
|
while (blockStart < buffer.length) {
|
|
32
34
|
const n = buffer.indexOf(10, blockStart);
|
|
33
35
|
if (n === -1) {
|
|
@@ -41,32 +43,36 @@ export function parseLineByLine(buffer, cb) {
|
|
|
41
43
|
entries.push(entry);
|
|
42
44
|
}
|
|
43
45
|
}
|
|
46
|
+
if (i++ % 10000 === 0) {
|
|
47
|
+
statusCallback(`Loading ${Math.floor(blockStart / 1000000).toLocaleString('en-US')}/${Math.floor(buffer.length / 1000000).toLocaleString('en-US')} MB`);
|
|
48
|
+
}
|
|
44
49
|
blockStart = n + 1;
|
|
45
50
|
}
|
|
46
51
|
return entries;
|
|
47
52
|
}
|
|
48
53
|
export function parsePAFLine(line) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
54
|
+
const parts = line.split('\t');
|
|
55
|
+
const extraFields = parts.slice(12);
|
|
56
|
+
const extra = {
|
|
57
|
+
numMatches: +parts[9],
|
|
58
|
+
blockLen: +parts[10],
|
|
59
|
+
mappingQual: +parts[11],
|
|
60
|
+
};
|
|
61
|
+
if (extraFields.length) {
|
|
62
|
+
for (const field of extraFields) {
|
|
63
|
+
const colonIndex = field.indexOf(':');
|
|
64
|
+
extra[field.slice(0, colonIndex)] = field.slice(colonIndex + 3);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
56
67
|
return {
|
|
57
|
-
tname,
|
|
58
|
-
tstart: +
|
|
59
|
-
tend: +
|
|
60
|
-
qname,
|
|
61
|
-
qstart: +
|
|
62
|
-
qend: +
|
|
63
|
-
strand:
|
|
64
|
-
extra
|
|
65
|
-
numMatches: +numMatches,
|
|
66
|
-
blockLen: +blockLen,
|
|
67
|
-
mappingQual: +mappingQual,
|
|
68
|
-
...rest,
|
|
69
|
-
},
|
|
68
|
+
tname: parts[5],
|
|
69
|
+
tstart: +parts[7],
|
|
70
|
+
tend: +parts[8],
|
|
71
|
+
qname: parts[0],
|
|
72
|
+
qstart: +parts[2],
|
|
73
|
+
qend: +parts[3],
|
|
74
|
+
strand: parts[4] === '-' ? -1 : 1,
|
|
75
|
+
extra,
|
|
70
76
|
};
|
|
71
77
|
}
|
|
72
78
|
export function flipCigar(cigar) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-comparative-adapters",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "JBrowse 2 comparative adapters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@gmod/bgzf-filehandle": "^2.0.1",
|
|
40
40
|
"@gmod/tabix": "^2.0.0",
|
|
41
|
-
"@jbrowse/core": "^3.0.
|
|
42
|
-
"@jbrowse/plugin-alignments": "^3.0.
|
|
43
|
-
"@jbrowse/plugin-linear-genome-view": "^3.0.
|
|
41
|
+
"@jbrowse/core": "^3.0.4",
|
|
42
|
+
"@jbrowse/plugin-alignments": "^3.0.4",
|
|
43
|
+
"@jbrowse/plugin-linear-genome-view": "^3.0.4",
|
|
44
44
|
"@mui/material": "^6.0.0",
|
|
45
45
|
"generic-filehandle2": "^1.0.0",
|
|
46
46
|
"mobx": "^6.0.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "61e6d26f83acbf58a946c2add3415bc46b878df9"
|
|
62
62
|
}
|