@jbrowse/plugin-gccontent 2.2.1

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 (51) hide show
  1. package/LICENSE +201 -0
  2. package/dist/GCContentAdapter/GCContentAdapter.d.ts +17 -0
  3. package/dist/GCContentAdapter/GCContentAdapter.js +89 -0
  4. package/dist/GCContentAdapter/GCContentAdapter.js.map +1 -0
  5. package/dist/GCContentAdapter/configSchema.d.ts +3 -0
  6. package/dist/GCContentAdapter/configSchema.js +17 -0
  7. package/dist/GCContentAdapter/configSchema.js.map +1 -0
  8. package/dist/GCContentAdapter/index.d.ts +3 -0
  9. package/dist/GCContentAdapter/index.js +44 -0
  10. package/dist/GCContentAdapter/index.js.map +1 -0
  11. package/dist/LinearGCContentDisplay/config.d.ts +2 -0
  12. package/dist/LinearGCContentDisplay/config.js +13 -0
  13. package/dist/LinearGCContentDisplay/config.js.map +1 -0
  14. package/dist/LinearGCContentDisplay/index.d.ts +3 -0
  15. package/dist/LinearGCContentDisplay/index.js +23 -0
  16. package/dist/LinearGCContentDisplay/index.js.map +1 -0
  17. package/dist/LinearGCContentDisplay/stateModel.d.ts +305 -0
  18. package/dist/LinearGCContentDisplay/stateModel.js +29 -0
  19. package/dist/LinearGCContentDisplay/stateModel.js.map +1 -0
  20. package/dist/index.d.ts +6 -0
  21. package/dist/index.js +21 -0
  22. package/dist/index.js.map +1 -0
  23. package/esm/GCContentAdapter/GCContentAdapter.d.ts +17 -0
  24. package/esm/GCContentAdapter/GCContentAdapter.js +86 -0
  25. package/esm/GCContentAdapter/GCContentAdapter.js.map +1 -0
  26. package/esm/GCContentAdapter/configSchema.d.ts +3 -0
  27. package/esm/GCContentAdapter/configSchema.js +15 -0
  28. package/esm/GCContentAdapter/configSchema.js.map +1 -0
  29. package/esm/GCContentAdapter/index.d.ts +3 -0
  30. package/esm/GCContentAdapter/index.js +16 -0
  31. package/esm/GCContentAdapter/index.js.map +1 -0
  32. package/esm/LinearGCContentDisplay/config.d.ts +2 -0
  33. package/esm/LinearGCContentDisplay/config.js +10 -0
  34. package/esm/LinearGCContentDisplay/config.js.map +1 -0
  35. package/esm/LinearGCContentDisplay/index.d.ts +3 -0
  36. package/esm/LinearGCContentDisplay/index.js +18 -0
  37. package/esm/LinearGCContentDisplay/index.js.map +1 -0
  38. package/esm/LinearGCContentDisplay/stateModel.d.ts +305 -0
  39. package/esm/LinearGCContentDisplay/stateModel.js +26 -0
  40. package/esm/LinearGCContentDisplay/stateModel.js.map +1 -0
  41. package/esm/index.d.ts +6 -0
  42. package/esm/index.js +15 -0
  43. package/esm/index.js.map +1 -0
  44. package/package.json +59 -0
  45. package/src/GCContentAdapter/GCContentAdapter.ts +99 -0
  46. package/src/GCContentAdapter/configSchema.ts +22 -0
  47. package/src/GCContentAdapter/index.ts +22 -0
  48. package/src/LinearGCContentDisplay/config.ts +19 -0
  49. package/src/LinearGCContentDisplay/index.ts +20 -0
  50. package/src/LinearGCContentDisplay/stateModel.ts +39 -0
  51. package/src/index.ts +15 -0
@@ -0,0 +1,305 @@
1
+ /// <reference types="react" />
2
+ import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ import PluginManager from '@jbrowse/core/PluginManager';
4
+ export default function stateModelFactory(pluginManager: PluginManager, configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
5
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
6
+ type: import("mobx-state-tree").ISimpleType<string>;
7
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
8
+ } & {
9
+ height: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
10
+ blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
11
+ key: import("mobx-state-tree").ISimpleType<string>;
12
+ region: import("mobx-state-tree").IModelType<{
13
+ refName: import("mobx-state-tree").ISimpleType<string>;
14
+ start: import("mobx-state-tree").ISimpleType<number>;
15
+ end: import("mobx-state-tree").ISimpleType<number>;
16
+ reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
17
+ } & {
18
+ assemblyName: import("mobx-state-tree").ISimpleType<string>;
19
+ }, {
20
+ setRefName(newRefName: string): void;
21
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
22
+ reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
23
+ isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
24
+ isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
25
+ }, {
26
+ renderInProgress: AbortController | undefined;
27
+ filled: boolean;
28
+ reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
29
+ features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
30
+ layout: any;
31
+ status: string;
32
+ error: unknown;
33
+ message: string | undefined;
34
+ maxHeightReached: boolean;
35
+ ReactComponent: ({ model, }: {
36
+ model: any;
37
+ }) => any;
38
+ renderProps: any;
39
+ } & {
40
+ doReload(): void;
41
+ afterAttach(): void;
42
+ setStatus(message: string): void;
43
+ setLoading(abortController: AbortController): void;
44
+ setMessage(messageText: string): void;
45
+ setRendered(props: {
46
+ reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
47
+ features: Map<string, import("@jbrowse/core/util").Feature>;
48
+ layout: any;
49
+ maxHeightReached: boolean;
50
+ renderProps: any;
51
+ } | undefined): void;
52
+ setError(error: unknown): void;
53
+ reload(): void;
54
+ beforeDestroy(): void;
55
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
56
+ userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
57
+ userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
58
+ } & {
59
+ type: import("mobx-state-tree").ISimpleType<"LinearWiggleDisplay">;
60
+ configuration: import("mobx-state-tree").ITypeUnion<any, any, any>;
61
+ selectedRendering: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
62
+ resolution: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
63
+ fill: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
64
+ minSize: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
65
+ color: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
66
+ posColor: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
67
+ negColor: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
68
+ summaryScoreMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
69
+ rendererTypeNameState: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
70
+ scale: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
71
+ autoscale: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
72
+ displayCrossHatches: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
73
+ constraints: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
74
+ max: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
75
+ min: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
76
+ }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
77
+ } & {
78
+ type: import("mobx-state-tree").ISimpleType<"LinearGCContentDisplay">;
79
+ }, {
80
+ rendererTypeName: string;
81
+ error: unknown;
82
+ } & {
83
+ readonly RenderingComponent: import("react").FC<{
84
+ model: {
85
+ id: string;
86
+ type: string;
87
+ rpcDriverName: string | undefined;
88
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
89
+ rendererTypeName: string;
90
+ error: unknown;
91
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
92
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
93
+ type: import("mobx-state-tree").ISimpleType<string>;
94
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
95
+ }, {
96
+ rendererTypeName: string;
97
+ error: unknown;
98
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
99
+ onHorizontalScroll?: Function | undefined;
100
+ blockState?: Record<string, any> | undefined;
101
+ }>;
102
+ readonly DisplayBlurb: import("react").FC<{
103
+ model: {
104
+ id: string;
105
+ type: string;
106
+ rpcDriverName: string | undefined;
107
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
108
+ rendererTypeName: string;
109
+ error: unknown;
110
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
111
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
112
+ type: import("mobx-state-tree").ISimpleType<string>;
113
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
114
+ }, {
115
+ rendererTypeName: string;
116
+ error: unknown;
117
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
118
+ }> | null;
119
+ readonly adapterConfig: any;
120
+ readonly parentTrack: any;
121
+ renderProps(): any;
122
+ readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
123
+ readonly DisplayMessageComponent: import("react").FC<any> | undefined;
124
+ trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
125
+ readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
126
+ regionCannotBeRendered(): undefined;
127
+ } & {
128
+ setError(error?: unknown): void;
129
+ setRpcDriverName(rpcDriverName: string): void;
130
+ reload(): void;
131
+ } & {
132
+ currBpPerPx: number;
133
+ message: string;
134
+ featureIdUnderMouse: string | undefined;
135
+ contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
136
+ scrollTop: number;
137
+ estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
138
+ estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
139
+ } & {
140
+ readonly blockType: "dynamicBlocks" | "staticBlocks";
141
+ readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
142
+ } & {
143
+ readonly renderDelay: number;
144
+ readonly TooltipComponent: import("react").FC<any>;
145
+ readonly selectedFeatureId: string | undefined;
146
+ readonly DisplayMessageComponent: import("react").FC<any> | undefined;
147
+ } & {
148
+ readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
149
+ readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
150
+ getFeatureOverlapping(blockKey: string, x: number, y: number): any;
151
+ getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
152
+ searchFeatureByID(id: string): [number, number, number, number] | undefined;
153
+ readonly currentBytesRequested: number;
154
+ readonly currentFeatureScreenDensity: number;
155
+ readonly maxFeatureScreenDensity: any;
156
+ readonly estimatedStatsReady: boolean;
157
+ readonly maxAllowableBytes: number;
158
+ } & {
159
+ setMessage(message: string): void;
160
+ afterAttach(): void;
161
+ estimateRegionsStats(regions: import("@jbrowse/core/util").Region[], opts: {
162
+ headers?: Record<string, string> | undefined;
163
+ signal?: AbortSignal | undefined;
164
+ filters?: string[] | undefined;
165
+ }): Promise<{}>;
166
+ setRegionStatsP(p?: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined): void;
167
+ setRegionStats(estimatedRegionStats?: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined): void;
168
+ clearRegionStats(): void;
169
+ setHeight(displayHeight: number): number;
170
+ resizeHeight(distance: number): number;
171
+ setScrollTop(scrollTop: number): void;
172
+ updateStatsLimit(stats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats): void;
173
+ addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
174
+ setCurrBpPerPx(n: number): void;
175
+ deleteBlock(key: string): void;
176
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
177
+ clearFeatureSelection(): void;
178
+ setFeatureIdUnderMouse(feature: string | undefined): void;
179
+ reload(): void;
180
+ setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
181
+ } & {
182
+ readonly regionTooLarge: boolean;
183
+ readonly regionTooLargeReason: string;
184
+ } & {
185
+ reload(): Promise<void>;
186
+ afterAttach(): void;
187
+ } & {
188
+ regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
189
+ regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): JSX.Element | null;
190
+ trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
191
+ contextMenuItems(): {
192
+ label: string;
193
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
194
+ muiName: string;
195
+ };
196
+ onClick: () => void;
197
+ }[];
198
+ renderProps(): any;
199
+ } & {
200
+ renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").ExportSvgOptions & {
201
+ overrideHeight: number;
202
+ }): Promise<JSX.Element>;
203
+ } & {
204
+ statsReady: boolean;
205
+ message: string | undefined;
206
+ stats: {
207
+ scoreMin: number;
208
+ scoreMax: number;
209
+ };
210
+ statsFetchInProgress: AbortController | undefined;
211
+ } & {
212
+ updateStats(stats: {
213
+ scoreMin: number;
214
+ scoreMax: number;
215
+ }): void;
216
+ setColor(color?: string | undefined): void;
217
+ setPosColor(color?: string | undefined): void;
218
+ setNegColor(color?: string | undefined): void;
219
+ setLoading(aborter: AbortController): void;
220
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
221
+ setResolution(res: number): void;
222
+ setFill(fill: number): void;
223
+ toggleLogScale(): void;
224
+ setScaleType(scale?: string | undefined): void;
225
+ setSummaryScoreMode(val: string): void;
226
+ setAutoscale(val: string): void;
227
+ setMaxScore(val?: number | undefined): void;
228
+ setRendererType(val: string): void;
229
+ setMinScore(val?: number | undefined): void;
230
+ toggleCrossHatches(): void;
231
+ setCrossHatches(cross: boolean): void;
232
+ } & {
233
+ readonly TooltipComponent: import("react").FC<{}>;
234
+ readonly adapterTypeName: any;
235
+ readonly rendererTypeNameSimple: any;
236
+ readonly rendererTypeName: string;
237
+ readonly filters: undefined;
238
+ readonly scaleType: any;
239
+ readonly maxScore: any;
240
+ readonly minScore: any;
241
+ } & {
242
+ readonly rendererConfig: {
243
+ [x: string]: any;
244
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
245
+ setSubschema(slotName: string, data: unknown): any;
246
+ } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
247
+ } & {
248
+ readonly filled: any;
249
+ readonly summaryScoreModeSetting: any;
250
+ readonly domain: number[];
251
+ readonly needsScalebar: boolean;
252
+ readonly scaleOpts: {
253
+ domain: number[];
254
+ stats: {
255
+ scoreMin: number;
256
+ scoreMax: number;
257
+ };
258
+ autoscaleType: any;
259
+ scaleType: any;
260
+ inverted: any;
261
+ };
262
+ readonly canHaveFill: boolean;
263
+ readonly autoscaleType: any;
264
+ readonly displayCrossHatchesSetting: any;
265
+ } & {
266
+ readonly ticks: {
267
+ range: number[];
268
+ values: number[];
269
+ format: (d: import("d3-scale").NumberValue) => string;
270
+ position: import("d3-scale").ScaleLinear<number, number, never> | import("d3-scale").ScaleQuantize<number, never>;
271
+ };
272
+ readonly adapterCapabilities: string[];
273
+ } & {
274
+ renderProps(): any;
275
+ readonly hasResolution: boolean;
276
+ readonly hasGlobalStats: boolean;
277
+ readonly fillSetting: 0 | 1 | 2;
278
+ } & {
279
+ trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
280
+ label: string;
281
+ subMenu: {
282
+ label: string;
283
+ type: string;
284
+ checked: boolean;
285
+ onClick: () => void;
286
+ }[];
287
+ type?: undefined;
288
+ checked?: undefined;
289
+ onClick?: undefined;
290
+ } | {
291
+ type: string;
292
+ label: string;
293
+ checked: any;
294
+ onClick: () => void;
295
+ subMenu?: undefined;
296
+ })[];
297
+ } & {
298
+ reload(): Promise<void>;
299
+ afterAttach(): void;
300
+ renderSvg(opts: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").ExportSvgOptions & {
301
+ overrideHeight: number;
302
+ }): Promise<JSX.Element>;
303
+ } & {
304
+ renderProps(): any;
305
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const configuration_1 = require("@jbrowse/core/configuration");
4
+ const mobx_state_tree_1 = require("mobx-state-tree");
5
+ function stateModelFactory(pluginManager, configSchema) {
6
+ const WigglePlugin = pluginManager.getPlugin('WigglePlugin');
7
+ const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;
8
+ return mobx_state_tree_1.types
9
+ .compose('LinearGCContentDisplay', linearWiggleDisplayModelFactory(pluginManager, configSchema), mobx_state_tree_1.types.model({
10
+ type: mobx_state_tree_1.types.literal('LinearGCContentDisplay'),
11
+ }))
12
+ .views(self => {
13
+ const { renderProps: superRenderProps } = self;
14
+ return {
15
+ renderProps() {
16
+ const sequenceAdapter = (0, configuration_1.getConf)(self.parentTrack, 'adapter');
17
+ return {
18
+ ...superRenderProps(),
19
+ adapterConfig: {
20
+ type: 'GCContentAdapter',
21
+ sequenceAdapter,
22
+ },
23
+ };
24
+ },
25
+ };
26
+ });
27
+ }
28
+ exports.default = stateModelFactory;
29
+ //# sourceMappingURL=stateModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateModel.js","sourceRoot":"","sources":["../../src/LinearGCContentDisplay/stateModel.ts"],"names":[],"mappings":";;AAAA,+DAGoC;AAEpC,qDAAuC;AAEvC,SAAwB,iBAAiB,CACvC,aAA4B,EAC5B,YAAwC;IAExC,MAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAC1C,cAAc,CAC6B,CAAA;IAC7C,MAAM,EAAE,+BAA+B,EAAE,GAAG,YAAY,CAAC,OAAO,CAAA;IAChE,OAAO,uBAAK;SACT,OAAO,CACN,wBAAwB,EACxB,+BAA+B,CAAC,aAAa,EAAE,YAAY,CAAC,EAC5D,uBAAK,CAAC,KAAK,CAAC;QACV,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC;KAC9C,CAAC,CACH;SACA,KAAK,CAAC,IAAI,CAAC,EAAE;QACZ,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;QAC9C,OAAO;YACL,WAAW;gBACT,MAAM,eAAe,GAAG,IAAA,uBAAO,EAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;gBAC5D,OAAO;oBACL,GAAG,gBAAgB,EAAE;oBACrB,aAAa,EAAE;wBACb,IAAI,EAAE,kBAAkB;wBACxB,eAAe;qBAChB;iBACF,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC;AA/BD,oCA+BC"}
@@ -0,0 +1,6 @@
1
+ import Plugin from '@jbrowse/core/Plugin';
2
+ import PluginManager from '@jbrowse/core/PluginManager';
3
+ export default class GCContentPlugin extends Plugin {
4
+ name: string;
5
+ install(pluginManager: PluginManager): void;
6
+ }
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
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 Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
7
+ // locals
8
+ const GCContentAdapter_1 = __importDefault(require("./GCContentAdapter"));
9
+ const LinearGCContentDisplay_1 = __importDefault(require("./LinearGCContentDisplay"));
10
+ class GCContentPlugin extends Plugin_1.default {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.name = 'GCContentPlugin';
14
+ }
15
+ install(pluginManager) {
16
+ (0, GCContentAdapter_1.default)(pluginManager);
17
+ (0, LinearGCContentDisplay_1.default)(pluginManager);
18
+ }
19
+ }
20
+ exports.default = GCContentPlugin;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,kEAAyC;AAGzC,SAAS;AACT,0EAAkD;AAClD,sFAA8D;AAE9D,MAAqB,eAAgB,SAAQ,gBAAM;IAAnD;;QACE,SAAI,GAAG,iBAAiB,CAAA;IAM1B,CAAC;IAJC,OAAO,CAAC,aAA4B;QAClC,IAAA,0BAAiB,EAAC,aAAa,CAAC,CAAA;QAChC,IAAA,gCAAuB,EAAC,aAAa,CAAC,CAAA;IACxC,CAAC;CACF;AAPD,kCAOC"}
@@ -0,0 +1,17 @@
1
+ import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import { Feature, Region } from '@jbrowse/core/util';
3
+ export default class extends BaseFeatureDataAdapter {
4
+ private windowSize;
5
+ private windowDelta;
6
+ private gcMode;
7
+ static capabilities: string[];
8
+ configure(): Promise<BaseFeatureDataAdapter>;
9
+ getRefNames(): Promise<string[]>;
10
+ getFeatures(query: Region, opts: BaseOptions): import("rxjs").Observable<Feature>;
11
+ /**
12
+ * called to provide a hint that data tied to a certain region
13
+ * will not be needed for the forseeable future and can be purged
14
+ * from caches, etc
15
+ */
16
+ freeResources(): void;
17
+ }
@@ -0,0 +1,86 @@
1
+ import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
3
+ import { SimpleFeature } from '@jbrowse/core/util';
4
+ import { toArray } from 'rxjs/operators';
5
+ export default class default_1 extends BaseFeatureDataAdapter {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.windowSize = 1000;
9
+ this.windowDelta = 1000;
10
+ this.gcMode = 'content';
11
+ }
12
+ async configure() {
13
+ var _a;
14
+ const adapter = await ((_a = this.getSubAdapter) === null || _a === void 0 ? void 0 : _a.call(this, this.getConf('sequenceAdapter')));
15
+ if (!adapter) {
16
+ throw new Error('Error getting subadapter');
17
+ }
18
+ return adapter.dataAdapter;
19
+ }
20
+ async getRefNames() {
21
+ const adapter = await this.configure();
22
+ return adapter.getRefNames();
23
+ }
24
+ getFeatures(query, opts) {
25
+ return ObservableCreate(async (observer) => {
26
+ var _a;
27
+ const sequenceAdapter = await this.configure();
28
+ const hw = this.windowSize === 1 ? 1 : this.windowSize / 2; // Half the window size
29
+ const f = this.windowSize === 1;
30
+ let { start: queryStart, end: queryEnd } = query;
31
+ queryStart = Math.max(0, queryStart - hw);
32
+ queryEnd += hw;
33
+ if (queryEnd < 0 || queryStart > queryEnd) {
34
+ observer.complete();
35
+ return;
36
+ }
37
+ const ret = sequenceAdapter.getFeatures({
38
+ ...query,
39
+ start: queryStart,
40
+ end: queryEnd,
41
+ }, opts);
42
+ const feats = await ret.pipe(toArray()).toPromise();
43
+ const residues = ((_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq')) || '';
44
+ for (let i = hw; i < residues.length - hw; i += this.windowDelta) {
45
+ const r = f ? residues[i] : residues.slice(i - hw, i + hw);
46
+ let nc = 0;
47
+ let ng = 0;
48
+ let len = 0;
49
+ for (let j = 0; j < r.length; j++) {
50
+ if (r[j] === 'c' || r[j] === 'C') {
51
+ nc++;
52
+ }
53
+ else if (r[j] === 'g' || r[j] === 'G') {
54
+ ng++;
55
+ }
56
+ if (r[j] !== 'N') {
57
+ len++;
58
+ }
59
+ }
60
+ const pos = queryStart;
61
+ let score;
62
+ if (this.gcMode === 'content') {
63
+ score = (ng + nc) / (len || 1);
64
+ }
65
+ else if (this.gcMode === 'skew') {
66
+ score = (ng - nc) / (ng + nc || 1);
67
+ }
68
+ observer.next(new SimpleFeature({
69
+ uniqueId: `${this.id}_${pos + i}`,
70
+ start: pos + i,
71
+ end: pos + i + this.windowDelta,
72
+ score,
73
+ }));
74
+ }
75
+ observer.complete();
76
+ });
77
+ }
78
+ /**
79
+ * called to provide a hint that data tied to a certain region
80
+ * will not be needed for the forseeable future and can be purged
81
+ * from caches, etc
82
+ */
83
+ freeResources( /* { region } */) { }
84
+ }
85
+ default_1.capabilities = ['hasLocalStats'];
86
+ //# sourceMappingURL=GCContentAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GCContentAdapter.js","sourceRoot":"","sources":["../../src/GCContentAdapter/GCContentAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAmB,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,CAAC,OAAO,gBAAO,SAAQ,sBAAsB;IAAnD;;QACU,eAAU,GAAG,IAAI,CAAA;QAEjB,gBAAW,GAAG,IAAI,CAAA;QAElB,WAAM,GAAG,SAAS,CAAA;IAqF5B,CAAC;IAjFQ,KAAK,CAAC,SAAS;;QACpB,MAAM,OAAO,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,aAAa,qDAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAA,CAAA;QAC3E,IAAI,CAAC,OAAO,EAAE;YACZ,MA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AE,IAAI,CAAC,CAAC,CAAA;iBACnC;gBAED,QAAQ,CAAC,IAAI,CACX,IAAI,aAAa,CAAC;oBAChB,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE;oBACjC,KAAK,EAAE,GAAG,GAAG,CAAC;oBACd,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW;oBAC/B,KAAK;iBACN,CAAC,CACH,CAAA;aACF;YACD,QAAQ,CAAC,QAAQ,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACI,aAAa,EAAC,gBAAgB,IAAG,CAAC;;AAlF3B,sBAAY,GAAG,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ declare const GCContentAdapterF: (pluginManager: PluginManager) => import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
3
+ export default GCContentAdapterF;
@@ -0,0 +1,15 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
+ /**
3
+ * #config GCContentAdapter
4
+ */
5
+ function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
6
+ const GCContentAdapterF = (pluginManager) => {
7
+ return ConfigurationSchema('GCContentAdapter', {
8
+ /**
9
+ * #slot
10
+ */
11
+ sequenceAdapter: pluginManager.pluggableConfigSchemaType('adapter'),
12
+ }, { explicitlyTyped: true });
13
+ };
14
+ export default GCContentAdapterF;
15
+ //# sourceMappingURL=configSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/GCContentAdapter/configSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,iBAAiB,GAAG,CAAC,aAA4B,EAAE,EAAE;IACzD,OAAO,mBAAmB,CACxB,kBAAkB,EAClB;QACE;;WAEG;QACH,eAAe,EAAE,aAAa,CAAC,yBAAyB,CAAC,SAAS,CAAC;KACpE,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ declare const _default: (pluginManager: PluginManager) => void;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType';
2
+ import configSchemaF from './configSchema';
3
+ export default (pluginManager) => {
4
+ pluginManager.addAdapterType(() => new AdapterType({
5
+ name: 'GCContentAdapter',
6
+ adapterMetadata: {
7
+ category: null,
8
+ hiddenFromGUI: true,
9
+ displayName: null,
10
+ description: null,
11
+ },
12
+ configSchema: configSchemaF(pluginManager),
13
+ getAdapterClass: () => import('./GCContentAdapter').then(r => r.default),
14
+ }));
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/GCContentAdapter/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,iDAAiD,CAAA;AAEzE,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAE1C,eAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAC1B,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;QACd,IAAI,EAAE,kBAAkB;QACxB,eAAe,EAAE;YACf,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;SAClB;QACD,YAAY,EAAE,aAAa,CAAC,aAAa,CAAC;QAC1C,eAAe,EAAE,GAAG,EAAE,CACpB,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACpD,CAAC,CACL,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ export default function WiggleConfigFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
@@ -0,0 +1,10 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
+ /**
3
+ * #config LinearGCContentDisplay
4
+ */
5
+ function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
6
+ export default function WiggleConfigFactory(pluginManager) {
7
+ const baseConfiguration = pluginManager.getDisplayType('LinearWiggleDisplay').configSchema;
8
+ return ConfigurationSchema('LinearGCContentDisplay', {}, { baseConfiguration, explicitlyTyped: true });
9
+ }
10
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/LinearGCContentDisplay/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,aAA4B;IACtE,MAAM,iBAAiB,GAAG,aAAa,CAAC,cAAc,CACpD,qBAAqB,CACtB,CAAC,YAAY,CAAA;IAEd,OAAO,mBAAmB,CACxB,wBAAwB,EACxB,EAAE,EACF,EAAE,iBAAiB,EAAE,eAAe,EAAE,IAAI,EAAE,CAC7C,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ declare const _default: (pluginManager: PluginManager) => void;
3
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
2
+ import configSchemaFactory from './config';
3
+ import stateModelFactory from './stateModel';
4
+ export default (pluginManager) => {
5
+ pluginManager.addDisplayType(() => {
6
+ const configSchema = configSchemaFactory(pluginManager);
7
+ const stateModel = stateModelFactory(pluginManager, configSchema);
8
+ return {
9
+ name: 'LinearGCContentDisplay',
10
+ configSchema,
11
+ stateModel,
12
+ trackType: 'ReferenceSequenceTrack',
13
+ viewType: 'LinearGenomeView',
14
+ ReactComponent: BaseLinearDisplayComponent,
15
+ };
16
+ });
17
+ };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LinearGCContentDisplay/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAE/E,OAAO,mBAAmB,MAAM,UAAU,CAAA;AAC1C,OAAO,iBAAiB,MAAM,cAAc,CAAA;AAE5C,eAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;QAChC,MAAM,YAAY,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvD,MAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;QACjE,OAAO;YACL,IAAI,EAAE,wBAAwB;YAC9B,YAAY;YACZ,UAAU;YACV,SAAS,EAAE,wBAAwB;YACnC,QAAQ,EAAE,kBAAkB;YAC5B,cAAc,EAAE,0BAA0B;SAC3C,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}