@jbrowse/plugin-config 3.1.0 → 3.3.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/ConfigurationEditorWidget/components/ConfigurationEditor.js +3 -1
- package/dist/FromConfigSequenceAdapter/configSchema.js +4 -1
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +14 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +10 -3
- package/dist/RefNameAliasAdapter/configSchema.d.ts +5 -0
- package/dist/RefNameAliasAdapter/configSchema.js +19 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +3 -1
- package/esm/FromConfigSequenceAdapter/configSchema.js +4 -1
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +14 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +10 -3
- package/esm/RefNameAliasAdapter/configSchema.d.ts +5 -0
- package/esm/RefNameAliasAdapter/configSchema.js +19 -1
- package/package.json +5 -5
|
@@ -45,7 +45,9 @@ const Member = (0, mobx_react_1.observer)(function (props) {
|
|
|
45
45
|
const typeNameChoices = (0, configuration_1.getTypeNamesFromExplicitlyTypedUnion)(slotSchema);
|
|
46
46
|
return ((0, jsx_runtime_1.jsxs)(material_1.Accordion, { defaultExpanded: true, className: classes.accordion, children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, { className: classes.icon }), children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: [...path, slotName].join('➔') }) }), (0, jsx_runtime_1.jsxs)(material_1.AccordionDetails, { className: classes.expansionPanelDetails, children: [typeNameChoices.length ? ((0, jsx_runtime_1.jsx)(TypeSelector_1.default, { typeNameChoices: typeNameChoices, slotName: slotName, slot: slot, onChange: evt => {
|
|
47
47
|
if (evt.target.value !== slot.type) {
|
|
48
|
-
schema.setSubschema(slotName, {
|
|
48
|
+
schema.setSubschema(slotName, {
|
|
49
|
+
type: evt.target.value,
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
52
|
} })) : null, (0, jsx_runtime_1.jsx)(material_1.FormGroup, { className: classes.noOverflow, children: (0, jsx_runtime_1.jsx)(Schema, { schema: slot, path: [...path, slotName] }) })] })] }));
|
|
51
53
|
}
|
|
@@ -7,5 +7,8 @@ const sequenceConfigSchema = (0, configuration_1.ConfigurationSchema)('FromConfi
|
|
|
7
7
|
type: 'frozen',
|
|
8
8
|
defaultValue: [],
|
|
9
9
|
},
|
|
10
|
-
}, {
|
|
10
|
+
}, {
|
|
11
|
+
explicitlyTyped: true,
|
|
12
|
+
implicitIdentifier: 'adapterId',
|
|
13
|
+
});
|
|
11
14
|
exports.default = sequenceConfigSchema;
|
|
@@ -15,5 +15,18 @@ const NcbiSequenceReportAliasAdapterConfigSchema = (0, configuration_1.Configura
|
|
|
15
15
|
defaultValue: true,
|
|
16
16
|
description: 'forces usage of the UCSC names over the NCBI style names from a FASTA',
|
|
17
17
|
},
|
|
18
|
-
}, {
|
|
18
|
+
}, {
|
|
19
|
+
explicitlyTyped: true,
|
|
20
|
+
preProcessSnapshot: snap => {
|
|
21
|
+
return snap.uri
|
|
22
|
+
? {
|
|
23
|
+
...snap,
|
|
24
|
+
location: {
|
|
25
|
+
uri: snap.uri,
|
|
26
|
+
baseUri: snap.baseUri,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
: snap;
|
|
30
|
+
},
|
|
31
|
+
});
|
|
19
32
|
exports.default = NcbiSequenceReportAliasAdapterConfigSchema;
|
|
@@ -10,13 +10,20 @@ class RefNameAliasAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
10
10
|
}
|
|
11
11
|
const results = await (0, io_1.openLocation)(loc, this.pluginManager).readFile('utf8');
|
|
12
12
|
const refColumn = this.getConf('refNameColumn');
|
|
13
|
-
|
|
13
|
+
const refColumnHeaderName = this.getConf('refNameColumnHeaderName');
|
|
14
|
+
const lines = results
|
|
14
15
|
.trim()
|
|
15
16
|
.split(/\n|\r\n|\r/)
|
|
16
|
-
.filter(f => !!f
|
|
17
|
+
.filter(f => !!f);
|
|
18
|
+
const header = lines.filter(f => f.startsWith('#'));
|
|
19
|
+
const headerCol = refColumnHeaderName && header.length
|
|
20
|
+
? header.at(-1).split('\t').indexOf(refColumnHeaderName)
|
|
21
|
+
: refColumn;
|
|
22
|
+
return lines
|
|
23
|
+
.filter(f => !f.startsWith('#'))
|
|
17
24
|
.map(row => {
|
|
18
25
|
const aliases = row.split('\t');
|
|
19
|
-
const
|
|
26
|
+
const refName = aliases[headerCol];
|
|
20
27
|
return {
|
|
21
28
|
refName: refName,
|
|
22
29
|
aliases: aliases.filter(f => !!f.trim()),
|
|
@@ -10,5 +10,10 @@ declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configura
|
|
|
10
10
|
type: string;
|
|
11
11
|
defaultValue: number;
|
|
12
12
|
};
|
|
13
|
+
refNameColumnHeaderName: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
defaultValue: string;
|
|
17
|
+
};
|
|
13
18
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
14
19
|
export default RefNameAliasAdapter;
|
|
@@ -14,5 +14,23 @@ const RefNameAliasAdapter = (0, configuration_1.ConfigurationSchema)('RefNameAli
|
|
|
14
14
|
type: 'number',
|
|
15
15
|
defaultValue: 0,
|
|
16
16
|
},
|
|
17
|
-
|
|
17
|
+
refNameColumnHeaderName: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'alternative to refNameColumn, instead looks at header (starts with # and finds column name)',
|
|
20
|
+
defaultValue: '',
|
|
21
|
+
},
|
|
22
|
+
}, {
|
|
23
|
+
explicitlyTyped: true,
|
|
24
|
+
preProcessSnapshot: snap => {
|
|
25
|
+
return snap.uri
|
|
26
|
+
? {
|
|
27
|
+
...snap,
|
|
28
|
+
location: {
|
|
29
|
+
uri: snap.uri,
|
|
30
|
+
baseUri: snap.baseUri,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
: snap;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
18
36
|
exports.default = RefNameAliasAdapter;
|
|
@@ -40,7 +40,9 @@ const Member = observer(function (props) {
|
|
|
40
40
|
const typeNameChoices = getTypeNamesFromExplicitlyTypedUnion(slotSchema);
|
|
41
41
|
return (_jsxs(Accordion, { defaultExpanded: true, className: classes.accordion, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, { className: classes.icon }), children: _jsx(Typography, { children: [...path, slotName].join('➔') }) }), _jsxs(AccordionDetails, { className: classes.expansionPanelDetails, children: [typeNameChoices.length ? (_jsx(TypeSelector, { typeNameChoices: typeNameChoices, slotName: slotName, slot: slot, onChange: evt => {
|
|
42
42
|
if (evt.target.value !== slot.type) {
|
|
43
|
-
schema.setSubschema(slotName, {
|
|
43
|
+
schema.setSubschema(slotName, {
|
|
44
|
+
type: evt.target.value,
|
|
45
|
+
});
|
|
44
46
|
}
|
|
45
47
|
} })) : null, _jsx(FormGroup, { className: classes.noOverflow, children: _jsx(Schema, { schema: slot, path: [...path, slotName] }) })] })] }));
|
|
46
48
|
}
|
|
@@ -5,5 +5,8 @@ const sequenceConfigSchema = ConfigurationSchema('FromConfigSequenceAdapter', {
|
|
|
5
5
|
type: 'frozen',
|
|
6
6
|
defaultValue: [],
|
|
7
7
|
},
|
|
8
|
-
}, {
|
|
8
|
+
}, {
|
|
9
|
+
explicitlyTyped: true,
|
|
10
|
+
implicitIdentifier: 'adapterId',
|
|
11
|
+
});
|
|
9
12
|
export default sequenceConfigSchema;
|
|
@@ -13,5 +13,18 @@ const NcbiSequenceReportAliasAdapterConfigSchema = ConfigurationSchema('NcbiSequ
|
|
|
13
13
|
defaultValue: true,
|
|
14
14
|
description: 'forces usage of the UCSC names over the NCBI style names from a FASTA',
|
|
15
15
|
},
|
|
16
|
-
}, {
|
|
16
|
+
}, {
|
|
17
|
+
explicitlyTyped: true,
|
|
18
|
+
preProcessSnapshot: snap => {
|
|
19
|
+
return snap.uri
|
|
20
|
+
? {
|
|
21
|
+
...snap,
|
|
22
|
+
location: {
|
|
23
|
+
uri: snap.uri,
|
|
24
|
+
baseUri: snap.baseUri,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
: snap;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
17
30
|
export default NcbiSequenceReportAliasAdapterConfigSchema;
|
|
@@ -8,13 +8,20 @@ export default class RefNameAliasAdapter extends BaseAdapter {
|
|
|
8
8
|
}
|
|
9
9
|
const results = await openLocation(loc, this.pluginManager).readFile('utf8');
|
|
10
10
|
const refColumn = this.getConf('refNameColumn');
|
|
11
|
-
|
|
11
|
+
const refColumnHeaderName = this.getConf('refNameColumnHeaderName');
|
|
12
|
+
const lines = results
|
|
12
13
|
.trim()
|
|
13
14
|
.split(/\n|\r\n|\r/)
|
|
14
|
-
.filter(f => !!f
|
|
15
|
+
.filter(f => !!f);
|
|
16
|
+
const header = lines.filter(f => f.startsWith('#'));
|
|
17
|
+
const headerCol = refColumnHeaderName && header.length
|
|
18
|
+
? header.at(-1).split('\t').indexOf(refColumnHeaderName)
|
|
19
|
+
: refColumn;
|
|
20
|
+
return lines
|
|
21
|
+
.filter(f => !f.startsWith('#'))
|
|
15
22
|
.map(row => {
|
|
16
23
|
const aliases = row.split('\t');
|
|
17
|
-
const
|
|
24
|
+
const refName = aliases[headerCol];
|
|
18
25
|
return {
|
|
19
26
|
refName: refName,
|
|
20
27
|
aliases: aliases.filter(f => !!f.trim()),
|
|
@@ -10,5 +10,10 @@ declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configura
|
|
|
10
10
|
type: string;
|
|
11
11
|
defaultValue: number;
|
|
12
12
|
};
|
|
13
|
+
refNameColumnHeaderName: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
defaultValue: string;
|
|
17
|
+
};
|
|
13
18
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
14
19
|
export default RefNameAliasAdapter;
|
|
@@ -12,5 +12,23 @@ const RefNameAliasAdapter = ConfigurationSchema('RefNameAliasAdapter', {
|
|
|
12
12
|
type: 'number',
|
|
13
13
|
defaultValue: 0,
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
refNameColumnHeaderName: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'alternative to refNameColumn, instead looks at header (starts with # and finds column name)',
|
|
18
|
+
defaultValue: '',
|
|
19
|
+
},
|
|
20
|
+
}, {
|
|
21
|
+
explicitlyTyped: true,
|
|
22
|
+
preProcessSnapshot: snap => {
|
|
23
|
+
return snap.uri
|
|
24
|
+
? {
|
|
25
|
+
...snap,
|
|
26
|
+
location: {
|
|
27
|
+
uri: snap.uri,
|
|
28
|
+
baseUri: snap.baseUri,
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
: snap;
|
|
32
|
+
},
|
|
33
|
+
});
|
|
16
34
|
export default RefNameAliasAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jbrowse/core": "^3.
|
|
40
|
-
"@mui/icons-material": "^
|
|
41
|
-
"@mui/material": "^
|
|
39
|
+
"@jbrowse/core": "^3.3.0",
|
|
40
|
+
"@mui/icons-material": "^7.0.0",
|
|
41
|
+
"@mui/material": "^7.0.0",
|
|
42
42
|
"mobx": "^6.0.0",
|
|
43
43
|
"mobx-react": "^9.0.0",
|
|
44
44
|
"mobx-state-tree": "^5.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": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
|
|
60
60
|
}
|