@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
|
@@ -1,70 +1,37 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// for the ReferenceSequenceTrack
|
|
6
|
-
/**
|
|
7
|
-
* #config ReferenceSequenceTrack
|
|
8
|
-
* used to display base level DNA sequence tracks
|
|
9
|
-
*/
|
|
10
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
function x() { }
|
|
11
4
|
export function createReferenceSeqTrackConfig(pluginManager) {
|
|
12
5
|
return ConfigurationSchema('ReferenceSequenceTrack', {
|
|
13
|
-
/**
|
|
14
|
-
* #slot
|
|
15
|
-
* configuration for track adapter
|
|
16
|
-
*/
|
|
17
6
|
adapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
18
|
-
/**
|
|
19
|
-
* #slot
|
|
20
|
-
* configuration for the displays e.g. LinearReferenceSequenceDisplay
|
|
21
|
-
*/
|
|
22
7
|
displays: types.array(pluginManager.pluggableConfigSchemaType('display')),
|
|
23
|
-
/**
|
|
24
|
-
* #slot
|
|
25
|
-
*/
|
|
26
8
|
name: {
|
|
27
9
|
type: 'string',
|
|
28
10
|
description: 'optional track name, otherwise uses the "Reference sequence (assemblyName)"',
|
|
29
11
|
defaultValue: '',
|
|
30
12
|
},
|
|
31
|
-
/**
|
|
32
|
-
* #slot
|
|
33
|
-
*/
|
|
34
13
|
sequenceType: {
|
|
35
14
|
type: 'string',
|
|
36
15
|
description: 'either dna or pep',
|
|
37
16
|
defaultValue: 'dna',
|
|
38
17
|
},
|
|
39
|
-
/**
|
|
40
|
-
* #slot
|
|
41
|
-
*/
|
|
42
18
|
description: {
|
|
43
19
|
description: 'a description of the track',
|
|
44
20
|
type: 'string',
|
|
45
21
|
defaultValue: '',
|
|
46
22
|
},
|
|
47
|
-
/**
|
|
48
|
-
* #slot
|
|
49
|
-
*/
|
|
50
23
|
metadata: {
|
|
51
24
|
type: 'frozen',
|
|
52
25
|
description: 'anything to add about this track',
|
|
53
26
|
defaultValue: {},
|
|
54
27
|
},
|
|
55
28
|
formatAbout: ConfigurationSchema('FormatAbout', {
|
|
56
|
-
/**
|
|
57
|
-
* #slot formatAbout.config
|
|
58
|
-
*/
|
|
59
29
|
config: {
|
|
60
30
|
type: 'frozen',
|
|
61
31
|
description: 'formats configuration in about dialog',
|
|
62
32
|
defaultValue: {},
|
|
63
33
|
contextVariable: ['config'],
|
|
64
34
|
},
|
|
65
|
-
/**
|
|
66
|
-
* #slot formatAbout.hideUris
|
|
67
|
-
*/
|
|
68
35
|
hideUris: {
|
|
69
36
|
type: 'boolean',
|
|
70
37
|
defaultValue: false,
|
|
@@ -76,9 +43,6 @@ export function createReferenceSeqTrackConfig(pluginManager) {
|
|
|
76
43
|
const displayTypes = new Set();
|
|
77
44
|
const { displays = [] } = snap;
|
|
78
45
|
if (snap.trackId !== 'placeholderId') {
|
|
79
|
-
// Gets the displays on the track snapshot and the possible displays
|
|
80
|
-
// from the track type and adds any missing possible displays to the
|
|
81
|
-
// snapshot
|
|
82
46
|
displays.forEach((d) => d && displayTypes.add(d.type));
|
|
83
47
|
const trackType = pluginManager.getTrackType(snap.type);
|
|
84
48
|
trackType === null || trackType === void 0 ? void 0 : trackType.displayTypes.forEach(displayType => {
|
|
@@ -92,10 +56,6 @@ export function createReferenceSeqTrackConfig(pluginManager) {
|
|
|
92
56
|
}
|
|
93
57
|
return { ...snap, displays };
|
|
94
58
|
},
|
|
95
|
-
/**
|
|
96
|
-
* #identifier
|
|
97
|
-
* all tracks have a globally unique 'trackId'
|
|
98
|
-
*/
|
|
99
59
|
explicitIdentifier: 'trackId',
|
|
100
60
|
explicitlyTyped: true,
|
|
101
61
|
actions: (self) => ({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ReferenceSequenceTrackF(pluginManager: PluginManager): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
2
|
-
import {
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
3
4
|
export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
4
5
|
configure(): Promise<BaseFeatureDataAdapter>;
|
|
5
6
|
getRefNames(): Promise<string[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import { SimpleFeature, doesIntersect2, revcom } from '@jbrowse/core/util';
|
|
2
3
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
3
|
-
import { SimpleFeature, revcom, doesIntersect2, } from '@jbrowse/core/util';
|
|
4
|
-
import { toArray } from 'rxjs/operators';
|
|
5
4
|
import { firstValueFrom } from 'rxjs';
|
|
5
|
+
import { toArray } from 'rxjs/operators';
|
|
6
6
|
export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
7
7
|
async configure() {
|
|
8
8
|
var _a;
|
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
search: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: string;
|
|
8
5
|
description: string;
|
|
9
6
|
};
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
7
|
sequenceAdapter: {
|
|
14
8
|
type: string;
|
|
15
9
|
defaultValue: null;
|
|
16
10
|
};
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
11
|
searchForward: {
|
|
21
12
|
type: string;
|
|
22
13
|
defaultValue: boolean;
|
|
23
14
|
};
|
|
24
|
-
/**
|
|
25
|
-
* #slot
|
|
26
|
-
*/
|
|
27
15
|
searchReverse: {
|
|
28
16
|
type: string;
|
|
29
17
|
defaultValue: boolean;
|
|
30
18
|
};
|
|
31
|
-
/**
|
|
32
|
-
* #slot
|
|
33
|
-
*/
|
|
34
19
|
caseInsensitive: {
|
|
35
20
|
type: string;
|
|
36
21
|
defaultValue: boolean;
|
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config SequenceSearchAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const configSchema = ConfigurationSchema('SequenceSearchAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
search: {
|
|
11
5
|
type: 'string',
|
|
12
6
|
defaultValue: '',
|
|
13
7
|
description: 'Search string or regex to search for',
|
|
14
8
|
},
|
|
15
|
-
/**
|
|
16
|
-
* #slot
|
|
17
|
-
*/
|
|
18
9
|
sequenceAdapter: {
|
|
19
10
|
type: 'frozen',
|
|
20
11
|
defaultValue: null,
|
|
21
12
|
},
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
13
|
searchForward: {
|
|
26
14
|
type: 'boolean',
|
|
27
15
|
defaultValue: true,
|
|
28
16
|
},
|
|
29
|
-
/**
|
|
30
|
-
* #slot
|
|
31
|
-
*/
|
|
32
17
|
searchReverse: {
|
|
33
18
|
type: 'boolean',
|
|
34
19
|
defaultValue: true,
|
|
35
20
|
},
|
|
36
|
-
/**
|
|
37
|
-
* #slot
|
|
38
|
-
*/
|
|
39
21
|
caseInsensitive: {
|
|
40
22
|
type: 'boolean',
|
|
41
23
|
defaultValue: true,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function SequenceSearchAdapterF(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 SequenceSearchAdapterF(pluginManager) {
|
|
4
|
-
pluginManager.addAdapterType(() =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
pluginManager.addAdapterType(() => {
|
|
5
|
+
return new AdapterType({
|
|
6
|
+
name: 'SequenceSearchAdapter',
|
|
7
|
+
displayName: 'Sequence search adapter',
|
|
8
|
+
adapterMetadata: {
|
|
9
|
+
hiddenFromGUI: true,
|
|
10
|
+
},
|
|
11
|
+
configSchema,
|
|
12
|
+
getAdapterClass: () => import('./SequenceSearchAdapter').then(r => r.default),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
13
15
|
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
+
import { TwoBitFile } from '@gmod/twobit';
|
|
1
2
|
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
5
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
6
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
7
5
|
export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
protected setupP?: Promise<{
|
|
7
|
+
twobit: TwoBitFile;
|
|
8
|
+
chromSizesData: Record<string, number> | undefined;
|
|
9
|
+
}>;
|
|
10
10
|
private initChromSizes;
|
|
11
|
-
|
|
11
|
+
setupPre(): Promise<{
|
|
12
|
+
twobit: TwoBitFile;
|
|
13
|
+
chromSizesData: {
|
|
14
|
+
[k: string]: number;
|
|
15
|
+
} | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
setup(): Promise<{
|
|
18
|
+
twobit: TwoBitFile;
|
|
19
|
+
chromSizesData: Record<string, number> | undefined;
|
|
20
|
+
}>;
|
|
12
21
|
getRefNames(): Promise<string[]>;
|
|
13
|
-
getRegions(): Promise<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
22
|
+
getRegions(): Promise<{
|
|
23
|
+
refName: string;
|
|
24
|
+
start: number;
|
|
25
|
+
end: number;
|
|
26
|
+
}[]>;
|
|
19
27
|
getFeatures({ refName, start, end }: NoAssemblyRegion): import("rxjs").Observable<Feature>;
|
|
20
|
-
/**
|
|
21
|
-
* called to provide a hint that data tied to a certain region
|
|
22
|
-
* will not be needed for the foreseeable future and can be purged
|
|
23
|
-
* from caches, etc
|
|
24
|
-
*/
|
|
25
28
|
freeResources(): void;
|
|
26
29
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { TwoBitFile } from '@gmod/twobit';
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
1
3
|
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
5
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
6
|
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
5
|
-
import { TwoBitFile } from '@gmod/twobit';
|
|
6
|
-
import { readConfObject } from '@jbrowse/core/configuration';
|
|
7
7
|
export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
8
8
|
async initChromSizes() {
|
|
9
9
|
const conf = readConfObject(this.config, 'chromSizesLocation');
|
|
10
|
-
// check against default and empty in case someone makes the field blank in
|
|
11
|
-
// config editor, may want better way to check "optional config slots" in
|
|
12
|
-
// future
|
|
13
10
|
if (conf.uri !== '/path/to/default.chrom.sizes' && conf.uri !== '') {
|
|
14
11
|
const file = openLocation(conf, this.pluginManager);
|
|
15
12
|
const data = await file.readFile('utf8');
|
|
@@ -23,23 +20,31 @@ export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
|
23
20
|
}
|
|
24
21
|
return undefined;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
23
|
+
async setupPre() {
|
|
24
|
+
return {
|
|
25
|
+
twobit: new TwoBitFile({
|
|
26
|
+
filehandle: openLocation(this.getConf('twoBitLocation'), this.pluginManager),
|
|
27
|
+
}),
|
|
28
|
+
chromSizesData: await this.initChromSizes(),
|
|
29
|
+
};
|
|
33
30
|
}
|
|
34
|
-
async
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
async setup() {
|
|
32
|
+
if (!this.setupP) {
|
|
33
|
+
this.setupP = this.setupPre().catch((e) => {
|
|
34
|
+
this.setupP = undefined;
|
|
35
|
+
throw e;
|
|
36
|
+
});
|
|
38
37
|
}
|
|
39
|
-
return this.
|
|
38
|
+
return this.setupP;
|
|
39
|
+
}
|
|
40
|
+
async getRefNames() {
|
|
41
|
+
const { chromSizesData, twobit } = await this.setup();
|
|
42
|
+
return chromSizesData
|
|
43
|
+
? Object.keys(chromSizesData)
|
|
44
|
+
: twobit.getSequenceNames();
|
|
40
45
|
}
|
|
41
46
|
async getRegions() {
|
|
42
|
-
const chromSizesData = await this.
|
|
47
|
+
const { chromSizesData, twobit } = await this.setup();
|
|
43
48
|
if (chromSizesData) {
|
|
44
49
|
return Object.keys(chromSizesData).map(refName => ({
|
|
45
50
|
refName,
|
|
@@ -47,23 +52,21 @@ export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
|
47
52
|
end: chromSizesData[refName],
|
|
48
53
|
}));
|
|
49
54
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
refName
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
else {
|
|
56
|
+
const refSizes = await twobit.getSequenceSizes();
|
|
57
|
+
return Object.keys(refSizes).map(refName => ({
|
|
58
|
+
refName,
|
|
59
|
+
start: 0,
|
|
60
|
+
end: refSizes[refName],
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Fetch features for a certain region
|
|
59
|
-
* @param param -
|
|
60
|
-
* @returns Observable of Feature objects in the region
|
|
61
|
-
*/
|
|
62
64
|
getFeatures({ refName, start, end }) {
|
|
63
65
|
return ObservableCreate(async (observer) => {
|
|
64
|
-
const
|
|
66
|
+
const { twobit } = await this.setup();
|
|
67
|
+
const size = await twobit.getSequenceSize(refName);
|
|
65
68
|
const regionEnd = size !== undefined ? Math.min(size, end) : end;
|
|
66
|
-
const seq = await
|
|
69
|
+
const seq = await twobit.getSequence(refName, start, regionEnd);
|
|
67
70
|
if (seq) {
|
|
68
71
|
observer.next(new SimpleFeature({
|
|
69
72
|
id: `${refName} ${start}-${regionEnd}`,
|
|
@@ -73,10 +76,5 @@ export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
|
73
76
|
observer.complete();
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
|
-
|
|
77
|
-
* called to provide a hint that data tied to a certain region
|
|
78
|
-
* will not be needed for the foreseeable future and can be purged
|
|
79
|
-
* from caches, etc
|
|
80
|
-
*/
|
|
81
|
-
freeResources( /* { region } */) { }
|
|
79
|
+
freeResources() { }
|
|
82
80
|
}
|
|
@@ -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,19 +1,10 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config TwoBitAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const TwoBitAdapter = ConfigurationSchema('TwoBitAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
twoBitLocation: {
|
|
11
5
|
type: 'fileLocation',
|
|
12
6
|
defaultValue: { uri: '/path/to/my.2bit', locationType: 'UriLocation' },
|
|
13
7
|
},
|
|
14
|
-
/**
|
|
15
|
-
* #slot
|
|
16
|
-
*/
|
|
17
8
|
chromSizesLocation: {
|
|
18
9
|
type: 'fileLocation',
|
|
19
10
|
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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
+
import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import { SimpleFeature } from '@jbrowse/core/util';
|
|
2
4
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
5
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
|
-
import { SimpleFeature } from '@jbrowse/core/util';
|
|
5
|
-
import { readConfObject } from '@jbrowse/core/configuration';
|
|
6
6
|
function parseSmallFasta(text) {
|
|
7
7
|
return new Map(text
|
|
8
8
|
.split('>')
|
|
@@ -80,5 +80,5 @@ export default class UnindexedFastaAdapter extends BaseSequenceAdapter {
|
|
|
80
80
|
observer.complete();
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
freeResources(
|
|
83
|
+
freeResources() { }
|
|
84
84
|
}
|
|
@@ -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,17 +1,11 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config UnindexedFastaAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const UnindexedFastaAdapter = ConfigurationSchema('UnindexedFastaAdapter', {
|
|
7
4
|
rewriteRefNames: {
|
|
8
5
|
type: 'string',
|
|
9
6
|
defaultValue: '',
|
|
10
7
|
contextVariable: ['refName'],
|
|
11
8
|
},
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
fastaLocation: {
|
|
16
10
|
type: 'fileLocation',
|
|
17
11
|
defaultValue: {
|
|
@@ -19,9 +13,6 @@ const UnindexedFastaAdapter = ConfigurationSchema('UnindexedFastaAdapter', {
|
|
|
19
13
|
locationType: 'UriLocation',
|
|
20
14
|
},
|
|
21
15
|
},
|
|
22
|
-
/**
|
|
23
|
-
* #slot
|
|
24
|
-
*/
|
|
25
16
|
metadataLocation: {
|
|
26
17
|
description: 'Optional metadata file',
|
|
27
18
|
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;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
2
|
import configSchema from './configSchema';
|
|
3
3
|
export default function UnindexedFastaAdapterF(pluginManager) {
|
|
4
|
-
pluginManager.addAdapterType(() =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
pluginManager.addAdapterType(() => {
|
|
5
|
+
return new AdapterType({
|
|
6
|
+
name: 'UnindexedFastaAdapter',
|
|
7
|
+
displayName: 'Unindexed FASTA adapter',
|
|
8
|
+
configSchema,
|
|
9
|
+
adapterMetadata: {
|
|
10
|
+
hiddenFromGUI: true,
|
|
11
|
+
},
|
|
12
|
+
getAdapterClass: () => import('./UnindexedFastaAdapter').then(r => r.default),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
13
15
|
}
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFileName, makeIndex } from '@jbrowse/core/util/tracks';
|
|
2
2
|
export default function ExtensionPointsF(pluginManager) {
|
|
3
3
|
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
|
|
4
4
|
return (file, index, adapterHint) => {
|
package/esm/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/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import TwoBitAdapterF from './TwoBitAdapter';
|
|
3
|
-
import DivSequenceRendererF from './DivSequenceRenderer';
|
|
4
2
|
import BgzipFastaAdapterF from './BgzipFastaAdapter';
|
|
5
3
|
import ChromSizesAdapterF from './ChromSizesAdapter';
|
|
4
|
+
import DivSequenceRendererF from './DivSequenceRenderer';
|
|
6
5
|
import IndexedFastaAdapterF from './IndexedFastaAdapter';
|
|
7
|
-
import UnindexedFastaAdapterF from './UnindexedFastaAdapter';
|
|
8
|
-
import SequenceSearchAdapterF from './SequenceSearchAdapter';
|
|
9
|
-
import ReferenceSequenceTrackF from './ReferenceSequenceTrack';
|
|
10
6
|
import LinearReferenceSequenceDisplayF from './LinearReferenceSequenceDisplay';
|
|
7
|
+
import ReferenceSequenceTrackF from './ReferenceSequenceTrack';
|
|
8
|
+
import SequenceSearchAdapterF from './SequenceSearchAdapter';
|
|
9
|
+
import TwoBitAdapterF from './TwoBitAdapter';
|
|
10
|
+
import UnindexedFastaAdapterF from './UnindexedFastaAdapter';
|
|
11
11
|
import createExtensionPoints from './createExtensionPoints';
|
|
12
12
|
export default class SequencePlugin extends Plugin {
|
|
13
13
|
constructor() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-sequence",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "JBrowse 2 sequence adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"distModule": "esm/index.js",
|
|
58
58
|
"srcModule": "src/index.ts",
|
|
59
59
|
"module": "esm/index.js",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
|
|
61
61
|
}
|