@jbrowse/plugin-config 3.0.3 → 3.0.5
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/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +15 -5
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +1 -1
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +15 -5
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +1 -1
- package/package.json +3 -3
|
@@ -10,14 +10,24 @@ class NcbiSequenceReportAliasAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
10
10
|
}
|
|
11
11
|
const override = this.getConf('useUcscNameOverride');
|
|
12
12
|
const results = await (0, io_1.openLocation)(loc, this.pluginManager).readFile('utf8');
|
|
13
|
-
|
|
13
|
+
const lines = results
|
|
14
14
|
.split(/\n|\r\n|\r/)
|
|
15
|
-
.slice(1)
|
|
16
15
|
.filter(f => !!f.trim())
|
|
17
|
-
.map(row => row.split('\t'))
|
|
16
|
+
.map(row => row.split('\t'));
|
|
17
|
+
const r = lines[0] || [];
|
|
18
|
+
const idx0 = r.indexOf('GenBank seq accession');
|
|
19
|
+
const idx1 = r.indexOf('RefSeq seq accession');
|
|
20
|
+
const idx2 = r.indexOf('UCSC style name');
|
|
21
|
+
const idx3 = r.indexOf('Sequence name');
|
|
22
|
+
if (idx0 === -1 || idx1 === -1 || idx2 === -1) {
|
|
23
|
+
throw new Error('Header line must include "GenBank seq accession", "RefSeq seq accession", "UCSC style name", and "Sequence name"');
|
|
24
|
+
}
|
|
25
|
+
return lines
|
|
26
|
+
.slice(1)
|
|
27
|
+
.filter(cols => !!cols[idx2] || !!cols[idx3])
|
|
18
28
|
.map(cols => ({
|
|
19
|
-
refName: cols[
|
|
20
|
-
aliases: [cols[
|
|
29
|
+
refName: (cols[idx2] || cols[idx3]),
|
|
30
|
+
aliases: [cols[idx0], cols[idx1], cols[idx2], cols[idx3]].filter((f) => !!f),
|
|
21
31
|
override,
|
|
22
32
|
}))
|
|
23
33
|
.filter(f => !!f.refName);
|
|
@@ -10,7 +10,7 @@ const NcbiSequenceReportAliasAdapterConfigSchema = (0, configuration_1.Configura
|
|
|
10
10
|
locationType: 'UriLocation',
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
-
|
|
13
|
+
useNameOverride: {
|
|
14
14
|
type: 'boolean',
|
|
15
15
|
defaultValue: true,
|
|
16
16
|
description: 'forces usage of the UCSC names over the NCBI style names from a FASTA',
|
|
@@ -8,14 +8,24 @@ export default class NcbiSequenceReportAliasAdapter extends BaseAdapter {
|
|
|
8
8
|
}
|
|
9
9
|
const override = this.getConf('useUcscNameOverride');
|
|
10
10
|
const results = await openLocation(loc, this.pluginManager).readFile('utf8');
|
|
11
|
-
|
|
11
|
+
const lines = results
|
|
12
12
|
.split(/\n|\r\n|\r/)
|
|
13
|
-
.slice(1)
|
|
14
13
|
.filter(f => !!f.trim())
|
|
15
|
-
.map(row => row.split('\t'))
|
|
14
|
+
.map(row => row.split('\t'));
|
|
15
|
+
const r = lines[0] || [];
|
|
16
|
+
const idx0 = r.indexOf('GenBank seq accession');
|
|
17
|
+
const idx1 = r.indexOf('RefSeq seq accession');
|
|
18
|
+
const idx2 = r.indexOf('UCSC style name');
|
|
19
|
+
const idx3 = r.indexOf('Sequence name');
|
|
20
|
+
if (idx0 === -1 || idx1 === -1 || idx2 === -1) {
|
|
21
|
+
throw new Error('Header line must include "GenBank seq accession", "RefSeq seq accession", "UCSC style name", and "Sequence name"');
|
|
22
|
+
}
|
|
23
|
+
return lines
|
|
24
|
+
.slice(1)
|
|
25
|
+
.filter(cols => !!cols[idx2] || !!cols[idx3])
|
|
16
26
|
.map(cols => ({
|
|
17
|
-
refName: cols[
|
|
18
|
-
aliases: [cols[
|
|
27
|
+
refName: (cols[idx2] || cols[idx3]),
|
|
28
|
+
aliases: [cols[idx0], cols[idx1], cols[idx2], cols[idx3]].filter((f) => !!f),
|
|
19
29
|
override,
|
|
20
30
|
}))
|
|
21
31
|
.filter(f => !!f.refName);
|
|
@@ -8,7 +8,7 @@ const NcbiSequenceReportAliasAdapterConfigSchema = ConfigurationSchema('NcbiSequ
|
|
|
8
8
|
locationType: 'UriLocation',
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
useNameOverride: {
|
|
12
12
|
type: 'boolean',
|
|
13
13
|
defaultValue: true,
|
|
14
14
|
description: 'forces usage of the UCSC names over the NCBI style names from a FASTA',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jbrowse/core": "^3.0.
|
|
39
|
+
"@jbrowse/core": "^3.0.5",
|
|
40
40
|
"@mui/icons-material": "^6.0.0",
|
|
41
41
|
"@mui/material": "^6.0.0",
|
|
42
42
|
"mobx": "^6.0.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"distModule": "esm/index.js",
|
|
57
57
|
"srcModule": "src/index.ts",
|
|
58
58
|
"module": "esm/index.js",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "a03749efe19e51609922272b845a331897346789"
|
|
60
60
|
}
|