@jbrowse/plugin-config 3.7.0 → 4.0.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.
Files changed (101) hide show
  1. package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +1 -1
  2. package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +25 -25
  3. package/esm/ConfigurationEditorWidget/components/ColorEditor.js +2 -2
  4. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +1 -1
  5. package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +12 -9
  6. package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -1
  7. package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +8 -7
  8. package/esm/ConfigurationEditorWidget/components/JsonEditor.js +1 -1
  9. package/esm/ConfigurationEditorWidget/components/NumberEditor.js +3 -4
  10. package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +3 -3
  11. package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +1 -1
  12. package/esm/ConfigurationEditorWidget/components/SlotEditor.js +18 -19
  13. package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +1 -1
  14. package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +3 -3
  15. package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -2
  16. package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.d.ts +6 -5
  17. package/esm/ConfigurationEditorWidget/components/useSlotEditorStyles.js +1 -1
  18. package/esm/ConfigurationEditorWidget/index.js +3 -3
  19. package/esm/ConfigurationEditorWidget/model.d.ts +9 -6
  20. package/esm/ConfigurationEditorWidget/model.js +20 -3
  21. package/esm/FromConfigAdapter/FromConfigAdapter.js +1 -0
  22. package/esm/FromConfigAdapter/configSchema.d.ts +2 -2
  23. package/esm/FromConfigAdapter/index.js +2 -2
  24. package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +2 -1
  25. package/esm/FromConfigRegionsAdapter/configSchema.d.ts +2 -2
  26. package/esm/FromConfigRegionsAdapter/index.js +2 -2
  27. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +1 -1
  28. package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +1 -1
  29. package/esm/FromConfigSequenceAdapter/configSchema.d.ts +2 -2
  30. package/esm/FromConfigSequenceAdapter/index.js +2 -2
  31. package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +2 -2
  32. package/esm/NcbiSequenceReportAliasAdapter/index.js +2 -2
  33. package/esm/RefNameAliasAdapter/configSchema.d.ts +2 -2
  34. package/esm/RefNameAliasAdapter/index.js +2 -2
  35. package/esm/index.d.ts +1 -1
  36. package/esm/index.js +8 -11
  37. package/package.json +25 -31
  38. package/dist/ConfigurationEditorWidget/components/BooleanEditor.d.ts +0 -9
  39. package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +0 -11
  40. package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +0 -10
  41. package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +0 -73
  42. package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +0 -18
  43. package/dist/ConfigurationEditorWidget/components/ColorEditor.js +0 -33
  44. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +0 -9
  45. package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -72
  46. package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +0 -4
  47. package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +0 -14
  48. package/dist/ConfigurationEditorWidget/components/HeadingComponent.d.ts +0 -8
  49. package/dist/ConfigurationEditorWidget/components/HeadingComponent.js +0 -20
  50. package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +0 -9
  51. package/dist/ConfigurationEditorWidget/components/JsonEditor.js +0 -55
  52. package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +0 -10
  53. package/dist/ConfigurationEditorWidget/components/NumberEditor.js +0 -26
  54. package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +0 -10
  55. package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +0 -40
  56. package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +0 -6
  57. package/dist/ConfigurationEditorWidget/components/SlotEditor.js +0 -92
  58. package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +0 -11
  59. package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +0 -39
  60. package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +0 -13
  61. package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +0 -48
  62. package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +0 -8
  63. package/dist/ConfigurationEditorWidget/components/TypeSelector.js +0 -11
  64. package/dist/ConfigurationEditorWidget/components/useSlotEditorStyles.d.ts +0 -9
  65. package/dist/ConfigurationEditorWidget/components/useSlotEditorStyles.js +0 -21
  66. package/dist/ConfigurationEditorWidget/index.d.ts +0 -2
  67. package/dist/ConfigurationEditorWidget/index.js +0 -57
  68. package/dist/ConfigurationEditorWidget/model.d.ts +0 -8
  69. package/dist/ConfigurationEditorWidget/model.js +0 -18
  70. package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +0 -17
  71. package/dist/FromConfigAdapter/FromConfigAdapter.js +0 -56
  72. package/dist/FromConfigAdapter/configSchema.d.ts +0 -7
  73. package/dist/FromConfigAdapter/configSchema.js +0 -11
  74. package/dist/FromConfigAdapter/index.d.ts +0 -2
  75. package/dist/FromConfigAdapter/index.js +0 -51
  76. package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +0 -14
  77. package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +0 -41
  78. package/dist/FromConfigRegionsAdapter/configSchema.d.ts +0 -7
  79. package/dist/FromConfigRegionsAdapter/configSchema.js +0 -14
  80. package/dist/FromConfigRegionsAdapter/index.d.ts +0 -2
  81. package/dist/FromConfigRegionsAdapter/index.js +0 -51
  82. package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +0 -12
  83. package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +0 -56
  84. package/dist/FromConfigSequenceAdapter/configSchema.d.ts +0 -7
  85. package/dist/FromConfigSequenceAdapter/configSchema.js +0 -14
  86. package/dist/FromConfigSequenceAdapter/index.d.ts +0 -2
  87. package/dist/FromConfigSequenceAdapter/index.js +0 -51
  88. package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +0 -9
  89. package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +0 -41
  90. package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -15
  91. package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +0 -32
  92. package/dist/NcbiSequenceReportAliasAdapter/index.d.ts +0 -2
  93. package/dist/NcbiSequenceReportAliasAdapter/index.js +0 -53
  94. package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +0 -8
  95. package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +0 -39
  96. package/dist/RefNameAliasAdapter/configSchema.d.ts +0 -19
  97. package/dist/RefNameAliasAdapter/configSchema.js +0 -36
  98. package/dist/RefNameAliasAdapter/index.d.ts +0 -2
  99. package/dist/RefNameAliasAdapter/index.js +0 -51
  100. package/dist/index.d.ts +0 -13
  101. package/dist/index.js +0 -64
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = FromConfigRegionsAdapterF;
40
- const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function FromConfigRegionsAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => new pluggableElementTypes_1.AdapterType({
44
- name: 'FromConfigRegionsAdapter',
45
- configSchema: configSchema_1.default,
46
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./FromConfigRegionsAdapter'))).then(r => r.default),
47
- adapterMetadata: {
48
- hiddenFromGUI: true,
49
- },
50
- }));
51
- }
@@ -1,12 +0,0 @@
1
- import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter';
2
- import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
- import type { Feature } from '@jbrowse/core/util/simpleFeature';
4
- import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
5
- export default class FromConfigSequenceAdapter extends FromConfigAdapter implements RegionsAdapter {
6
- getFeatures(region: NoAssemblyRegion): import("rxjs").Observable<Feature>;
7
- getRegions(): Promise<{
8
- start: number;
9
- end: number;
10
- refName: string;
11
- }[]>;
12
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const rxjs_1 = require("@jbrowse/core/util/rxjs");
7
- const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
8
- const rxjs_2 = require("rxjs");
9
- const operators_1 = require("rxjs/operators");
10
- const FromConfigAdapter_1 = __importDefault(require("../FromConfigAdapter/FromConfigAdapter"));
11
- class FromConfigSequenceAdapter extends FromConfigAdapter_1.default {
12
- getFeatures(region) {
13
- return (0, rxjs_1.ObservableCreate)(async (observer) => {
14
- const feats = await (0, rxjs_2.firstValueFrom)(super.getFeatures(region).pipe((0, operators_1.toArray)()));
15
- const feat = feats[0];
16
- observer.next(new simpleFeature_1.default({
17
- ...feat.toJSON(),
18
- uniqueId: `${feat.id()}:${region.start}-${region.end}`,
19
- end: region.end,
20
- start: region.start,
21
- seq: feat
22
- .get('seq')
23
- .slice(Math.max(region.start - feat.get('start'), 0), Math.max(region.end - feat.get('start'), 0)),
24
- }));
25
- observer.complete();
26
- });
27
- }
28
- async getRegions() {
29
- const regions = [];
30
- for (const [refName, features] of this.features) {
31
- let currentRegion;
32
- for (const feature of features) {
33
- if (currentRegion &&
34
- currentRegion.end >= feature.get('start') &&
35
- currentRegion.start <= feature.get('end')) {
36
- currentRegion.end = feature.get('end');
37
- }
38
- else {
39
- if (currentRegion) {
40
- regions.push(currentRegion);
41
- }
42
- currentRegion = {
43
- refName,
44
- start: feature.get('start'),
45
- end: feature.get('end'),
46
- };
47
- }
48
- }
49
- if (currentRegion) {
50
- regions.push(currentRegion);
51
- }
52
- }
53
- return regions;
54
- }
55
- }
56
- exports.default = FromConfigSequenceAdapter;
@@ -1,7 +0,0 @@
1
- declare const sequenceConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- features: {
3
- type: string;
4
- defaultValue: never[];
5
- };
6
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
7
- export default sequenceConfigSchema;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- function x() { }
5
- const sequenceConfigSchema = (0, configuration_1.ConfigurationSchema)('FromConfigSequenceAdapter', {
6
- features: {
7
- type: 'frozen',
8
- defaultValue: [],
9
- },
10
- }, {
11
- explicitlyTyped: true,
12
- implicitIdentifier: 'adapterId',
13
- });
14
- exports.default = sequenceConfigSchema;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function FromConfigSequenceAdapterF(pluginManager: PluginManager): void;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = FromConfigSequenceAdapterF;
40
- const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function FromConfigSequenceAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => new pluggableElementTypes_1.AdapterType({
44
- name: 'FromConfigSequenceAdapter',
45
- configSchema: configSchema_1.default,
46
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./FromConfigSequenceAdapter'))).then(r => r.default),
47
- adapterMetadata: {
48
- hiddenFromGUI: true,
49
- },
50
- }));
51
- }
@@ -1,9 +0,0 @@
1
- import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import type { BaseRefNameAliasAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
- export default class NcbiSequenceReportAliasAdapter extends BaseAdapter implements BaseRefNameAliasAdapter {
4
- getRefNameAliases(): Promise<{
5
- refName: string;
6
- aliases: string[];
7
- override: any;
8
- }[]>;
9
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
4
- const io_1 = require("@jbrowse/core/util/io");
5
- class NcbiSequenceReportAliasAdapter extends BaseAdapter_1.BaseAdapter {
6
- async getRefNameAliases() {
7
- const loc = this.getConf('location');
8
- if (loc.uri === '' || loc.uri === '/path/to/my/sequence_report.tsv') {
9
- return [];
10
- }
11
- const override = this.getConf('useNameOverride');
12
- const results = await (0, io_1.openLocation)(loc, this.pluginManager).readFile('utf8');
13
- const lines = results
14
- .split(/\n|\r\n|\r/)
15
- .filter(f => !!f.trim())
16
- .map(row => row.split('\t'));
17
- const r = lines[0] || [];
18
- const genBankIdx = r.indexOf('GenBank seq accession');
19
- const refSeqIdx = r.indexOf('RefSeq seq accession');
20
- const ucscIdx = r.indexOf('UCSC style name');
21
- const seqNameIdx = r.indexOf('Sequence name');
22
- if (genBankIdx === -1 || refSeqIdx === -1 || ucscIdx === -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[ucscIdx] || !!cols[seqNameIdx])
28
- .map(cols => ({
29
- refName: (cols[ucscIdx] || cols[seqNameIdx]),
30
- aliases: [
31
- cols[genBankIdx],
32
- cols[refSeqIdx],
33
- cols[ucscIdx],
34
- cols[seqNameIdx],
35
- ].filter((f) => !!f),
36
- override,
37
- }))
38
- .filter(f => !!f.refName);
39
- }
40
- }
41
- exports.default = NcbiSequenceReportAliasAdapter;
@@ -1,15 +0,0 @@
1
- declare const NcbiSequenceReportAliasAdapterConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- location: {
3
- type: string;
4
- defaultValue: {
5
- uri: string;
6
- locationType: string;
7
- };
8
- };
9
- useNameOverride: {
10
- type: string;
11
- defaultValue: boolean;
12
- description: string;
13
- };
14
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
15
- export default NcbiSequenceReportAliasAdapterConfigSchema;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- function x() { }
5
- const NcbiSequenceReportAliasAdapterConfigSchema = (0, configuration_1.ConfigurationSchema)('NcbiSequenceReportAliasAdapter', {
6
- location: {
7
- type: 'fileLocation',
8
- defaultValue: {
9
- uri: '/path/to/my/sequence_report.tsv',
10
- locationType: 'UriLocation',
11
- },
12
- },
13
- useNameOverride: {
14
- type: 'boolean',
15
- defaultValue: true,
16
- description: 'forces usage of the UCSC names over the NCBI style names from a FASTA',
17
- },
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
- });
32
- exports.default = NcbiSequenceReportAliasAdapterConfigSchema;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function NcbiSequenceReportAliasAdapterF(pluginManager: PluginManager): void;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = NcbiSequenceReportAliasAdapterF;
40
- const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function NcbiSequenceReportAliasAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => {
44
- return new pluggableElementTypes_1.AdapterType({
45
- name: 'NcbiSequenceReportAliasAdapter',
46
- configSchema: configSchema_1.default,
47
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./NcbiSequenceReportAliasAdapter'))).then(r => r.default),
48
- adapterMetadata: {
49
- hiddenFromGUI: true,
50
- },
51
- });
52
- });
53
- }
@@ -1,8 +0,0 @@
1
- import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import type { BaseRefNameAliasAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
- export default class RefNameAliasAdapter extends BaseAdapter implements BaseRefNameAliasAdapter {
4
- getRefNameAliases(): Promise<{
5
- refName: string;
6
- aliases: string[];
7
- }[]>;
8
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
4
- const io_1 = require("@jbrowse/core/util/io");
5
- class RefNameAliasAdapter extends BaseAdapter_1.BaseAdapter {
6
- async getRefNameAliases() {
7
- const loc = this.getConf('location');
8
- if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
9
- return [];
10
- }
11
- const results = await (0, io_1.openLocation)(loc, this.pluginManager).readFile('utf8');
12
- const refColumn = this.getConf('refNameColumn');
13
- const refColumnHeaderName = this.getConf('refNameColumnHeaderName');
14
- const lines = results
15
- .trim()
16
- .split(/\n|\r\n|\r/)
17
- .filter(f => !!f);
18
- const header = lines.filter(f => f.startsWith('#'));
19
- const headerCol = refColumnHeaderName && header.length
20
- ? header
21
- .at(-1)
22
- .slice(1)
23
- .split('\t')
24
- .map(t => t.trim())
25
- .indexOf(refColumnHeaderName)
26
- : refColumn;
27
- return lines
28
- .filter(f => !f.startsWith('#'))
29
- .map(row => {
30
- const aliases = row.split('\t');
31
- const refName = aliases[headerCol];
32
- return {
33
- refName: refName,
34
- aliases: aliases.filter(f => !!f.trim()),
35
- };
36
- });
37
- }
38
- }
39
- exports.default = RefNameAliasAdapter;
@@ -1,19 +0,0 @@
1
- declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- location: {
3
- type: string;
4
- defaultValue: {
5
- uri: string;
6
- locationType: string;
7
- };
8
- };
9
- refNameColumn: {
10
- type: string;
11
- defaultValue: number;
12
- };
13
- refNameColumnHeaderName: {
14
- type: string;
15
- description: string;
16
- defaultValue: string;
17
- };
18
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
19
- export default RefNameAliasAdapter;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- function x() { }
5
- const RefNameAliasAdapter = (0, configuration_1.ConfigurationSchema)('RefNameAliasAdapter', {
6
- location: {
7
- type: 'fileLocation',
8
- defaultValue: {
9
- uri: '/path/to/my/aliases.txt',
10
- locationType: 'UriLocation',
11
- },
12
- },
13
- refNameColumn: {
14
- type: 'number',
15
- defaultValue: 0,
16
- },
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
- });
36
- exports.default = RefNameAliasAdapter;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function RefNameAliasAdapterF(pluginManager: PluginManager): void;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.default = RefNameAliasAdapterF;
40
- const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
41
- const configSchema_1 = __importDefault(require("./configSchema"));
42
- function RefNameAliasAdapterF(pluginManager) {
43
- pluginManager.addAdapterType(() => new pluggableElementTypes_1.AdapterType({
44
- name: 'RefNameAliasAdapter',
45
- configSchema: configSchema_1.default,
46
- getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./RefNameAliasAdapter'))).then(r => r.default),
47
- adapterMetadata: {
48
- hiddenFromGUI: true,
49
- },
50
- }));
51
- }
package/dist/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import Plugin from '@jbrowse/core/Plugin';
2
- import type PluginManager from '@jbrowse/core/PluginManager';
3
- declare const LazyConfigurationEditorComponent: import("react").LazyExoticComponent<({ model, }: {
4
- model: {
5
- target: import("@jbrowse/core/configuration").AnyConfigurationModel;
6
- };
7
- session?: import("@jbrowse/core/util").AbstractSessionModel;
8
- }) => import("react/jsx-runtime").JSX.Element>;
9
- export default class ConfigurationPlugin extends Plugin {
10
- name: string;
11
- install(pluginManager: PluginManager): void;
12
- }
13
- export { LazyConfigurationEditorComponent as ConfigurationEditor };
package/dist/index.js DELETED
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ConfigurationEditor = void 0;
40
- const react_1 = require("react");
41
- const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
42
- const ConfigurationEditorWidget_1 = __importDefault(require("./ConfigurationEditorWidget"));
43
- const FromConfigAdapter_1 = __importDefault(require("./FromConfigAdapter"));
44
- const FromConfigRegionsAdapter_1 = __importDefault(require("./FromConfigRegionsAdapter"));
45
- const FromConfigSequenceAdapter_1 = __importDefault(require("./FromConfigSequenceAdapter"));
46
- const NcbiSequenceReportAliasAdapter_1 = __importDefault(require("./NcbiSequenceReportAliasAdapter"));
47
- const RefNameAliasAdapter_1 = __importDefault(require("./RefNameAliasAdapter"));
48
- const LazyConfigurationEditorComponent = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ConfigurationEditorWidget/components/ConfigurationEditor'))));
49
- exports.ConfigurationEditor = LazyConfigurationEditorComponent;
50
- class ConfigurationPlugin extends Plugin_1.default {
51
- constructor() {
52
- super(...arguments);
53
- this.name = 'ConfigurationPlugin';
54
- }
55
- install(pluginManager) {
56
- (0, FromConfigAdapter_1.default)(pluginManager);
57
- (0, FromConfigRegionsAdapter_1.default)(pluginManager);
58
- (0, FromConfigSequenceAdapter_1.default)(pluginManager);
59
- (0, RefNameAliasAdapter_1.default)(pluginManager);
60
- (0, ConfigurationEditorWidget_1.default)(pluginManager);
61
- (0, NcbiSequenceReportAliasAdapter_1.default)(pluginManager);
62
- }
63
- }
64
- exports.default = ConfigurationPlugin;