@jbrowse/plugin-sequence 2.17.0 → 2.18.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/BgzipFastaAdapter/configSchema.d.ts +0 -12
- package/dist/BgzipFastaAdapter/configSchema.js +1 -16
- package/dist/BgzipFastaAdapter/index.d.ts +1 -1
- package/dist/BgzipFastaAdapter/index.js +11 -9
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +2 -1
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +1 -1
- package/dist/ChromSizesAdapter/configSchema.d.ts +0 -3
- package/dist/ChromSizesAdapter/configSchema.js +1 -7
- package/dist/ChromSizesAdapter/index.d.ts +1 -1
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.d.ts +3 -3
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +4 -10
- package/dist/DivSequenceRenderer/configSchema.d.ts +0 -3
- package/dist/DivSequenceRenderer/configSchema.js +1 -7
- package/dist/DivSequenceRenderer/index.d.ts +1 -1
- package/dist/DivSequenceRenderer/index.js +0 -1
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +6 -10
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +46 -40
- package/dist/IndexedFastaAdapter/configSchema.d.ts +0 -9
- package/dist/IndexedFastaAdapter/configSchema.js +1 -13
- package/dist/IndexedFastaAdapter/index.d.ts +1 -1
- package/dist/IndexedFastaAdapter/index.js +11 -9
- package/dist/LinearReferenceSequenceDisplay/configSchema.d.ts +0 -3
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +1 -7
- package/dist/LinearReferenceSequenceDisplay/index.d.ts +1 -1
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +11 -92
- package/dist/LinearReferenceSequenceDisplay/model.js +4 -65
- package/dist/ReferenceSequenceTrack/configSchema.d.ts +1 -27
- package/dist/ReferenceSequenceTrack/configSchema.js +2 -42
- package/dist/ReferenceSequenceTrack/index.d.ts +1 -1
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +3 -2
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.js +2 -2
- package/dist/SequenceSearchAdapter/configSchema.d.ts +0 -15
- package/dist/SequenceSearchAdapter/configSchema.js +1 -19
- package/dist/SequenceSearchAdapter/index.d.ts +1 -1
- package/dist/SequenceSearchAdapter/index.js +11 -9
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +22 -19
- package/dist/TwoBitAdapter/TwoBitAdapter.js +35 -37
- package/dist/TwoBitAdapter/configSchema.d.ts +0 -6
- package/dist/TwoBitAdapter/configSchema.js +1 -10
- package/dist/TwoBitAdapter/index.d.ts +1 -1
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.d.ts +4 -3
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.js +3 -3
- package/dist/UnindexedFastaAdapter/configSchema.d.ts +0 -6
- package/dist/UnindexedFastaAdapter/configSchema.js +1 -10
- package/dist/UnindexedFastaAdapter/index.d.ts +1 -1
- package/dist/UnindexedFastaAdapter/index.js +11 -9
- package/dist/createExtensionPoints.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/esm/BgzipFastaAdapter/configSchema.d.ts +0 -12
- package/esm/BgzipFastaAdapter/configSchema.js +1 -16
- package/esm/BgzipFastaAdapter/index.d.ts +1 -1
- package/esm/BgzipFastaAdapter/index.js +11 -9
- package/esm/ChromSizesAdapter/ChromSizesAdapter.d.ts +2 -1
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js +2 -2
- package/esm/ChromSizesAdapter/configSchema.d.ts +0 -3
- package/esm/ChromSizesAdapter/configSchema.js +1 -7
- package/esm/ChromSizesAdapter/index.d.ts +1 -1
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.d.ts +3 -3
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +4 -10
- package/esm/DivSequenceRenderer/configSchema.d.ts +0 -3
- package/esm/DivSequenceRenderer/configSchema.js +1 -7
- package/esm/DivSequenceRenderer/index.d.ts +1 -1
- package/esm/DivSequenceRenderer/index.js +0 -1
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +6 -10
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +47 -41
- package/esm/IndexedFastaAdapter/configSchema.d.ts +0 -9
- package/esm/IndexedFastaAdapter/configSchema.js +1 -13
- package/esm/IndexedFastaAdapter/index.d.ts +1 -1
- package/esm/IndexedFastaAdapter/index.js +11 -9
- package/esm/LinearReferenceSequenceDisplay/configSchema.d.ts +0 -3
- package/esm/LinearReferenceSequenceDisplay/configSchema.js +1 -7
- package/esm/LinearReferenceSequenceDisplay/index.d.ts +1 -1
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +11 -92
- package/esm/LinearReferenceSequenceDisplay/model.js +5 -66
- package/esm/ReferenceSequenceTrack/configSchema.d.ts +1 -27
- package/esm/ReferenceSequenceTrack/configSchema.js +2 -42
- package/esm/ReferenceSequenceTrack/index.d.ts +1 -1
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +3 -2
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.js +3 -3
- package/esm/SequenceSearchAdapter/configSchema.d.ts +0 -15
- package/esm/SequenceSearchAdapter/configSchema.js +1 -19
- package/esm/SequenceSearchAdapter/index.d.ts +1 -1
- package/esm/SequenceSearchAdapter/index.js +11 -9
- package/esm/TwoBitAdapter/TwoBitAdapter.d.ts +22 -19
- package/esm/TwoBitAdapter/TwoBitAdapter.js +35 -37
- package/esm/TwoBitAdapter/configSchema.d.ts +0 -6
- package/esm/TwoBitAdapter/configSchema.js +1 -10
- package/esm/TwoBitAdapter/index.d.ts +1 -1
- package/esm/UnindexedFastaAdapter/UnindexedFastaAdapter.d.ts +4 -3
- package/esm/UnindexedFastaAdapter/UnindexedFastaAdapter.js +4 -4
- package/esm/UnindexedFastaAdapter/configSchema.d.ts +0 -6
- package/esm/UnindexedFastaAdapter/configSchema.js +1 -10
- package/esm/UnindexedFastaAdapter/index.d.ts +1 -1
- package/esm/UnindexedFastaAdapter/index.js +11 -9
- package/esm/createExtensionPoints.d.ts +1 -1
- package/esm/createExtensionPoints.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +5 -5
- package/package.json +2 -2
|
@@ -3,18 +3,15 @@ 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
|
+
const twobit_1 = require("@gmod/twobit");
|
|
7
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
8
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
7
9
|
const io_1 = require("@jbrowse/core/util/io");
|
|
8
10
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
9
11
|
const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
10
|
-
const twobit_1 = require("@gmod/twobit");
|
|
11
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
12
12
|
class TwoBitAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
13
13
|
async initChromSizes() {
|
|
14
14
|
const conf = (0, configuration_1.readConfObject)(this.config, 'chromSizesLocation');
|
|
15
|
-
// check against default and empty in case someone makes the field blank in
|
|
16
|
-
// config editor, may want better way to check "optional config slots" in
|
|
17
|
-
// future
|
|
18
15
|
if (conf.uri !== '/path/to/default.chrom.sizes' && conf.uri !== '') {
|
|
19
16
|
const file = (0, io_1.openLocation)(conf, this.pluginManager);
|
|
20
17
|
const data = await file.readFile('utf8');
|
|
@@ -28,23 +25,31 @@ class TwoBitAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
28
25
|
}
|
|
29
26
|
return undefined;
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
28
|
+
async setupPre() {
|
|
29
|
+
return {
|
|
30
|
+
twobit: new twobit_1.TwoBitFile({
|
|
31
|
+
filehandle: (0, io_1.openLocation)(this.getConf('twoBitLocation'), this.pluginManager),
|
|
32
|
+
}),
|
|
33
|
+
chromSizesData: await this.initChromSizes(),
|
|
34
|
+
};
|
|
38
35
|
}
|
|
39
|
-
async
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
async setup() {
|
|
37
|
+
if (!this.setupP) {
|
|
38
|
+
this.setupP = this.setupPre().catch((e) => {
|
|
39
|
+
this.setupP = undefined;
|
|
40
|
+
throw e;
|
|
41
|
+
});
|
|
43
42
|
}
|
|
44
|
-
return this.
|
|
43
|
+
return this.setupP;
|
|
44
|
+
}
|
|
45
|
+
async getRefNames() {
|
|
46
|
+
const { chromSizesData, twobit } = await this.setup();
|
|
47
|
+
return chromSizesData
|
|
48
|
+
? Object.keys(chromSizesData)
|
|
49
|
+
: twobit.getSequenceNames();
|
|
45
50
|
}
|
|
46
51
|
async getRegions() {
|
|
47
|
-
const chromSizesData = await this.
|
|
52
|
+
const { chromSizesData, twobit } = await this.setup();
|
|
48
53
|
if (chromSizesData) {
|
|
49
54
|
return Object.keys(chromSizesData).map(refName => ({
|
|
50
55
|
refName,
|
|
@@ -52,23 +57,21 @@ class TwoBitAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
52
57
|
end: chromSizesData[refName],
|
|
53
58
|
}));
|
|
54
59
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
refName
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
else {
|
|
61
|
+
const refSizes = await twobit.getSequenceSizes();
|
|
62
|
+
return Object.keys(refSizes).map(refName => ({
|
|
63
|
+
refName,
|
|
64
|
+
start: 0,
|
|
65
|
+
end: refSizes[refName],
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
61
68
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Fetch features for a certain region
|
|
64
|
-
* @param param -
|
|
65
|
-
* @returns Observable of Feature objects in the region
|
|
66
|
-
*/
|
|
67
69
|
getFeatures({ refName, start, end }) {
|
|
68
70
|
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
69
|
-
const
|
|
71
|
+
const { twobit } = await this.setup();
|
|
72
|
+
const size = await twobit.getSequenceSize(refName);
|
|
70
73
|
const regionEnd = size !== undefined ? Math.min(size, end) : end;
|
|
71
|
-
const seq = await
|
|
74
|
+
const seq = await twobit.getSequence(refName, start, regionEnd);
|
|
72
75
|
if (seq) {
|
|
73
76
|
observer.next(new simpleFeature_1.default({
|
|
74
77
|
id: `${refName} ${start}-${regionEnd}`,
|
|
@@ -78,11 +81,6 @@ class TwoBitAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
78
81
|
observer.complete();
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
|
|
82
|
-
* called to provide a hint that data tied to a certain region
|
|
83
|
-
* will not be needed for the foreseeable future and can be purged
|
|
84
|
-
* from caches, etc
|
|
85
|
-
*/
|
|
86
|
-
freeResources( /* { region } */) { }
|
|
84
|
+
freeResources() { }
|
|
87
85
|
}
|
|
88
86
|
exports.default = TwoBitAdapter;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const TwoBitAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
twoBitLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const TwoBitAdapter: import("@jbrowse/core/configuration/configurationSc
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
chromSizesLocation: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: {
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config TwoBitAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const TwoBitAdapter = (0, configuration_1.ConfigurationSchema)('TwoBitAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
twoBitLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
8
|
defaultValue: { uri: '/path/to/my.2bit', locationType: 'UriLocation' },
|
|
15
9
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
10
|
chromSizesLocation: {
|
|
20
11
|
type: 'fileLocation',
|
|
21
12
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function TwoBitAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BaseSequenceAdapter
|
|
2
|
-
import {
|
|
3
|
-
import { Feature } from '@jbrowse/core/util';
|
|
1
|
+
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
4
5
|
declare function parseSmallFasta(text: string): Map<string, {
|
|
5
6
|
readonly description: string;
|
|
6
7
|
readonly sequence: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
3
4
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
5
|
+
const util_1 = require("@jbrowse/core/util");
|
|
4
6
|
const io_1 = require("@jbrowse/core/util/io");
|
|
5
7
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
6
|
-
const util_1 = require("@jbrowse/core/util");
|
|
7
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
8
8
|
function parseSmallFasta(text) {
|
|
9
9
|
return new Map(text
|
|
10
10
|
.split('>')
|
|
@@ -82,6 +82,6 @@ class UnindexedFastaAdapter extends BaseAdapter_1.BaseSequenceAdapter {
|
|
|
82
82
|
observer.complete();
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
freeResources(
|
|
85
|
+
freeResources() { }
|
|
86
86
|
}
|
|
87
87
|
exports.default = UnindexedFastaAdapter;
|
|
@@ -4,9 +4,6 @@ declare const UnindexedFastaAdapter: import("@jbrowse/core/configuration/configu
|
|
|
4
4
|
defaultValue: string;
|
|
5
5
|
contextVariable: string[];
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
7
|
fastaLocation: {
|
|
11
8
|
type: string;
|
|
12
9
|
defaultValue: {
|
|
@@ -14,9 +11,6 @@ declare const UnindexedFastaAdapter: import("@jbrowse/core/configuration/configu
|
|
|
14
11
|
locationType: string;
|
|
15
12
|
};
|
|
16
13
|
};
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
14
|
metadataLocation: {
|
|
21
15
|
description: string;
|
|
22
16
|
type: string;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config UnindexedFastaAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const UnindexedFastaAdapter = (0, configuration_1.ConfigurationSchema)('UnindexedFastaAdapter', {
|
|
9
6
|
rewriteRefNames: {
|
|
10
7
|
type: 'string',
|
|
11
8
|
defaultValue: '',
|
|
12
9
|
contextVariable: ['refName'],
|
|
13
10
|
},
|
|
14
|
-
/**
|
|
15
|
-
* #slot
|
|
16
|
-
*/
|
|
17
11
|
fastaLocation: {
|
|
18
12
|
type: 'fileLocation',
|
|
19
13
|
defaultValue: {
|
|
@@ -21,9 +15,6 @@ const UnindexedFastaAdapter = (0, configuration_1.ConfigurationSchema)('Unindexe
|
|
|
21
15
|
locationType: 'UriLocation',
|
|
22
16
|
},
|
|
23
17
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot
|
|
26
|
-
*/
|
|
27
18
|
metadataLocation: {
|
|
28
19
|
description: 'Optional metadata file',
|
|
29
20
|
type: 'fileLocation',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function UnindexedFastaAdapterF(pluginManager: PluginManager): void;
|
|
@@ -30,13 +30,15 @@ exports.default = UnindexedFastaAdapterF;
|
|
|
30
30
|
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
31
31
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
32
32
|
function UnindexedFastaAdapterF(pluginManager) {
|
|
33
|
-
pluginManager.addAdapterType(() =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
pluginManager.addAdapterType(() => {
|
|
34
|
+
return new AdapterType_1.default({
|
|
35
|
+
name: 'UnindexedFastaAdapter',
|
|
36
|
+
displayName: 'Unindexed FASTA adapter',
|
|
37
|
+
configSchema: configSchema_1.default,
|
|
38
|
+
adapterMetadata: {
|
|
39
|
+
hiddenFromGUI: true,
|
|
40
|
+
},
|
|
41
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./UnindexedFastaAdapter'))).then(r => r.default),
|
|
42
|
+
});
|
|
43
|
+
});
|
|
42
44
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ExtensionPointsF(pluginManager: PluginManager): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class SequencePlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
7
|
-
const TwoBitAdapter_1 = __importDefault(require("./TwoBitAdapter"));
|
|
8
|
-
const DivSequenceRenderer_1 = __importDefault(require("./DivSequenceRenderer"));
|
|
9
7
|
const BgzipFastaAdapter_1 = __importDefault(require("./BgzipFastaAdapter"));
|
|
10
8
|
const ChromSizesAdapter_1 = __importDefault(require("./ChromSizesAdapter"));
|
|
9
|
+
const DivSequenceRenderer_1 = __importDefault(require("./DivSequenceRenderer"));
|
|
11
10
|
const IndexedFastaAdapter_1 = __importDefault(require("./IndexedFastaAdapter"));
|
|
12
|
-
const UnindexedFastaAdapter_1 = __importDefault(require("./UnindexedFastaAdapter"));
|
|
13
|
-
const SequenceSearchAdapter_1 = __importDefault(require("./SequenceSearchAdapter"));
|
|
14
|
-
const ReferenceSequenceTrack_1 = __importDefault(require("./ReferenceSequenceTrack"));
|
|
15
11
|
const LinearReferenceSequenceDisplay_1 = __importDefault(require("./LinearReferenceSequenceDisplay"));
|
|
12
|
+
const ReferenceSequenceTrack_1 = __importDefault(require("./ReferenceSequenceTrack"));
|
|
13
|
+
const SequenceSearchAdapter_1 = __importDefault(require("./SequenceSearchAdapter"));
|
|
14
|
+
const TwoBitAdapter_1 = __importDefault(require("./TwoBitAdapter"));
|
|
15
|
+
const UnindexedFastaAdapter_1 = __importDefault(require("./UnindexedFastaAdapter"));
|
|
16
16
|
const createExtensionPoints_1 = __importDefault(require("./createExtensionPoints"));
|
|
17
17
|
class SequencePlugin extends Plugin_1.default {
|
|
18
18
|
constructor() {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
fastaLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
faiLocation: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: {
|
|
@@ -19,9 +13,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
19
13
|
locationType: string;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
16
|
metadataLocation: {
|
|
26
17
|
description: string;
|
|
27
18
|
type: string;
|
|
@@ -30,9 +21,6 @@ declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurati
|
|
|
30
21
|
locationType: string;
|
|
31
22
|
};
|
|
32
23
|
};
|
|
33
|
-
/**
|
|
34
|
-
* #slot
|
|
35
|
-
*/
|
|
36
24
|
gziLocation: {
|
|
37
25
|
type: string;
|
|
38
26
|
defaultValue: {
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config BgzipFastaAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const BgzipFastaAdapter = ConfigurationSchema('BgzipFastaAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
fastaLocation: {
|
|
11
5
|
type: 'fileLocation',
|
|
12
6
|
defaultValue: { uri: '/path/to/seq.fa.gz', locationType: 'UriLocation' },
|
|
13
7
|
},
|
|
14
|
-
/**
|
|
15
|
-
* #slot
|
|
16
|
-
*/
|
|
17
8
|
faiLocation: {
|
|
18
9
|
type: 'fileLocation',
|
|
19
10
|
defaultValue: {
|
|
@@ -21,9 +12,6 @@ const BgzipFastaAdapter = ConfigurationSchema('BgzipFastaAdapter', {
|
|
|
21
12
|
locationType: 'UriLocation',
|
|
22
13
|
},
|
|
23
14
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot
|
|
26
|
-
*/
|
|
27
15
|
metadataLocation: {
|
|
28
16
|
description: 'Optional metadata file',
|
|
29
17
|
type: 'fileLocation',
|
|
@@ -32,9 +20,6 @@ const BgzipFastaAdapter = ConfigurationSchema('BgzipFastaAdapter', {
|
|
|
32
20
|
locationType: 'UriLocation',
|
|
33
21
|
},
|
|
34
22
|
},
|
|
35
|
-
/**
|
|
36
|
-
* #slot
|
|
37
|
-
*/
|
|
38
23
|
gziLocation: {
|
|
39
24
|
type: 'fileLocation',
|
|
40
25
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function BgzipFastaAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
2
|
import configSchema from './configSchema';
|
|
3
3
|
export default function BgzipFastaAdapterF(pluginManager) {
|
|
4
|
-
pluginManager.addAdapterType(() =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
pluginManager.addAdapterType(() => {
|
|
5
|
+
return new AdapterType({
|
|
6
|
+
name: 'BgzipFastaAdapter',
|
|
7
|
+
displayName: 'Bgzip-indexed FASTA adapter',
|
|
8
|
+
configSchema,
|
|
9
|
+
adapterMetadata: {
|
|
10
|
+
hiddenFromGUI: true,
|
|
11
|
+
},
|
|
12
|
+
getAdapterClass: () => import('./BgzipFastaAdapter').then(r => r.default),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
13
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
3
|
export default class ChromSizesAdapter extends BaseAdapter implements RegionsAdapter {
|
|
3
4
|
protected setupP?: Promise<Record<string, number>>;
|
|
4
5
|
setupPre(): Promise<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAdapter
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
3
|
export default class ChromSizesAdapter extends BaseAdapter {
|
|
4
4
|
async setupPre() {
|
|
@@ -34,5 +34,5 @@ export default class ChromSizesAdapter extends BaseAdapter {
|
|
|
34
34
|
getHeader() {
|
|
35
35
|
return {};
|
|
36
36
|
}
|
|
37
|
-
freeResources(
|
|
37
|
+
freeResources() { }
|
|
38
38
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config ChromSizesAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const ChromSizesAdapter = ConfigurationSchema('ChromSizesAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
chromSizesLocation: {
|
|
11
5
|
type: 'fileLocation',
|
|
12
6
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ChromSizesAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import { Feature, Region } from '@jbrowse/core/util';
|
|
4
|
-
import { Theme } from '@mui/material';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
|
+
import type { Theme } from '@mui/material';
|
|
5
5
|
declare const DivSequenceRendering: (props: {
|
|
6
6
|
exportSVG?: {
|
|
7
7
|
rasterizeLayers: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
3
|
+
import { bpSpanPx, complement, defaultCodonTable, defaultStarts, defaultStops, generateCodonTable, revcom, } from '@jbrowse/core/util';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
|
-
import { bpSpanPx, revcom, complement, defaultStarts, defaultStops, defaultCodonTable, generateCodonTable, } from '@jbrowse/core/util';
|
|
5
5
|
function Translation({ codonTable, seq, frame, bpPerPx, colorByCDS, region, seqStart, height, y, reverse = false, theme, }) {
|
|
6
6
|
var _a, _b;
|
|
7
7
|
const normalizedFrame = Math.abs(frame) - 1;
|
|
@@ -44,7 +44,7 @@ function Translation({ codonTable, seq, frame, bpPerPx, colorByCDS, region, seqS
|
|
|
44
44
|
return !(renderLetter || codonFill) ? null : (React.createElement(React.Fragment, { key: `${index}-${letter}` },
|
|
45
45
|
React.createElement("rect", { x: x, y: y, width: renderLetter
|
|
46
46
|
? codonWidth
|
|
47
|
-
: codonWidth + 0.7
|
|
47
|
+
: codonWidth + 0.7, height: height, stroke: renderLetter ? '#555' : 'none', fill: codonFill || 'none' }),
|
|
48
48
|
renderLetter ? (React.createElement("text", { x: x + codonWidth / 2, fontSize: height - 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle" }, letter)) : null));
|
|
49
49
|
})));
|
|
50
50
|
}
|
|
@@ -58,13 +58,11 @@ function Sequence({ bpPerPx, region, feature, sequenceType, theme, height, seq,
|
|
|
58
58
|
const w = Math.max((rightPx - leftPx) / len, 0.8);
|
|
59
59
|
return (React.createElement(React.Fragment, null, seq.split('').map((letter, index) => {
|
|
60
60
|
const color = sequenceType === 'dna'
|
|
61
|
-
?
|
|
61
|
+
?
|
|
62
62
|
theme.palette.bases[letter.toUpperCase()]
|
|
63
63
|
: undefined;
|
|
64
64
|
const x = reverse ? rightPx - (index + 1) * w : leftPx + index * w;
|
|
65
|
-
return (
|
|
66
|
-
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
67
|
-
React.createElement(React.Fragment, { key: `${letter}-${index}` },
|
|
65
|
+
return (React.createElement(React.Fragment, { key: `${letter}-${index}` },
|
|
68
66
|
React.createElement("rect", { x: x, y: y, width: w, height: height, fill: color ? color.main : '#aaa', stroke: render ? '#555' : 'none' }),
|
|
69
67
|
render ? (React.createElement("text", { x: x + w / 2, y: y + height / 2, dominantBaseline: "middle", textAnchor: "middle", fontSize: height - 2, fill: color ? theme.palette.getContrastText(color.main) : 'black' }, letter)) : null));
|
|
70
68
|
})));
|
|
@@ -81,13 +79,10 @@ function SequenceSVG({ regions, theme: configTheme, colorByCDS, features = new M
|
|
|
81
79
|
if (!seq) {
|
|
82
80
|
return null;
|
|
83
81
|
}
|
|
84
|
-
// incrementer for the y-position of the current sequence being rendered
|
|
85
|
-
// (applies to both translation rows and dna rows)
|
|
86
82
|
let currY = -rowHeight;
|
|
87
83
|
const showSequence = bpPerPx <= 1;
|
|
88
84
|
const forwardFrames = showTranslation && showForward ? [3, 2, 1] : [];
|
|
89
85
|
const reverseFrames = showTranslation && showReverse ? [-1, -2, -3] : [];
|
|
90
|
-
// if region.reversed, the forward translation is on bottom, reverse on top
|
|
91
86
|
const [topFrames, bottomFrames] = region.reversed
|
|
92
87
|
? [reverseFrames.toReversed(), forwardFrames.toReversed()]
|
|
93
88
|
: [forwardFrames, reverseFrames];
|
|
@@ -99,7 +94,6 @@ function SequenceSVG({ regions, theme: configTheme, colorByCDS, features = new M
|
|
|
99
94
|
}
|
|
100
95
|
function Wrapper({ exportSVG, width, totalHeight, children, }) {
|
|
101
96
|
return exportSVG ? (children) : (React.createElement("svg", { "data-testid": "sequence_track", width: width, height: totalHeight, style: {
|
|
102
|
-
// use block because svg by default is inline, which adds a margin
|
|
103
97
|
display: 'block',
|
|
104
98
|
width,
|
|
105
99
|
height: totalHeight,
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config DivSequenceRenderer
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const DivSequenceRenderer = ConfigurationSchema('DivSequenceRenderer', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
height: {
|
|
11
5
|
type: 'number',
|
|
12
6
|
description: 'height in pixels of each line of sequence',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function DivSequenceRendererF(pluginManager: PluginManager): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import FeatureRendererType from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType';
|
|
2
2
|
import ReactComponent from './components/DivSequenceRendering';
|
|
3
3
|
import configSchema from './configSchema';
|
|
4
|
-
/* adjust in both directions */
|
|
5
4
|
class DivSequenceRenderer extends FeatureRendererType {
|
|
6
5
|
constructor() {
|
|
7
6
|
super(...arguments);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { IndexedFasta } from '@gmod/indexedfasta';
|
|
2
|
-
import { BaseSequenceAdapter
|
|
3
|
-
import {
|
|
4
|
-
import { Feature } from '@jbrowse/core/util';
|
|
2
|
+
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
5
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
5
6
|
export default class IndexedFastaAdapter extends BaseSequenceAdapter {
|
|
6
7
|
protected setupP?: Promise<{
|
|
7
8
|
fasta: IndexedFasta;
|
|
8
9
|
}>;
|
|
9
10
|
private seqCache;
|
|
10
|
-
getRefNames(
|
|
11
|
-
getRegions(
|
|
11
|
+
getRefNames(_opts?: BaseOptions): Promise<string[]>;
|
|
12
|
+
getRegions(_opts?: BaseOptions): Promise<{
|
|
12
13
|
refName: string;
|
|
13
14
|
start: number;
|
|
14
15
|
end: number;
|
|
@@ -21,10 +22,5 @@ export default class IndexedFastaAdapter extends BaseSequenceAdapter {
|
|
|
21
22
|
fasta: IndexedFasta;
|
|
22
23
|
}>;
|
|
23
24
|
getFeatures(region: NoAssemblyRegion, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
24
|
-
/**
|
|
25
|
-
* called to provide a hint that data tied to a certain region
|
|
26
|
-
* will not be needed for the foreseeable future and can be purged
|
|
27
|
-
* from caches, etc
|
|
28
|
-
*/
|
|
29
25
|
freeResources(): void;
|
|
30
26
|
}
|