@jbrowse/plugin-legacy-jbrowse 1.5.0 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin-legacy-jbrowse.cjs.development.js +100 -70
- package/dist/plugin-legacy-jbrowse.cjs.development.js.map +1 -1
- package/dist/plugin-legacy-jbrowse.cjs.production.min.js +1 -1
- package/dist/plugin-legacy-jbrowse.cjs.production.min.js.map +1 -1
- package/dist/plugin-legacy-jbrowse.esm.js +100 -70
- package/dist/plugin-legacy-jbrowse.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/JBrowse1Connection/jb1ConfigLoad.ts +0 -3
- package/src/JBrowse1Connection/jb1ToJb2.ts +2 -2
- package/src/NCListAdapter/NCListFeature.ts +1 -5
- package/src/index.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-legacy-jbrowse",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "JBrowse 2 plugin for connecting to and reading JBrowse 1 data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@gmod/nclist": "^0.1.1",
|
|
39
39
|
"buffer-crc32": "^0.2.13",
|
|
40
|
-
"generic-filehandle": "^2.2.
|
|
40
|
+
"generic-filehandle": "^2.2.2",
|
|
41
41
|
"get-value": "^3.0.1",
|
|
42
42
|
"set-value": "^4.0.1"
|
|
43
43
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "0c398214590969168694b4ed8e20b595178b9efd"
|
|
53
53
|
}
|
|
@@ -101,9 +101,6 @@ export async function createFinalConfig(
|
|
|
101
101
|
|
|
102
102
|
export async function fetchConfigFile(location: JBLocation): Promise<Config> {
|
|
103
103
|
const result = await openLocation(location).readFile('utf8')
|
|
104
|
-
if (typeof result !== 'string') {
|
|
105
|
-
throw new Error(`Error opening location: ${location}`)
|
|
106
|
-
}
|
|
107
104
|
if (isUriLocation(location)) {
|
|
108
105
|
return parseJb1(result, location.uri)
|
|
109
106
|
}
|
|
@@ -404,7 +404,7 @@ export function convertTrackConfig(
|
|
|
404
404
|
jb2TrackConfig.adapter = guessAdapter(
|
|
405
405
|
{ uri: urlTemplate, locationType: 'UriLocation' },
|
|
406
406
|
undefined,
|
|
407
|
-
|
|
407
|
+
urlTemplate,
|
|
408
408
|
)
|
|
409
409
|
if (!jb2TrackConfig.adapter) {
|
|
410
410
|
throw new Error('Could not determine adapter')
|
|
@@ -500,7 +500,7 @@ export async function createRefSeqsAdapter(
|
|
|
500
500
|
uri: refSeqs.url,
|
|
501
501
|
locationType: 'UriLocation',
|
|
502
502
|
}).readFile('utf8')
|
|
503
|
-
const refSeqsData: RefSeq[] = JSON.parse(refSeqsJson
|
|
503
|
+
const refSeqsData: RefSeq[] = JSON.parse(refSeqsJson)
|
|
504
504
|
return refSeqAdapterFromConfig(refSeqsData)
|
|
505
505
|
}
|
|
506
506
|
if ('data' in refSeqs) {
|
|
@@ -11,16 +11,12 @@ const jb1ToJb2 = { seq_id: 'refName' }
|
|
|
11
11
|
* wrapper to adapt nclist features to act like jbrowse 2 features
|
|
12
12
|
*/
|
|
13
13
|
export default class NCListFeature implements Feature {
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
private ncFeature: any
|
|
16
|
-
|
|
17
14
|
private parentHandle?: Feature
|
|
18
15
|
|
|
19
16
|
private uniqueId: string
|
|
20
17
|
|
|
21
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
constructor(ncFeature: any, parent?: Feature, id?: string) {
|
|
23
|
-
this.ncFeature = ncFeature
|
|
19
|
+
constructor(private ncFeature: any, parent?: Feature, id?: string) {
|
|
24
20
|
this.uniqueId = id || ncFeature.id()
|
|
25
21
|
this.parentHandle = parent
|
|
26
22
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,11 +3,13 @@ import TextSearchAdapterType from '@jbrowse/core/pluggableElementTypes/TextSearc
|
|
|
3
3
|
import ConnectionType from '@jbrowse/core/pluggableElementTypes/ConnectionType'
|
|
4
4
|
import Plugin from '@jbrowse/core/Plugin'
|
|
5
5
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
6
|
+
import { FileLocation } from '@jbrowse/core/util/types'
|
|
6
7
|
import { configSchema as ncListAdapterConfigSchema } from './NCListAdapter'
|
|
7
8
|
import {
|
|
8
9
|
AdapterClass as JBrowse1TextSearchAdapterClass,
|
|
9
10
|
configSchema as jbrowse1AdapterConfigSchema,
|
|
10
11
|
} from './JBrowse1TextSeachAdapter'
|
|
12
|
+
import { AdapterGuesser, getFileName } from '@jbrowse/core/util/tracks'
|
|
11
13
|
|
|
12
14
|
import {
|
|
13
15
|
configSchema as jbrowse1ConfigSchema,
|
|
@@ -27,6 +29,27 @@ export default class LegacyJBrowsePlugin extends Plugin {
|
|
|
27
29
|
import('./NCListAdapter/NCListAdapter').then(r => r.default),
|
|
28
30
|
}),
|
|
29
31
|
)
|
|
32
|
+
pluginManager.addToExtensionPoint(
|
|
33
|
+
'Core-guessAdapterForLocation',
|
|
34
|
+
(adapterGuesser: AdapterGuesser) => {
|
|
35
|
+
return (
|
|
36
|
+
file: FileLocation,
|
|
37
|
+
index?: FileLocation,
|
|
38
|
+
adapterHint?: string,
|
|
39
|
+
) => {
|
|
40
|
+
const regexGuess = /trackData.jsonz?$/i
|
|
41
|
+
const adapterName = 'NCListAdapter'
|
|
42
|
+
const fileName = getFileName(file)
|
|
43
|
+
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
44
|
+
return {
|
|
45
|
+
type: adapterName,
|
|
46
|
+
rootUrlTemplate: file,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return adapterGuesser(file, index, adapterHint)
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
)
|
|
30
53
|
|
|
31
54
|
pluginManager.addTextSearchAdapterType(
|
|
32
55
|
() =>
|