@jbrowse/plugin-sequence 3.7.0 → 4.0.1
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/esm/BgzipFastaAdapter/BgzipFastaAdapter.d.ts +1 -1
- package/esm/BgzipFastaAdapter/BgzipFastaAdapter.js +1 -1
- package/esm/BgzipFastaAdapter/configSchema.d.ts +2 -2
- package/esm/BgzipFastaAdapter/index.js +2 -2
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js +1 -0
- package/esm/ChromSizesAdapter/configSchema.d.ts +2 -2
- package/esm/ChromSizesAdapter/index.js +2 -2
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +24 -7
- package/esm/DivSequenceRenderer/components/Sequence.js +20 -10
- package/esm/DivSequenceRenderer/components/Translation.js +27 -19
- package/esm/DivSequenceRenderer/configSchema.d.ts +2 -2
- package/esm/DivSequenceRenderer/index.js +6 -12
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +15 -23
- package/esm/IndexedFastaAdapter/configSchema.d.ts +2 -2
- package/esm/IndexedFastaAdapter/index.js +2 -2
- package/esm/LinearReferenceSequenceDisplay/configSchema.d.ts +4 -4
- package/esm/LinearReferenceSequenceDisplay/configSchema.js +1 -1
- package/esm/LinearReferenceSequenceDisplay/index.js +2 -2
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +1047 -104
- package/esm/LinearReferenceSequenceDisplay/model.js +16 -4
- package/esm/ReferenceSequenceTrack/configSchema.d.ts +6 -6
- package/esm/ReferenceSequenceTrack/configSchema.js +3 -3
- package/esm/ReferenceSequenceTrack/index.js +13 -2
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +2 -2
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.js +3 -9
- package/esm/SequenceSearchAdapter/configSchema.d.ts +2 -2
- package/esm/SequenceSearchAdapter/index.js +2 -2
- package/esm/TwoBitAdapter/TwoBitAdapter.js +1 -0
- package/esm/TwoBitAdapter/configSchema.d.ts +2 -2
- package/esm/TwoBitAdapter/index.js +2 -2
- package/esm/UnindexedFastaAdapter/UnindexedFastaAdapter.js +1 -0
- package/esm/UnindexedFastaAdapter/configSchema.d.ts +2 -2
- package/esm/UnindexedFastaAdapter/index.js +2 -2
- package/esm/index.js +11 -14
- package/esm/saveTrackFormats/fasta.d.ts +4 -0
- package/esm/saveTrackFormats/fasta.js +13 -0
- package/package.json +28 -34
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.d.ts +0 -7
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js +0 -22
- package/dist/BgzipFastaAdapter/configSchema.d.ts +0 -32
- package/dist/BgzipFastaAdapter/configSchema.js +0 -54
- package/dist/BgzipFastaAdapter/index.d.ts +0 -2
- package/dist/BgzipFastaAdapter/index.js +0 -54
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +0 -15
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +0 -40
- package/dist/ChromSizesAdapter/configSchema.d.ts +0 -10
- package/dist/ChromSizesAdapter/configSchema.js +0 -27
- package/dist/ChromSizesAdapter/index.d.ts +0 -2
- package/dist/ChromSizesAdapter/index.js +0 -52
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.d.ts +0 -18
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +0 -44
- package/dist/DivSequenceRenderer/components/Sequence.d.ts +0 -10
- package/dist/DivSequenceRenderer/components/Sequence.js +0 -25
- package/dist/DivSequenceRenderer/components/Translation.d.ts +0 -14
- package/dist/DivSequenceRenderer/components/Translation.js +0 -49
- package/dist/DivSequenceRenderer/configSchema.d.ts +0 -8
- package/dist/DivSequenceRenderer/configSchema.js +0 -12
- package/dist/DivSequenceRenderer/index.d.ts +0 -2
- package/dist/DivSequenceRenderer/index.js +0 -30
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +0 -25
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +0 -112
- package/dist/IndexedFastaAdapter/configSchema.d.ts +0 -25
- package/dist/IndexedFastaAdapter/configSchema.js +0 -40
- package/dist/IndexedFastaAdapter/index.d.ts +0 -2
- package/dist/IndexedFastaAdapter/index.js +0 -54
- package/dist/LinearReferenceSequenceDisplay/configSchema.d.ts +0 -9
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +0 -12
- package/dist/LinearReferenceSequenceDisplay/index.d.ts +0 -2
- package/dist/LinearReferenceSequenceDisplay/index.js +0 -21
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +0 -338
- package/dist/LinearReferenceSequenceDisplay/model.js +0 -132
- package/dist/ReferenceSequenceTrack/configSchema.d.ts +0 -37
- package/dist/ReferenceSequenceTrack/configSchema.js +0 -83
- package/dist/ReferenceSequenceTrack/index.d.ts +0 -2
- package/dist/ReferenceSequenceTrack/index.js +0 -20
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +0 -8
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.js +0 -84
- package/dist/SequenceSearchAdapter/configSchema.d.ts +0 -24
- package/dist/SequenceSearchAdapter/configSchema.js +0 -28
- package/dist/SequenceSearchAdapter/index.d.ts +0 -2
- package/dist/SequenceSearchAdapter/index.js +0 -54
- package/dist/TwoBitAdapter/TwoBitAdapter.d.ts +0 -28
- package/dist/TwoBitAdapter/TwoBitAdapter.js +0 -85
- package/dist/TwoBitAdapter/configSchema.d.ts +0 -18
- package/dist/TwoBitAdapter/configSchema.js +0 -43
- package/dist/TwoBitAdapter/index.d.ts +0 -2
- package/dist/TwoBitAdapter/index.js +0 -52
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.d.ts +0 -31
- package/dist/UnindexedFastaAdapter/UnindexedFastaAdapter.js +0 -86
- package/dist/UnindexedFastaAdapter/configSchema.d.ts +0 -23
- package/dist/UnindexedFastaAdapter/configSchema.js +0 -40
- package/dist/UnindexedFastaAdapter/index.d.ts +0 -2
- package/dist/UnindexedFastaAdapter/index.js +0 -54
- package/dist/createExtensionPoints.d.ts +0 -2
- package/dist/createExtensionPoints.js +0 -86
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -35
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
|
|
2
2
|
import { getContainingTrack, getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { getParentRenderProps } from '@jbrowse/core/util/tracks';
|
|
4
|
+
import { addDisposer, types } from '@jbrowse/mobx-state-tree';
|
|
4
5
|
import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
|
|
5
6
|
import { autorun } from 'mobx';
|
|
6
|
-
import { addDisposer, types } from 'mobx-state-tree';
|
|
7
7
|
export function modelFactory(configSchema) {
|
|
8
8
|
return types
|
|
9
9
|
.compose('LinearReferenceSequenceDisplay', BaseLinearDisplay, types.model({
|
|
@@ -81,7 +81,7 @@ export function modelFactory(configSchema) {
|
|
|
81
81
|
self.showTranslation = !self.showTranslation;
|
|
82
82
|
},
|
|
83
83
|
afterAttach() {
|
|
84
|
-
addDisposer(self, autorun(()
|
|
84
|
+
addDisposer(self, autorun(function sequenceHeightAutorun() {
|
|
85
85
|
const view = getContainingView(self);
|
|
86
86
|
if (view.bpPerPx > 3) {
|
|
87
87
|
self.setHeight(50);
|
|
@@ -89,7 +89,7 @@ export function modelFactory(configSchema) {
|
|
|
89
89
|
else {
|
|
90
90
|
self.setHeight(self.sequenceHeight);
|
|
91
91
|
}
|
|
92
|
-
}));
|
|
92
|
+
}, { name: 'SequenceHeight' }));
|
|
93
93
|
},
|
|
94
94
|
}))
|
|
95
95
|
.views(self => ({
|
|
@@ -125,5 +125,17 @@ export function modelFactory(configSchema) {
|
|
|
125
125
|
: []),
|
|
126
126
|
];
|
|
127
127
|
},
|
|
128
|
-
}))
|
|
128
|
+
}))
|
|
129
|
+
.postProcessSnapshot(snap => {
|
|
130
|
+
if (!snap) {
|
|
131
|
+
return snap;
|
|
132
|
+
}
|
|
133
|
+
const { showForward, showReverse, showTranslation, ...rest } = snap;
|
|
134
|
+
return {
|
|
135
|
+
...rest,
|
|
136
|
+
...(!showForward ? { showForward } : {}),
|
|
137
|
+
...(!showReverse ? { showReverse } : {}),
|
|
138
|
+
...(!showTranslation ? { showTranslation } : {}),
|
|
139
|
+
};
|
|
140
|
+
});
|
|
129
141
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
export declare function createReferenceSeqTrackConfig(pluginManager: PluginManager): import("
|
|
3
|
-
adapter: import("mobx-state-tree").IAnyModelType;
|
|
4
|
-
displays: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
2
|
+
export declare function createReferenceSeqTrackConfig(pluginManager: PluginManager): import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
|
+
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
4
|
+
displays: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyModelType>;
|
|
5
5
|
name: {
|
|
6
6
|
type: string;
|
|
7
7
|
description: string;
|
|
@@ -22,7 +22,7 @@ export declare function createReferenceSeqTrackConfig(pluginManager: PluginManag
|
|
|
22
22
|
description: string;
|
|
23
23
|
defaultValue: {};
|
|
24
24
|
};
|
|
25
|
-
formatAbout: import("
|
|
25
|
+
formatAbout: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
26
26
|
config: {
|
|
27
27
|
type: string;
|
|
28
28
|
description: string;
|
|
@@ -33,5 +33,5 @@ export declare function createReferenceSeqTrackConfig(pluginManager: PluginManag
|
|
|
33
33
|
type: string;
|
|
34
34
|
defaultValue: boolean;
|
|
35
35
|
};
|
|
36
|
-
}, import("
|
|
37
|
-
}, import("
|
|
36
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
37
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "trackId">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
import { types } from 'mobx-state-tree';
|
|
2
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
3
3
|
function x() { }
|
|
4
4
|
export function createReferenceSeqTrackConfig(pluginManager) {
|
|
5
5
|
return ConfigurationSchema('ReferenceSequenceTrack', {
|
|
@@ -49,7 +49,7 @@ export function createReferenceSeqTrackConfig(pluginManager) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
const trackType = pluginManager.getTrackType(snap.type);
|
|
52
|
-
for (const displayType of
|
|
52
|
+
for (const displayType of trackType?.displayTypes || []) {
|
|
53
53
|
if (!displayTypes.has(displayType.name)) {
|
|
54
54
|
displays.push({
|
|
55
55
|
displayId: `${snap.trackId}-${displayType.name}`,
|
|
@@ -68,7 +68,7 @@ export function createReferenceSeqTrackConfig(pluginManager) {
|
|
|
68
68
|
if (!type) {
|
|
69
69
|
throw new Error(`unknown display type ${type}`);
|
|
70
70
|
}
|
|
71
|
-
const display = self.displays.find((d) => d
|
|
71
|
+
const display = self.displays.find((d) => d?.displayId === displayConf.displayId);
|
|
72
72
|
if (display) {
|
|
73
73
|
return display;
|
|
74
74
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
2
2
|
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
-
import { createReferenceSeqTrackConfig } from
|
|
3
|
+
import { createReferenceSeqTrackConfig } from "./configSchema.js";
|
|
4
|
+
import { stringifyFASTA } from "../saveTrackFormats/fasta.js";
|
|
4
5
|
export default function ReferenceSequenceTrackF(pluginManager) {
|
|
5
6
|
pluginManager.addTrackType(() => {
|
|
6
7
|
const configSchema = createReferenceSeqTrackConfig(pluginManager);
|
|
@@ -8,7 +9,17 @@ export default function ReferenceSequenceTrackF(pluginManager) {
|
|
|
8
9
|
name: 'ReferenceSequenceTrack',
|
|
9
10
|
displayName: 'Reference sequence track',
|
|
10
11
|
configSchema,
|
|
11
|
-
stateModel: createBaseTrackModel(pluginManager, 'ReferenceSequenceTrack', configSchema)
|
|
12
|
+
stateModel: createBaseTrackModel(pluginManager, 'ReferenceSequenceTrack', configSchema).views(() => ({
|
|
13
|
+
saveTrackFileFormatOptions() {
|
|
14
|
+
return {
|
|
15
|
+
fasta: {
|
|
16
|
+
name: 'FASTA',
|
|
17
|
+
extension: 'fa',
|
|
18
|
+
callback: stringifyFASTA,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
})),
|
|
12
23
|
});
|
|
13
24
|
});
|
|
14
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseOptions, BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
4
|
export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
5
|
-
configure(): Promise<
|
|
5
|
+
configure(): Promise<BaseSequenceAdapter>;
|
|
6
6
|
getRefNames(): Promise<string[]>;
|
|
7
7
|
getFeatures(query: Region, opts: BaseOptions): import("rxjs").Observable<Feature>;
|
|
8
8
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { SimpleFeature, doesIntersect2, revcom } from '@jbrowse/core/util';
|
|
3
3
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
|
-
import { firstValueFrom } from 'rxjs';
|
|
5
|
-
import { toArray } from 'rxjs/operators';
|
|
6
4
|
export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
7
5
|
async configure() {
|
|
8
|
-
|
|
9
|
-
const adapter = await ((_a = this.getSubAdapter) === null || _a === void 0 ? void 0 : _a.call(this, this.getConf('sequenceAdapter')));
|
|
6
|
+
const adapter = await this.getSubAdapter?.(this.getConf('sequenceAdapter'));
|
|
10
7
|
if (!adapter) {
|
|
11
8
|
throw new Error('Error getting subadapter');
|
|
12
9
|
}
|
|
@@ -18,7 +15,6 @@ export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
|
18
15
|
}
|
|
19
16
|
getFeatures(query, opts) {
|
|
20
17
|
return ObservableCreate(async (observer) => {
|
|
21
|
-
var _a;
|
|
22
18
|
const sequenceAdapter = await this.configure();
|
|
23
19
|
const hw = 10000;
|
|
24
20
|
const queryEnd = query.end + hw;
|
|
@@ -27,13 +23,11 @@ export default class SequenceSearchAdapter extends BaseFeatureDataAdapter {
|
|
|
27
23
|
observer.complete();
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
const
|
|
26
|
+
const residues = (await sequenceAdapter.getSequence({
|
|
31
27
|
...query,
|
|
32
28
|
start: queryStart,
|
|
33
29
|
end: queryEnd,
|
|
34
|
-
}, opts);
|
|
35
|
-
const feats = await firstValueFrom(ret.pipe(toArray()));
|
|
36
|
-
const residues = ((_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq')) || '';
|
|
30
|
+
}, opts)) ?? '';
|
|
37
31
|
const search = this.getConf('search');
|
|
38
32
|
const searchForward = this.getConf('searchForward');
|
|
39
33
|
const searchReverse = this.getConf('searchReverse');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const configSchema: import("
|
|
1
|
+
declare const configSchema: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
search: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: string;
|
|
@@ -20,5 +20,5 @@ declare const configSchema: import("@jbrowse/core/configuration/configurationSch
|
|
|
20
20
|
type: string;
|
|
21
21
|
defaultValue: boolean;
|
|
22
22
|
};
|
|
23
|
-
}, import("
|
|
23
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
24
24
|
export default configSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function SequenceSearchAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => {
|
|
5
5
|
return new AdapterType({
|
|
@@ -9,7 +9,7 @@ export default function SequenceSearchAdapterF(pluginManager) {
|
|
|
9
9
|
hiddenFromGUI: true,
|
|
10
10
|
},
|
|
11
11
|
configSchema,
|
|
12
|
-
getAdapterClass: () => import(
|
|
12
|
+
getAdapterClass: () => import("./SequenceSearchAdapter.js").then(r => r.default),
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -5,6 +5,7 @@ import { openLocation } from '@jbrowse/core/util/io';
|
|
|
5
5
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
6
6
|
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
7
7
|
export default class TwoBitAdapter extends BaseSequenceAdapter {
|
|
8
|
+
setupP;
|
|
8
9
|
async initChromSizes() {
|
|
9
10
|
const conf = readConfObject(this.config, 'chromSizesLocation');
|
|
10
11
|
if (conf.uri !== '/path/to/default.chrom.sizes' && conf.uri !== '') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const TwoBitAdapter: import("
|
|
1
|
+
declare const TwoBitAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
twoBitLocation: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: {
|
|
@@ -14,5 +14,5 @@ declare const TwoBitAdapter: import("@jbrowse/core/configuration/configurationSc
|
|
|
14
14
|
};
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
|
-
}, import("
|
|
17
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
18
18
|
export default TwoBitAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function TwoBitAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
5
5
|
name: 'TwoBitAdapter',
|
|
@@ -8,6 +8,6 @@ export default function TwoBitAdapterF(pluginManager) {
|
|
|
8
8
|
adapterMetadata: {
|
|
9
9
|
hiddenFromGUI: true,
|
|
10
10
|
},
|
|
11
|
-
getAdapterClass: () => import(
|
|
11
|
+
getAdapterClass: () => import("./TwoBitAdapter.js").then(r => r.default),
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const UnindexedFastaAdapter: import("
|
|
1
|
+
declare const UnindexedFastaAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
rewriteRefNames: {
|
|
3
3
|
type: string;
|
|
4
4
|
defaultValue: string;
|
|
@@ -19,5 +19,5 @@ declare const UnindexedFastaAdapter: import("@jbrowse/core/configuration/configu
|
|
|
19
19
|
locationType: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
}, import("
|
|
22
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
23
23
|
export default UnindexedFastaAdapter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
|
|
2
|
-
import configSchema from
|
|
2
|
+
import configSchema from "./configSchema.js";
|
|
3
3
|
export default function UnindexedFastaAdapterF(pluginManager) {
|
|
4
4
|
pluginManager.addAdapterType(() => {
|
|
5
5
|
return new AdapterType({
|
|
@@ -9,7 +9,7 @@ export default function UnindexedFastaAdapterF(pluginManager) {
|
|
|
9
9
|
adapterMetadata: {
|
|
10
10
|
hiddenFromGUI: true,
|
|
11
11
|
},
|
|
12
|
-
getAdapterClass: () => import(
|
|
12
|
+
getAdapterClass: () => import("./UnindexedFastaAdapter.js").then(r => r.default),
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import BgzipFastaAdapterF from
|
|
3
|
-
import ChromSizesAdapterF from
|
|
4
|
-
import DivSequenceRendererF from
|
|
5
|
-
import IndexedFastaAdapterF from
|
|
6
|
-
import LinearReferenceSequenceDisplayF from
|
|
7
|
-
import ReferenceSequenceTrackF from
|
|
8
|
-
import SequenceSearchAdapterF from
|
|
9
|
-
import TwoBitAdapterF from
|
|
10
|
-
import UnindexedFastaAdapterF from
|
|
11
|
-
import createExtensionPoints from
|
|
2
|
+
import BgzipFastaAdapterF from "./BgzipFastaAdapter/index.js";
|
|
3
|
+
import ChromSizesAdapterF from "./ChromSizesAdapter/index.js";
|
|
4
|
+
import DivSequenceRendererF from "./DivSequenceRenderer/index.js";
|
|
5
|
+
import IndexedFastaAdapterF from "./IndexedFastaAdapter/index.js";
|
|
6
|
+
import LinearReferenceSequenceDisplayF from "./LinearReferenceSequenceDisplay/index.js";
|
|
7
|
+
import ReferenceSequenceTrackF from "./ReferenceSequenceTrack/index.js";
|
|
8
|
+
import SequenceSearchAdapterF from "./SequenceSearchAdapter/index.js";
|
|
9
|
+
import TwoBitAdapterF from "./TwoBitAdapter/index.js";
|
|
10
|
+
import UnindexedFastaAdapterF from "./UnindexedFastaAdapter/index.js";
|
|
11
|
+
import createExtensionPoints from "./createExtensionPoints.js";
|
|
12
12
|
export default class SequencePlugin extends Plugin {
|
|
13
|
-
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.name = 'SequencePlugin';
|
|
16
|
-
}
|
|
13
|
+
name = 'SequencePlugin';
|
|
17
14
|
install(pluginManager) {
|
|
18
15
|
DivSequenceRendererF(pluginManager);
|
|
19
16
|
TwoBitAdapterF(pluginManager);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function stringifyFASTA({ features }) {
|
|
2
|
+
return features
|
|
3
|
+
.map(feature => {
|
|
4
|
+
const refName = feature.get('refName');
|
|
5
|
+
const start = Math.floor(feature.get('start'));
|
|
6
|
+
const end = Math.floor(feature.get('end'));
|
|
7
|
+
const seq = feature.get('seq') ?? '';
|
|
8
|
+
const header = `>${refName}:${start + 1}-${end}`;
|
|
9
|
+
const wrappedSeq = seq.match(/.{1,80}/g)?.join('\n') ?? '';
|
|
10
|
+
return `${header}\n${wrappedSeq}`;
|
|
11
|
+
})
|
|
12
|
+
.join('\n');
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-sequence",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "JBrowse 2 sequence adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -15,38 +15,21 @@
|
|
|
15
15
|
"directory": "plugins/sequence"
|
|
16
16
|
},
|
|
17
17
|
"author": "JBrowse Team",
|
|
18
|
-
"
|
|
19
|
-
"srcMain": "src/index.ts",
|
|
20
|
-
"main": "dist/index.js",
|
|
18
|
+
"main": "esm/index.js",
|
|
21
19
|
"files": [
|
|
22
|
-
"dist",
|
|
23
20
|
"esm"
|
|
24
21
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "npm-run-all build:*",
|
|
27
|
-
"test": "cd ../..; jest --passWithNoTests plugins/sequence",
|
|
28
|
-
"prepublishOnly": "yarn test",
|
|
29
|
-
"prepack": "yarn build && yarn useDist",
|
|
30
|
-
"postpack": "yarn useSrc",
|
|
31
|
-
"useDist": "node ../../scripts/useDist.js",
|
|
32
|
-
"useSrc": "node ../../scripts/useSrc.js",
|
|
33
|
-
"prebuild": "npm run clean",
|
|
34
|
-
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
35
|
-
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
36
|
-
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
|
-
},
|
|
38
22
|
"dependencies": {
|
|
39
|
-
"@gmod/abortable-promise-cache": "^3.0.
|
|
40
|
-
"@gmod/indexedfasta": "^
|
|
41
|
-
"@gmod/twobit": "^6.0.
|
|
42
|
-
"@jbrowse/
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"rxjs": "^7.0.0"
|
|
23
|
+
"@gmod/abortable-promise-cache": "^3.0.4",
|
|
24
|
+
"@gmod/indexedfasta": "^5.0.0",
|
|
25
|
+
"@gmod/twobit": "^6.0.1",
|
|
26
|
+
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
27
|
+
"@mui/material": "^7.3.6",
|
|
28
|
+
"mobx": "^6.15.0",
|
|
29
|
+
"mobx-react": "^9.2.1",
|
|
30
|
+
"rxjs": "^7.8.2",
|
|
31
|
+
"@jbrowse/plugin-linear-genome-view": "^4.0.1",
|
|
32
|
+
"@jbrowse/core": "^4.0.1"
|
|
50
33
|
},
|
|
51
34
|
"peerDependencies": {
|
|
52
35
|
"react": ">=18.0.0"
|
|
@@ -54,8 +37,19 @@
|
|
|
54
37
|
"publishConfig": {
|
|
55
38
|
"access": "public"
|
|
56
39
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "pnpm run /^build:/",
|
|
43
|
+
"test": "cd ../..; jest --passWithNoTests plugins/sequence",
|
|
44
|
+
"prebuild": "pnpm clean",
|
|
45
|
+
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
46
|
+
"clean": "rimraf esm *.tsbuildinfo"
|
|
47
|
+
},
|
|
48
|
+
"types": "esm/index.d.ts",
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./esm/index.d.ts",
|
|
52
|
+
"import": "./esm/index.js"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const indexedfasta_1 = require("@gmod/indexedfasta");
|
|
7
|
-
const io_1 = require("@jbrowse/core/util/io");
|
|
8
|
-
const IndexedFastaAdapter_1 = __importDefault(require("../IndexedFastaAdapter/IndexedFastaAdapter"));
|
|
9
|
-
class BgzipFastaAdapter extends IndexedFastaAdapter_1.default {
|
|
10
|
-
async setupPre() {
|
|
11
|
-
const fastaLocation = this.getConf('fastaLocation');
|
|
12
|
-
const faiLocation = this.getConf('faiLocation');
|
|
13
|
-
const gziLocation = this.getConf('gziLocation');
|
|
14
|
-
const fastaOpts = {
|
|
15
|
-
fasta: (0, io_1.openLocation)(fastaLocation, this.pluginManager),
|
|
16
|
-
fai: (0, io_1.openLocation)(faiLocation, this.pluginManager),
|
|
17
|
-
gzi: (0, io_1.openLocation)(gziLocation, this.pluginManager),
|
|
18
|
-
};
|
|
19
|
-
return { fasta: new indexedfasta_1.BgzipIndexedFasta(fastaOpts) };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = BgzipFastaAdapter;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare const BgzipFastaAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
fastaLocation: {
|
|
3
|
-
type: string;
|
|
4
|
-
defaultValue: {
|
|
5
|
-
uri: string;
|
|
6
|
-
locationType: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
faiLocation: {
|
|
10
|
-
type: string;
|
|
11
|
-
defaultValue: {
|
|
12
|
-
uri: string;
|
|
13
|
-
locationType: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
metadataLocation: {
|
|
17
|
-
description: string;
|
|
18
|
-
type: string;
|
|
19
|
-
defaultValue: {
|
|
20
|
-
uri: string;
|
|
21
|
-
locationType: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
gziLocation: {
|
|
25
|
-
type: string;
|
|
26
|
-
defaultValue: {
|
|
27
|
-
uri: string;
|
|
28
|
-
locationType: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
32
|
-
export default BgzipFastaAdapter;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
function x() { }
|
|
5
|
-
const BgzipFastaAdapter = (0, configuration_1.ConfigurationSchema)('BgzipFastaAdapter', {
|
|
6
|
-
fastaLocation: {
|
|
7
|
-
type: 'fileLocation',
|
|
8
|
-
defaultValue: { uri: '/path/to/seq.fa.gz', locationType: 'UriLocation' },
|
|
9
|
-
},
|
|
10
|
-
faiLocation: {
|
|
11
|
-
type: 'fileLocation',
|
|
12
|
-
defaultValue: {
|
|
13
|
-
uri: '/path/to/seq.fa.gz.fai',
|
|
14
|
-
locationType: 'UriLocation',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
metadataLocation: {
|
|
18
|
-
description: 'Optional metadata file',
|
|
19
|
-
type: 'fileLocation',
|
|
20
|
-
defaultValue: {
|
|
21
|
-
uri: '/path/to/fa.metadata.yaml',
|
|
22
|
-
locationType: 'UriLocation',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
gziLocation: {
|
|
26
|
-
type: 'fileLocation',
|
|
27
|
-
defaultValue: {
|
|
28
|
-
uri: '/path/to/seq.fa.gz.gzi',
|
|
29
|
-
locationType: 'UriLocation',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
}, {
|
|
33
|
-
explicitlyTyped: true,
|
|
34
|
-
preProcessSnapshot: snap => {
|
|
35
|
-
return snap.uri
|
|
36
|
-
? {
|
|
37
|
-
...snap,
|
|
38
|
-
fastaLocation: {
|
|
39
|
-
uri: snap.uri,
|
|
40
|
-
baseUri: snap.baseUri,
|
|
41
|
-
},
|
|
42
|
-
faiLocation: {
|
|
43
|
-
uri: `${snap.uri}.fai`,
|
|
44
|
-
baseUri: snap.baseUri,
|
|
45
|
-
},
|
|
46
|
-
gziLocation: {
|
|
47
|
-
uri: `${snap.uri}.gzi`,
|
|
48
|
-
baseUri: snap.baseUri,
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
: snap;
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
exports.default = BgzipFastaAdapter;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.default = BgzipFastaAdapterF;
|
|
40
|
-
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
41
|
-
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
42
|
-
function BgzipFastaAdapterF(pluginManager) {
|
|
43
|
-
pluginManager.addAdapterType(() => {
|
|
44
|
-
return new AdapterType_1.default({
|
|
45
|
-
name: 'BgzipFastaAdapter',
|
|
46
|
-
displayName: 'Bgzip-indexed FASTA adapter',
|
|
47
|
-
configSchema: configSchema_1.default,
|
|
48
|
-
adapterMetadata: {
|
|
49
|
-
hiddenFromGUI: true,
|
|
50
|
-
},
|
|
51
|
-
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./BgzipFastaAdapter'))).then(r => r.default),
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
-
export default class ChromSizesAdapter extends BaseAdapter implements RegionsAdapter {
|
|
4
|
-
protected setupP?: Promise<Record<string, number>>;
|
|
5
|
-
setupPre(): Promise<{
|
|
6
|
-
[k: string]: number;
|
|
7
|
-
}>;
|
|
8
|
-
setup(): Promise<Record<string, number>>;
|
|
9
|
-
getRegions(): Promise<{
|
|
10
|
-
refName: string;
|
|
11
|
-
start: number;
|
|
12
|
-
end: number;
|
|
13
|
-
}[]>;
|
|
14
|
-
getHeader(): {};
|
|
15
|
-
}
|