@jbrowse/plugin-legacy-jbrowse 2.16.1 → 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/GuessNCList/index.d.ts +1 -1
- package/dist/JBrowse1Connection/configSchema.d.ts +0 -6
- package/dist/JBrowse1Connection/configSchema.js +2 -14
- package/dist/JBrowse1Connection/index.d.ts +1 -1
- package/dist/JBrowse1Connection/index.js +1 -2
- package/dist/JBrowse1Connection/jb1ConfigLoad.d.ts +1 -1
- package/dist/JBrowse1Connection/jb1ConfigLoad.js +5 -44
- package/dist/JBrowse1Connection/jb1ConfigParse.d.ts +1 -8
- package/dist/JBrowse1Connection/jb1ConfigParse.js +1 -41
- package/dist/JBrowse1Connection/jb1ToJb2.d.ts +1 -1
- package/dist/JBrowse1Connection/jb1ToJb2.js +1 -5
- package/dist/JBrowse1Connection/model.d.ts +5 -5
- package/dist/JBrowse1Connection/model.js +1 -3
- package/dist/JBrowse1Connection/util.d.ts +2 -21
- package/dist/JBrowse1Connection/util.js +9 -58
- package/dist/JBrowse1TextSearchAdapter/HttpMap.d.ts +0 -20
- package/dist/JBrowse1TextSearchAdapter/HttpMap.js +1 -27
- package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +5 -9
- package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js +1 -7
- package/dist/JBrowse1TextSearchAdapter/configSchema.d.ts +0 -9
- package/dist/JBrowse1TextSearchAdapter/configSchema.js +1 -17
- package/dist/JBrowse1TextSearchAdapter/index.d.ts +1 -1
- package/dist/JBrowse1TextSearchAdapter/index.js +0 -1
- package/dist/NCListAdapter/NCListAdapter.d.ts +7 -22
- package/dist/NCListAdapter/NCListAdapter.js +3 -19
- package/dist/NCListAdapter/NCListFeature.d.ts +1 -16
- package/dist/NCListAdapter/NCListFeature.js +0 -19
- package/dist/NCListAdapter/configSchema.d.ts +0 -6
- package/dist/NCListAdapter/configSchema.js +1 -10
- package/dist/NCListAdapter/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/esm/GuessNCList/index.d.ts +1 -1
- package/esm/JBrowse1Connection/configSchema.d.ts +0 -6
- package/esm/JBrowse1Connection/configSchema.js +2 -14
- package/esm/JBrowse1Connection/index.d.ts +1 -1
- package/esm/JBrowse1Connection/index.js +1 -2
- package/esm/JBrowse1Connection/jb1ConfigLoad.d.ts +1 -1
- package/esm/JBrowse1Connection/jb1ConfigLoad.js +7 -46
- package/esm/JBrowse1Connection/jb1ConfigParse.d.ts +1 -8
- package/esm/JBrowse1Connection/jb1ConfigParse.js +1 -41
- package/esm/JBrowse1Connection/jb1ToJb2.d.ts +1 -1
- package/esm/JBrowse1Connection/jb1ToJb2.js +2 -6
- package/esm/JBrowse1Connection/model.d.ts +5 -5
- package/esm/JBrowse1Connection/model.js +1 -3
- package/esm/JBrowse1Connection/util.d.ts +2 -21
- package/esm/JBrowse1Connection/util.js +8 -57
- package/esm/JBrowse1TextSearchAdapter/HttpMap.d.ts +0 -20
- package/esm/JBrowse1TextSearchAdapter/HttpMap.js +1 -27
- package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +5 -9
- package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js +2 -8
- package/esm/JBrowse1TextSearchAdapter/configSchema.d.ts +0 -9
- package/esm/JBrowse1TextSearchAdapter/configSchema.js +1 -17
- package/esm/JBrowse1TextSearchAdapter/index.d.ts +1 -1
- package/esm/JBrowse1TextSearchAdapter/index.js +0 -1
- package/esm/NCListAdapter/NCListAdapter.d.ts +7 -22
- package/esm/NCListAdapter/NCListAdapter.js +4 -20
- package/esm/NCListAdapter/NCListFeature.d.ts +1 -16
- package/esm/NCListAdapter/NCListFeature.js +0 -19
- package/esm/NCListAdapter/configSchema.d.ts +0 -6
- package/esm/NCListAdapter/configSchema.js +1 -10
- package/esm/NCListAdapter/index.d.ts +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -3
- package/package.json +2 -2
|
@@ -3,9 +3,6 @@ export default class HttpMap {
|
|
|
3
3
|
constructor(args: {
|
|
4
4
|
url: string;
|
|
5
5
|
});
|
|
6
|
-
/**
|
|
7
|
-
* loads meta.json file from names directory and reads number of hash_bits used
|
|
8
|
-
*/
|
|
9
6
|
readMeta(): Promise<{
|
|
10
7
|
hashHexCharacters: number;
|
|
11
8
|
compress: any;
|
|
@@ -14,26 +11,9 @@ export default class HttpMap {
|
|
|
14
11
|
getHashHexCharacters(): Promise<number>;
|
|
15
12
|
getCompress(): Promise<any>;
|
|
16
13
|
getTrackNames(): Promise<any>;
|
|
17
|
-
/**
|
|
18
|
-
* Returns contents of a bucket given a key
|
|
19
|
-
* @param key - string
|
|
20
|
-
*/
|
|
21
14
|
get(key: string): Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Returns a bucket given a key
|
|
24
|
-
* @param key - string
|
|
25
|
-
*/
|
|
26
15
|
getBucket(key: string): Promise<any>;
|
|
27
|
-
/**
|
|
28
|
-
* Loads a file using the url and provided id.
|
|
29
|
-
* Returns response object with contents of the file
|
|
30
|
-
* @param id - string
|
|
31
|
-
*/
|
|
32
16
|
loadFile(id: string): Promise<any>;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the corresponding path of the file given a hex string
|
|
35
|
-
* @param hex - hex string
|
|
36
|
-
*/
|
|
37
17
|
hexToDirPath(hex: string): Promise<string>;
|
|
38
18
|
hash(data: string): string;
|
|
39
19
|
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper class allows reading names index generated in JBrowse1
|
|
3
|
-
* Adapted from https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/Store/Hash.js
|
|
4
|
-
*/
|
|
5
|
-
import crc32 from 'crc/crc32';
|
|
6
1
|
import { Buffer } from 'buffer';
|
|
2
|
+
import crc32 from 'crc/crc32';
|
|
7
3
|
export default class HttpMap {
|
|
8
4
|
constructor(args) {
|
|
9
|
-
// make sure url has a trailing slash
|
|
10
5
|
this.url = args.url.endsWith('/') ? args.url : `${args.url}/`;
|
|
11
6
|
}
|
|
12
|
-
/**
|
|
13
|
-
* loads meta.json file from names directory and reads number of hash_bits used
|
|
14
|
-
*/
|
|
15
7
|
async readMeta() {
|
|
16
8
|
const meta = await this.loadFile('meta.json');
|
|
17
9
|
const { compress, track_names: tracks } = meta;
|
|
@@ -30,28 +22,15 @@ export default class HttpMap {
|
|
|
30
22
|
const meta = await this.readMeta();
|
|
31
23
|
return meta.tracks;
|
|
32
24
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Returns contents of a bucket given a key
|
|
35
|
-
* @param key - string
|
|
36
|
-
*/
|
|
37
25
|
async get(key) {
|
|
38
26
|
const bucket = await this.getBucket(key);
|
|
39
27
|
return bucket[key];
|
|
40
28
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns a bucket given a key
|
|
43
|
-
* @param key - string
|
|
44
|
-
*/
|
|
45
29
|
async getBucket(key) {
|
|
46
30
|
const bucketIdent = this.hash(key);
|
|
47
31
|
const hexToDirPath = await this.hexToDirPath(bucketIdent);
|
|
48
32
|
return this.loadFile(hexToDirPath);
|
|
49
33
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Loads a file using the url and provided id.
|
|
52
|
-
* Returns response object with contents of the file
|
|
53
|
-
* @param id - string
|
|
54
|
-
*/
|
|
55
34
|
async loadFile(id) {
|
|
56
35
|
const response = await fetch(`${this.url}${id}`);
|
|
57
36
|
if (!response.ok) {
|
|
@@ -59,12 +38,7 @@ export default class HttpMap {
|
|
|
59
38
|
}
|
|
60
39
|
return response.json();
|
|
61
40
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Returns the corresponding path of the file given a hex string
|
|
64
|
-
* @param hex - hex string
|
|
65
|
-
*/
|
|
66
41
|
async hexToDirPath(hex) {
|
|
67
|
-
// zero-pad the hex string to be 8 chars if necessary
|
|
68
42
|
const hashHexCharacters = await this.getHashHexCharacters();
|
|
69
43
|
if (hashHexCharacters) {
|
|
70
44
|
const compress = await this.getCompress();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { BaseTextSearchAdapter, BaseTextSearchArgs, BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
1
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
|
-
import {
|
|
2
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
3
|
import HttpMap from './HttpMap';
|
|
5
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
6
|
-
import {
|
|
4
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
5
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
6
|
+
import type { BaseTextSearchAdapter, BaseTextSearchArgs } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
7
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
7
8
|
export interface TooManyHits {
|
|
8
9
|
name: string;
|
|
9
10
|
hitLimit: number;
|
|
@@ -20,11 +21,6 @@ export default class JBrowse1TextSearchAdapter extends BaseAdapter implements Ba
|
|
|
20
21
|
httpMap: HttpMap;
|
|
21
22
|
tracksNames?: string[];
|
|
22
23
|
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
23
|
-
/**
|
|
24
|
-
* Returns the contents of the file containing the query if it exists
|
|
25
|
-
* else it returns empty
|
|
26
|
-
* @param query - string query
|
|
27
|
-
*/
|
|
28
24
|
loadIndexFile(query: string): Promise<IndexFile>;
|
|
29
25
|
searchIndex(args: BaseTextSearchArgs): Promise<BaseResult[]>;
|
|
30
26
|
formatResults(results: SearchResults, tracks: string[], searchType?: string): BaseResult[];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BaseAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
1
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
|
-
import { readConfObject
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
4
|
import HttpMap from './HttpMap';
|
|
5
|
-
// Uses index built by generate-names.pl
|
|
6
5
|
export default class JBrowse1TextSearchAdapter extends BaseAdapter {
|
|
7
6
|
constructor(config, getSubAdapter, pluginManager) {
|
|
8
7
|
super(config, getSubAdapter, pluginManager);
|
|
@@ -12,11 +11,6 @@ export default class JBrowse1TextSearchAdapter extends BaseAdapter {
|
|
|
12
11
|
url: baseUri ? new URL(uri, baseUri).href : uri,
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns the contents of the file containing the query if it exists
|
|
17
|
-
* else it returns empty
|
|
18
|
-
* @param query - string query
|
|
19
|
-
*/
|
|
20
14
|
async loadIndexFile(query) {
|
|
21
15
|
return this.httpMap.getBucket(query);
|
|
22
16
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const _default: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
namesIndexLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -10,17 +7,11 @@ declare const _default: import("@jbrowse/core/configuration/configurationSchema"
|
|
|
10
7
|
};
|
|
11
8
|
description: string;
|
|
12
9
|
};
|
|
13
|
-
/**
|
|
14
|
-
* #slot
|
|
15
|
-
*/
|
|
16
10
|
tracks: {
|
|
17
11
|
type: string;
|
|
18
12
|
defaultValue: never[];
|
|
19
13
|
description: string;
|
|
20
14
|
};
|
|
21
|
-
/**
|
|
22
|
-
* #slot
|
|
23
|
-
*/
|
|
24
15
|
assemblyNames: {
|
|
25
16
|
type: string;
|
|
26
17
|
defaultValue: never[];
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config JBrowse1TextSearchAdapter
|
|
4
|
-
* note: metadata about tracks and assemblies covered by text search adapter
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
7
3
|
export default ConfigurationSchema('JBrowse1TextSearchAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
4
|
namesIndexLocation: {
|
|
12
5
|
type: 'fileLocation',
|
|
13
6
|
defaultValue: { uri: '/volvox/names', locationType: 'UriLocation' },
|
|
14
7
|
description: 'the location of the JBrowse1 names index data directory',
|
|
15
8
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
9
|
tracks: {
|
|
20
10
|
type: 'stringArray',
|
|
21
11
|
defaultValue: [],
|
|
22
12
|
description: 'List of tracks covered by text search adapter',
|
|
23
13
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot
|
|
26
|
-
*/
|
|
27
14
|
assemblyNames: {
|
|
28
15
|
type: 'stringArray',
|
|
29
16
|
defaultValue: [],
|
|
@@ -31,8 +18,5 @@ export default ConfigurationSchema('JBrowse1TextSearchAdapter', {
|
|
|
31
18
|
},
|
|
32
19
|
}, {
|
|
33
20
|
explicitlyTyped: true,
|
|
34
|
-
/**
|
|
35
|
-
* #identifier
|
|
36
|
-
*/
|
|
37
21
|
explicitIdentifier: 'textSearchAdapterId',
|
|
38
22
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function JBrowse1TextSearchAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import TextSearchAdapterType from '@jbrowse/core/pluggableElementTypes/TextSearchAdapterType';
|
|
2
|
-
// locals
|
|
3
2
|
import configSchema from './configSchema';
|
|
4
3
|
export default function JBrowse1TextSearchAdapterF(pluginManager) {
|
|
5
4
|
pluginManager.addTextSearchAdapterType(() => new TextSearchAdapterType({
|
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
-
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
2
|
import NCListFeature from './NCListFeature';
|
|
5
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
5
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
6
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
7
|
+
import type { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
8
|
+
import type { Region } from '@jbrowse/core/util/types';
|
|
8
9
|
export default class NCListAdapter extends BaseFeatureDataAdapter {
|
|
9
10
|
private nclist;
|
|
10
11
|
private configRefNames?;
|
|
11
12
|
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
12
|
-
/**
|
|
13
|
-
* Fetch features for a certain region. Use getFeaturesInRegion() if you also
|
|
14
|
-
* want to verify that the store has features for the given reference sequence
|
|
15
|
-
* before fetching.
|
|
16
|
-
* @param region -
|
|
17
|
-
* @param opts - [signal] optional signalling object for aborting the fetch
|
|
18
|
-
* @returns Observable of Feature objects in the region
|
|
19
|
-
*/
|
|
20
13
|
getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
21
14
|
wrapFeature(ncFeature: any): NCListFeature;
|
|
22
15
|
hasDataForRefName(refName: string): Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* NCList is unable to get list of ref names so returns empty
|
|
25
|
-
*/
|
|
26
16
|
getRefNames(): Promise<string[]>;
|
|
27
|
-
/**
|
|
28
|
-
* called to provide a hint that data tied to a certain region
|
|
29
|
-
* will not be needed for the foreseeable future and can be purged
|
|
30
|
-
* from caches, etc
|
|
31
|
-
*/
|
|
32
17
|
freeResources(): void;
|
|
33
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import NCListStore from '@gmod/nclist';
|
|
2
|
-
import { BaseFeatureDataAdapter
|
|
2
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
5
5
|
import { RemoteFile } from 'generic-filehandle';
|
|
6
6
|
import NCListFeature from './NCListFeature';
|
|
7
7
|
export default class NCListAdapter extends BaseFeatureDataAdapter {
|
|
@@ -18,19 +18,11 @@ export default class NCListAdapter extends BaseFeatureDataAdapter {
|
|
|
18
18
|
: url)).readFile(),
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Fetch features for a certain region. Use getFeaturesInRegion() if you also
|
|
23
|
-
* want to verify that the store has features for the given reference sequence
|
|
24
|
-
* before fetching.
|
|
25
|
-
* @param region -
|
|
26
|
-
* @param opts - [signal] optional signalling object for aborting the fetch
|
|
27
|
-
* @returns Observable of Feature objects in the region
|
|
28
|
-
*/
|
|
29
21
|
getFeatures(region, opts = {}) {
|
|
30
22
|
return ObservableCreate(async (observer) => {
|
|
31
|
-
const {
|
|
23
|
+
const { stopToken } = opts;
|
|
32
24
|
for await (const feature of this.nclist.getFeatures(region, opts)) {
|
|
33
|
-
|
|
25
|
+
checkStopToken(stopToken);
|
|
34
26
|
observer.next(this.wrapFeature(feature));
|
|
35
27
|
}
|
|
36
28
|
observer.complete();
|
|
@@ -44,16 +36,8 @@ export default class NCListAdapter extends BaseFeatureDataAdapter {
|
|
|
44
36
|
const root = await this.nclist.getDataRoot(refName);
|
|
45
37
|
return !!((_a = root === null || root === void 0 ? void 0 : root.stats) === null || _a === void 0 ? void 0 : _a.featureCount);
|
|
46
38
|
}
|
|
47
|
-
/**
|
|
48
|
-
* NCList is unable to get list of ref names so returns empty
|
|
49
|
-
*/
|
|
50
39
|
async getRefNames() {
|
|
51
40
|
return this.configRefNames || [];
|
|
52
41
|
}
|
|
53
|
-
/**
|
|
54
|
-
* called to provide a hint that data tied to a certain region
|
|
55
|
-
* will not be needed for the foreseeable future and can be purged
|
|
56
|
-
* from caches, etc
|
|
57
|
-
*/
|
|
58
42
|
freeResources() { }
|
|
59
43
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
|
|
2
|
-
/**
|
|
3
|
-
* wrapper to adapt nclist features to act like jbrowse 2 features
|
|
4
|
-
*/
|
|
1
|
+
import type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
|
|
5
2
|
export default class NCListFeature implements Feature {
|
|
6
3
|
private ncFeature;
|
|
7
4
|
private parentHandle?;
|
|
@@ -11,21 +8,9 @@ export default class NCListFeature implements Feature {
|
|
|
11
8
|
jb2TagToJb1Tag(tag: string): string;
|
|
12
9
|
jb1TagToJb2Tag(tag: string): string;
|
|
13
10
|
get(attrName: string): any;
|
|
14
|
-
/**
|
|
15
|
-
* Get an array listing which data keys are present in this feature.
|
|
16
|
-
*/
|
|
17
11
|
tags(): string[];
|
|
18
|
-
/**
|
|
19
|
-
* Get the unique ID of this feature.
|
|
20
|
-
*/
|
|
21
12
|
id(): string;
|
|
22
|
-
/**
|
|
23
|
-
* Get this feature's parent feature, or undefined if none.
|
|
24
|
-
*/
|
|
25
13
|
parent(): Feature | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Get an array of child features, or undefined if none.
|
|
28
|
-
*/
|
|
29
14
|
children(): Feature[] | undefined;
|
|
30
15
|
toJSON(): SimpleFeatureSerialized;
|
|
31
16
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
const jb2ToJb1 = { refName: 'seq_id' };
|
|
2
2
|
const jb1ToJb2 = { seq_id: 'refName' };
|
|
3
|
-
/**
|
|
4
|
-
* wrapper to adapt nclist features to act like jbrowse 2 features
|
|
5
|
-
*/
|
|
6
3
|
export default class NCListFeature {
|
|
7
4
|
constructor(ncFeature, parent, id) {
|
|
8
5
|
this.ncFeature = ncFeature;
|
|
@@ -13,13 +10,11 @@ export default class NCListFeature {
|
|
|
13
10
|
throw new Error('not implemented');
|
|
14
11
|
}
|
|
15
12
|
jb2TagToJb1Tag(tag) {
|
|
16
|
-
// @ts-expect-error
|
|
17
13
|
const mapped = jb2ToJb1[tag] || tag;
|
|
18
14
|
return mapped.toLowerCase();
|
|
19
15
|
}
|
|
20
16
|
jb1TagToJb2Tag(tag) {
|
|
21
17
|
const t = tag.toLowerCase();
|
|
22
|
-
// @ts-expect-error
|
|
23
18
|
return jb1ToJb2[t] || t;
|
|
24
19
|
}
|
|
25
20
|
get(attrName) {
|
|
@@ -29,39 +24,25 @@ export default class NCListFeature {
|
|
|
29
24
|
}
|
|
30
25
|
return attr;
|
|
31
26
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Get an array listing which data keys are present in this feature.
|
|
34
|
-
*/
|
|
35
27
|
tags() {
|
|
36
28
|
return this.ncFeature.tags().map((t) => this.jb1TagToJb2Tag(t));
|
|
37
29
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Get the unique ID of this feature.
|
|
40
|
-
*/
|
|
41
30
|
id() {
|
|
42
31
|
return this.uniqueId;
|
|
43
32
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Get this feature's parent feature, or undefined if none.
|
|
46
|
-
*/
|
|
47
33
|
parent() {
|
|
48
34
|
return this.parentHandle;
|
|
49
35
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Get an array of child features, or undefined if none.
|
|
52
|
-
*/
|
|
53
36
|
children() {
|
|
54
37
|
return this.get('subfeatures');
|
|
55
38
|
}
|
|
56
39
|
toJSON() {
|
|
57
|
-
// @ts-expect-error
|
|
58
40
|
const data = { uniqueId: this.id() };
|
|
59
41
|
this.ncFeature.tags().forEach((tag) => {
|
|
60
42
|
const mappedTag = this.jb1TagToJb2Tag(tag);
|
|
61
43
|
const value = this.ncFeature.get(tag);
|
|
62
44
|
if (mappedTag === 'subfeatures') {
|
|
63
45
|
data.subfeatures = (value || []).map((f) => {
|
|
64
|
-
// note: was new NCListFeature(f, `${this.id()}-${i}`, this).toJSON()
|
|
65
46
|
return new NCListFeature(f, this).toJSON();
|
|
66
47
|
});
|
|
67
48
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const NCListAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
rootUrlTemplate: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,9 +6,6 @@ declare const NCListAdapter: import("@jbrowse/core/configuration/configurationSc
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
*/
|
|
15
9
|
refNames: {
|
|
16
10
|
type: string;
|
|
17
11
|
defaultValue: never[];
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config NCListAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const NCListAdapter = ConfigurationSchema('NCListAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
rootUrlTemplate: {
|
|
11
5
|
type: 'fileLocation',
|
|
12
6
|
defaultValue: {
|
|
@@ -14,9 +8,6 @@ const NCListAdapter = ConfigurationSchema('NCListAdapter', {
|
|
|
14
8
|
locationType: 'UriLocation',
|
|
15
9
|
},
|
|
16
10
|
},
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
11
|
refNames: {
|
|
21
12
|
type: 'stringArray',
|
|
22
13
|
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 NCListAdapterF(pluginManager: PluginManager): void;
|
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 LegacyJBrowsePlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import NCListAdapterF from './NCListAdapter';
|
|
3
|
-
import JBrowse1TextSearchAdapterF from './JBrowse1TextSearchAdapter';
|
|
4
|
-
import JBrowse1ConnectionF from './JBrowse1Connection';
|
|
5
2
|
import GuessNCListF from './GuessNCList';
|
|
3
|
+
import JBrowse1ConnectionF from './JBrowse1Connection';
|
|
4
|
+
import JBrowse1TextSearchAdapterF from './JBrowse1TextSearchAdapter';
|
|
5
|
+
import NCListAdapterF from './NCListAdapter';
|
|
6
6
|
export default class LegacyJBrowsePlugin extends Plugin {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-legacy-jbrowse",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "JBrowse 2 plugin for connecting to and reading JBrowse 1 data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"distModule": "esm/index.js",
|
|
56
56
|
"srcModule": "src/index.ts",
|
|
57
57
|
"module": "esm/index.js",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
|
|
59
59
|
}
|