@jbrowse/react-circular-genome-view2 3.2.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 (64) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/JBrowseCircularGenomeView/JBrowseCircularGenomeView.d.ts +5 -0
  4. package/dist/JBrowseCircularGenomeView/JBrowseCircularGenomeView.js +23 -0
  5. package/dist/JBrowseCircularGenomeView/index.d.ts +1 -0
  6. package/dist/JBrowseCircularGenomeView/index.js +8 -0
  7. package/dist/corePlugins.d.ts +3 -0
  8. package/dist/corePlugins.js +22 -0
  9. package/dist/createModel/AboutDialog.d.ts +1 -0
  10. package/dist/createModel/AboutDialog.js +5 -0
  11. package/dist/createModel/createConfigModel.d.ts +104 -0
  12. package/dist/createModel/createConfigModel.js +43 -0
  13. package/dist/createModel/createModel.d.ts +1387 -0
  14. package/dist/createModel/createModel.js +117 -0
  15. package/dist/createModel/createSessionModel.d.ts +260 -0
  16. package/dist/createModel/createSessionModel.js +115 -0
  17. package/dist/createModel/index.d.ts +3 -0
  18. package/dist/createModel/index.js +12 -0
  19. package/dist/createViewState.d.ts +3780 -0
  20. package/dist/createViewState.js +64 -0
  21. package/dist/index.d.ts +4 -0
  22. package/dist/index.js +14 -0
  23. package/dist/loadPlugins.d.ts +13 -0
  24. package/dist/loadPlugins.js +12 -0
  25. package/dist/react-circular-genome-view.umd.production.min.js +185 -0
  26. package/dist/react-circular-genome-view.umd.production.min.js.LICENSE.txt +141 -0
  27. package/dist/react-circular-genome-view.umd.production.min.js.map +1 -0
  28. package/dist/types.d.ts +5 -0
  29. package/dist/types.js +2 -0
  30. package/dist/version.d.ts +1 -0
  31. package/dist/version.js +4 -0
  32. package/dist/webpack.d.ts +7 -0
  33. package/dist/webpack.js +53 -0
  34. package/docs/example.md +105 -0
  35. package/docs/img/exampleView.png +0 -0
  36. package/esm/JBrowseCircularGenomeView/JBrowseCircularGenomeView.d.ts +5 -0
  37. package/esm/JBrowseCircularGenomeView/JBrowseCircularGenomeView.js +21 -0
  38. package/esm/JBrowseCircularGenomeView/index.d.ts +1 -0
  39. package/esm/JBrowseCircularGenomeView/index.js +1 -0
  40. package/esm/corePlugins.d.ts +3 -0
  41. package/esm/corePlugins.js +17 -0
  42. package/esm/createModel/AboutDialog.d.ts +1 -0
  43. package/esm/createModel/AboutDialog.js +1 -0
  44. package/esm/createModel/createConfigModel.d.ts +104 -0
  45. package/esm/createModel/createConfigModel.js +37 -0
  46. package/esm/createModel/createModel.d.ts +1387 -0
  47. package/esm/createModel/createModel.js +78 -0
  48. package/esm/createModel/createSessionModel.d.ts +260 -0
  49. package/esm/createModel/createSessionModel.js +76 -0
  50. package/esm/createModel/index.d.ts +3 -0
  51. package/esm/createModel/index.js +3 -0
  52. package/esm/createViewState.d.ts +3780 -0
  53. package/esm/createViewState.js +58 -0
  54. package/esm/index.d.ts +4 -0
  55. package/esm/index.js +4 -0
  56. package/esm/loadPlugins.d.ts +13 -0
  57. package/esm/loadPlugins.js +6 -0
  58. package/esm/types.d.ts +5 -0
  59. package/esm/types.js +1 -0
  60. package/esm/version.d.ts +1 -0
  61. package/esm/version.js +1 -0
  62. package/esm/webpack.d.ts +7 -0
  63. package/esm/webpack.js +7 -0
  64. package/package.json +68 -0
@@ -0,0 +1,5 @@
1
+ import type { IAnyStateTreeNode } from 'mobx-state-tree';
2
+ export interface ReferringNode {
3
+ node: IAnyStateTreeNode;
4
+ key: string;
5
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export const version: "3.2.0";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = void 0;
4
+ exports.version = '3.2.0';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export { default as JBrowseCircularGenomeView } from './JBrowseCircularGenomeView';
3
+ export { default as createModel } from './createModel';
4
+ export { default as createViewState } from './createViewState';
5
+ export { default as loadPlugins } from './loadPlugins';
6
+ export * from 'react-dom/client';
7
+ export { React };
@@ -0,0 +1,53 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.React = exports.loadPlugins = exports.createViewState = exports.createModel = exports.JBrowseCircularGenomeView = void 0;
43
+ const React = __importStar(require("react"));
44
+ exports.React = React;
45
+ var JBrowseCircularGenomeView_1 = require("./JBrowseCircularGenomeView");
46
+ Object.defineProperty(exports, "JBrowseCircularGenomeView", { enumerable: true, get: function () { return __importDefault(JBrowseCircularGenomeView_1).default; } });
47
+ var createModel_1 = require("./createModel");
48
+ Object.defineProperty(exports, "createModel", { enumerable: true, get: function () { return __importDefault(createModel_1).default; } });
49
+ var createViewState_1 = require("./createViewState");
50
+ Object.defineProperty(exports, "createViewState", { enumerable: true, get: function () { return __importDefault(createViewState_1).default; } });
51
+ var loadPlugins_1 = require("./loadPlugins");
52
+ Object.defineProperty(exports, "loadPlugins", { enumerable: true, get: function () { return __importDefault(loadPlugins_1).default; } });
53
+ __exportStar(require("react-dom/client"), exports);
@@ -0,0 +1,105 @@
1
+ This is an example of an assembly and tracks configuration for a simple human
2
+ genome example using publicly hosted data files. It includes the hg19 reference
3
+ sequence and a structural variant track.
4
+
5
+ ```tsx
6
+ import '@fontsource/roboto'
7
+ import {
8
+ createViewState,
9
+ JBrowseCircularGenomeView,
10
+ } from '@jbrowse/react-circular-genome-view2'
11
+
12
+ const assembly = {
13
+ name: 'hg19',
14
+ aliases: ['GRCh37'],
15
+ sequence: {
16
+ type: 'ReferenceSequenceTrack',
17
+ trackId: 'Pd8Wh30ei9R',
18
+ adapter: {
19
+ type: 'BgzipFastaAdapter',
20
+ fastaLocation: {
21
+ uri: 'https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz',
22
+ locationType: 'UriLocation',
23
+ },
24
+ faiLocation: {
25
+ uri: 'https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai',
26
+ locationType: 'UriLocation',
27
+ },
28
+ gziLocation: {
29
+ uri: 'https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi',
30
+ locationType: 'UriLocation',
31
+ },
32
+ },
33
+ },
34
+ refNameAliases: {
35
+ adapter: {
36
+ type: 'RefNameAliasAdapter',
37
+ location: {
38
+ uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/hg19/hg19_aliases.txt',
39
+ locationType: 'UriLocation',
40
+ },
41
+ },
42
+ },
43
+ }
44
+
45
+ const tracks = [
46
+ {
47
+ type: 'VariantTrack',
48
+ trackId: 'pacbio_sv_vcf',
49
+ name: 'HG002 Pacbio SV (VCF)',
50
+ assemblyNames: ['hg19'],
51
+ category: ['GIAB'],
52
+ adapter: {
53
+ type: 'VcfTabixAdapter',
54
+ vcfGzLocation: {
55
+ uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/hg19/pacbio/hs37d5.HG002-SequelII-CCS.bnd-only.sv.vcf.gz',
56
+ locationType: 'UriLocation',
57
+ },
58
+ index: {
59
+ location: {
60
+ uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/hg19/pacbio/hs37d5.HG002-SequelII-CCS.bnd-only.sv.vcf.gz.tbi',
61
+ locationType: 'UriLocation',
62
+ },
63
+ },
64
+ },
65
+ },
66
+ ]
67
+
68
+ const defaultSession = {
69
+ name: 'My session',
70
+ view: {
71
+ id: 'circularView',
72
+ type: 'CircularView',
73
+ bpPerPx: 5000000,
74
+ tracks: [
75
+ {
76
+ id: 'uPdLKHik1',
77
+ type: 'VariantTrack',
78
+ configuration: 'pacbio_sv_vcf',
79
+ displays: [
80
+ {
81
+ id: 'v9QVAR3oaB',
82
+ type: 'ChordVariantDisplay',
83
+ configuration: 'pacbio_sv_vcf-ChordVariantDisplay',
84
+ },
85
+ ],
86
+ },
87
+ ],
88
+ },
89
+ }
90
+
91
+ function View() {
92
+ const state = createViewState({
93
+ assembly,
94
+ tracks,
95
+ defaultSession,
96
+ })
97
+ return <JBrowseCircularGenomeView viewState={state} />
98
+ }
99
+
100
+ export default View
101
+ ```
102
+
103
+ This is what the component should look like:
104
+
105
+ ![a view](./img/exampleView.png)
Binary file
@@ -0,0 +1,5 @@
1
+ import type { ViewModel } from '../createModel/createModel';
2
+ declare const JBrowseCircularGenomeView: ({ viewState, }: {
3
+ viewState: ViewModel;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default JBrowseCircularGenomeView;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense } from 'react';
3
+ import { readConfObject } from '@jbrowse/core/configuration';
4
+ import { createJBrowseTheme } from '@jbrowse/core/ui';
5
+ import { getEnv } from '@jbrowse/core/util';
6
+ import { EmbeddedViewContainer, ModalWidget } from '@jbrowse/embedded-core';
7
+ import { ThemeProvider } from '@mui/material';
8
+ import { observer } from 'mobx-react';
9
+ const JBrowseCircularGenomeView = observer(function ({ viewState, }) {
10
+ const { session } = viewState;
11
+ const { view } = session;
12
+ const { pluginManager } = getEnv(session);
13
+ const viewType = pluginManager.getViewType(view.type);
14
+ if (!viewType) {
15
+ throw new Error(`unknown view type ${view.type}`);
16
+ }
17
+ const { ReactComponent } = viewType;
18
+ const theme = createJBrowseTheme(readConfObject(viewState.config.configuration, 'theme'));
19
+ return (_jsxs(ThemeProvider, { theme: theme, children: [_jsx(EmbeddedViewContainer, { view: view, children: _jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(ReactComponent, { model: view, session: session }) }) }, `view-${view.id}`), _jsx(ModalWidget, { session: session })] }));
20
+ });
21
+ export default JBrowseCircularGenomeView;
@@ -0,0 +1 @@
1
+ export { default } from './JBrowseCircularGenomeView';
@@ -0,0 +1 @@
1
+ export { default } from './JBrowseCircularGenomeView';
@@ -0,0 +1,3 @@
1
+ import Config from '@jbrowse/plugin-config';
2
+ declare const corePlugins: (typeof Config)[];
3
+ export default corePlugins;
@@ -0,0 +1,17 @@
1
+ import Authentication from '@jbrowse/plugin-authentication';
2
+ import CircularGenomeView from '@jbrowse/plugin-circular-view';
3
+ import Config from '@jbrowse/plugin-config';
4
+ import DataManagement from '@jbrowse/plugin-data-management';
5
+ import Sequence from '@jbrowse/plugin-sequence';
6
+ import Variants from '@jbrowse/plugin-variants';
7
+ import Wiggle from '@jbrowse/plugin-wiggle';
8
+ const corePlugins = [
9
+ Authentication,
10
+ Config,
11
+ DataManagement,
12
+ CircularGenomeView,
13
+ Sequence,
14
+ Variants,
15
+ Wiggle,
16
+ ];
17
+ export default corePlugins;
@@ -0,0 +1 @@
1
+ export { AboutDialog as default } from '@jbrowse/product-core';
@@ -0,0 +1 @@
1
+ export { AboutDialog as default } from '@jbrowse/product-core';
@@ -0,0 +1,104 @@
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
+ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ export default function createConfigModel(pluginManager: PluginManager, assemblyConfigSchemasType: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
4
+ configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
5
+ rpc: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
+ defaultDriver: {
7
+ type: string;
8
+ description: string;
9
+ defaultValue: string;
10
+ };
11
+ drivers: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IMapType<import("mobx-state-tree").ITypeUnion<import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> | undefined, import("mobx-state-tree").ModelSnapshotType<Record<string, any>>, ({} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<Record<string, any>>> & import("mobx-state-tree/dist/internal").NonEmptyObject) | undefined>>, [undefined]>;
12
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
13
+ highResolutionScaling: {
14
+ type: string;
15
+ defaultValue: number;
16
+ };
17
+ formatDetails: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
18
+ feature: {
19
+ type: string;
20
+ description: string;
21
+ defaultValue: {};
22
+ contextVariable: string[];
23
+ };
24
+ subfeatures: {
25
+ type: string;
26
+ description: string;
27
+ defaultValue: {};
28
+ contextVariable: string[];
29
+ };
30
+ depth: {
31
+ type: string;
32
+ defaultValue: number;
33
+ description: string;
34
+ };
35
+ maxDepth: {
36
+ type: string;
37
+ defaultValue: number;
38
+ description: string;
39
+ };
40
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
41
+ formatAbout: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
42
+ config: {
43
+ type: string;
44
+ description: string;
45
+ defaultValue: {};
46
+ contextVariable: string[];
47
+ };
48
+ hideUris: {
49
+ type: string;
50
+ defaultValue: boolean;
51
+ };
52
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
53
+ hierarchical: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
54
+ sort: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
55
+ trackNames: {
56
+ type: string;
57
+ defaultValue: boolean;
58
+ };
59
+ categories: {
60
+ type: string;
61
+ defaultValue: boolean;
62
+ };
63
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
64
+ defaultCollapsed: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
65
+ categoryNames: {
66
+ type: string;
67
+ defaultValue: never[];
68
+ };
69
+ topLevelCategories: {
70
+ type: string;
71
+ defaultValue: boolean;
72
+ };
73
+ subCategories: {
74
+ type: string;
75
+ defaultValue: boolean;
76
+ };
77
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
78
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
79
+ theme: {
80
+ type: string;
81
+ defaultValue: {};
82
+ };
83
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
84
+ assembly: AnyConfigurationSchemaType;
85
+ tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
86
+ internetAccounts: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
87
+ connections: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
88
+ aggregateTextSearchAdapters: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
89
+ plugins: import("mobx-state-tree").IType<any, any, any>;
90
+ }, {
91
+ readonly assemblies: ({
92
+ [x: string]: any;
93
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
94
+ setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
95
+ [x: string]: any;
96
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
97
+ setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
98
+ [x: string]: any;
99
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
100
+ } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
101
+ } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>)[];
102
+ readonly assemblyName: string;
103
+ readonly rpcManager: any;
104
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -0,0 +1,37 @@
1
+ import { ConfigurationSchema, readConfObject, } from '@jbrowse/core/configuration';
2
+ import RpcManager from '@jbrowse/core/rpc/RpcManager';
3
+ import { FormatAboutConfigSchemaFactory, FormatDetailsConfigSchemaFactory, HierarchicalConfigSchemaFactory, } from '@jbrowse/product-core';
4
+ import { getParent, types } from 'mobx-state-tree';
5
+ export default function createConfigModel(pluginManager, assemblyConfigSchemasType) {
6
+ return types
7
+ .model('Configuration', {
8
+ configuration: ConfigurationSchema('Root', {
9
+ rpc: RpcManager.configSchema,
10
+ highResolutionScaling: {
11
+ type: 'number',
12
+ defaultValue: 2,
13
+ },
14
+ formatDetails: FormatDetailsConfigSchemaFactory(),
15
+ formatAbout: FormatAboutConfigSchemaFactory(),
16
+ hierarchical: HierarchicalConfigSchemaFactory(),
17
+ theme: { type: 'frozen', defaultValue: {} },
18
+ }),
19
+ assembly: assemblyConfigSchemasType,
20
+ tracks: types.array(pluginManager.pluggableConfigSchemaType('track')),
21
+ internetAccounts: types.array(pluginManager.pluggableConfigSchemaType('internet account')),
22
+ connections: types.array(pluginManager.pluggableConfigSchemaType('connection')),
23
+ aggregateTextSearchAdapters: types.array(pluginManager.pluggableConfigSchemaType('text search adapter')),
24
+ plugins: types.frozen(),
25
+ })
26
+ .views(self => ({
27
+ get assemblies() {
28
+ return [self.assembly];
29
+ },
30
+ get assemblyName() {
31
+ return readConfObject(self.assembly, 'name');
32
+ },
33
+ get rpcManager() {
34
+ return getParent(self).rpcManager;
35
+ },
36
+ }));
37
+ }