@jbrowse/plugin-legacy-jbrowse 2.0.1 → 2.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-legacy-jbrowse",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "JBrowse 2 plugin for connecting to and reading JBrowse 1 data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@babel/runtime": "^7.17.9",
|
|
41
41
|
"@gmod/nclist": "^0.2.1",
|
|
42
42
|
"buffer-crc32": "^0.2.13",
|
|
43
|
-
"generic-filehandle": "^
|
|
43
|
+
"generic-filehandle": "^3.0.0",
|
|
44
44
|
"get-value": "^3.0.1",
|
|
45
45
|
"set-value": "^4.0.1"
|
|
46
46
|
},
|
|
@@ -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": "0db0462fa1f9f15ab4869da085bcab032b9483c3"
|
|
61
61
|
}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { promises as fsPromises } from 'fs'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import { URL } from 'url'
|
|
4
1
|
import { toArray } from 'rxjs/operators'
|
|
2
|
+
import path from 'path'
|
|
5
3
|
import Adapter from './NCListAdapter'
|
|
6
4
|
import configSchema from './configSchema'
|
|
5
|
+
import { LocalFile, GenericFilehandle } from 'generic-filehandle'
|
|
6
|
+
|
|
7
|
+
export function generateReadBuffer(
|
|
8
|
+
getFileFunction: (str: string) => GenericFilehandle,
|
|
9
|
+
) {
|
|
10
|
+
return (request: Request) => {
|
|
11
|
+
const file = getFileFunction(request.url)
|
|
12
|
+
return file.readFile('utf8')
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
fetch.resetMocks()
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
fetch.mockResponse(
|
|
21
|
+
generateReadBuffer(
|
|
22
|
+
(url: string) =>
|
|
23
|
+
new LocalFile(path.join(__dirname, `../../test_data/${url}`)),
|
|
24
|
+
),
|
|
25
|
+
)
|
|
26
|
+
})
|
|
7
27
|
|
|
8
28
|
test('adapter can fetch features from ensembl_genes test set', async () => {
|
|
9
|
-
const rootTemplate = path
|
|
10
|
-
.join(
|
|
11
|
-
__dirname,
|
|
12
|
-
'..',
|
|
13
|
-
'..',
|
|
14
|
-
'test_data',
|
|
15
|
-
'ensembl_genes',
|
|
16
|
-
'{refseq}',
|
|
17
|
-
'trackData.json',
|
|
18
|
-
)
|
|
19
|
-
.replace(/\\/g, '\\\\')
|
|
20
|
-
await fsPromises.stat(rootTemplate.replace('{refseq}', '21')) // will throw if doesnt exist
|
|
21
29
|
const args = {
|
|
22
30
|
refNames: [],
|
|
23
31
|
rootUrlTemplate: {
|
|
24
|
-
uri:
|
|
32
|
+
uri: 'ensembl_genes/{refseq}/trackData.json',
|
|
25
33
|
locationType: 'UriLocation',
|
|
26
34
|
},
|
|
27
35
|
}
|