@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.
- package/LICENSE +201 -0
- package/dist/GCContentAdapter/GCContentAdapter.d.ts +17 -0
- package/dist/GCContentAdapter/GCContentAdapter.js +89 -0
- package/dist/GCContentAdapter/GCContentAdapter.js.map +1 -0
- package/dist/GCContentAdapter/configSchema.d.ts +3 -0
- package/dist/GCContentAdapter/configSchema.js +17 -0
- package/dist/GCContentAdapter/configSchema.js.map +1 -0
- package/dist/GCContentAdapter/index.d.ts +3 -0
- package/dist/GCContentAdapter/index.js +44 -0
- package/dist/GCContentAdapter/index.js.map +1 -0
- package/dist/LinearGCContentDisplay/config.d.ts +2 -0
- package/dist/LinearGCContentDisplay/config.js +13 -0
- package/dist/LinearGCContentDisplay/config.js.map +1 -0
- package/dist/LinearGCContentDisplay/index.d.ts +3 -0
- package/dist/LinearGCContentDisplay/index.js +23 -0
- package/dist/LinearGCContentDisplay/index.js.map +1 -0
- package/dist/LinearGCContentDisplay/stateModel.d.ts +305 -0
- package/dist/LinearGCContentDisplay/stateModel.js +29 -0
- package/dist/LinearGCContentDisplay/stateModel.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/esm/GCContentAdapter/GCContentAdapter.d.ts +17 -0
- package/esm/GCContentAdapter/GCContentAdapter.js +86 -0
- package/esm/GCContentAdapter/GCContentAdapter.js.map +1 -0
- package/esm/GCContentAdapter/configSchema.d.ts +3 -0
- package/esm/GCContentAdapter/configSchema.js +15 -0
- package/esm/GCContentAdapter/configSchema.js.map +1 -0
- package/esm/GCContentAdapter/index.d.ts +3 -0
- package/esm/GCContentAdapter/index.js +16 -0
- package/esm/GCContentAdapter/index.js.map +1 -0
- package/esm/LinearGCContentDisplay/config.d.ts +2 -0
- package/esm/LinearGCContentDisplay/config.js +10 -0
- package/esm/LinearGCContentDisplay/config.js.map +1 -0
- package/esm/LinearGCContentDisplay/index.d.ts +3 -0
- package/esm/LinearGCContentDisplay/index.js +18 -0
- package/esm/LinearGCContentDisplay/index.js.map +1 -0
- package/esm/LinearGCContentDisplay/stateModel.d.ts +305 -0
- package/esm/LinearGCContentDisplay/stateModel.js +26 -0
- package/esm/LinearGCContentDisplay/stateModel.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +15 -0
- package/esm/index.js.map +1 -0
- package/package.json +59 -0
- package/src/GCContentAdapter/GCContentAdapter.ts +99 -0
- package/src/GCContentAdapter/configSchema.ts +22 -0
- package/src/GCContentAdapter/index.ts +22 -0
- package/src/LinearGCContentDisplay/config.ts +19 -0
- package/src/LinearGCContentDisplay/index.ts +20 -0
- package/src/LinearGCContentDisplay/stateModel.ts +39 -0
- 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,26 @@
|
|
|
1
|
+
import { getConf, } from '@jbrowse/core/configuration';
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
export default function stateModelFactory(pluginManager, configSchema) {
|
|
4
|
+
const WigglePlugin = pluginManager.getPlugin('WigglePlugin');
|
|
5
|
+
const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;
|
|
6
|
+
return types
|
|
7
|
+
.compose('LinearGCContentDisplay', linearWiggleDisplayModelFactory(pluginManager, configSchema), types.model({
|
|
8
|
+
type: types.literal('LinearGCContentDisplay'),
|
|
9
|
+
}))
|
|
10
|
+
.views(self => {
|
|
11
|
+
const { renderProps: superRenderProps } = self;
|
|
12
|
+
return {
|
|
13
|
+
renderProps() {
|
|
14
|
+
const sequenceAdapter = getConf(self.parentTrack, 'adapter');
|
|
15
|
+
return {
|
|
16
|
+
...superRenderProps(),
|
|
17
|
+
adapterConfig: {
|
|
18
|
+
type: 'GCContentAdapter',
|
|
19
|
+
sequenceAdapter,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=stateModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateModel.js","sourceRoot":"","sources":["../../src/LinearGCContentDisplay/stateModel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAER,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,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,KAAK;SACT,OAAO,CACN,wBAAwB,EACxB,+BAA+B,CAAC,aAAa,EAAE,YAAY,CAAC,EAC5D,KAAK,CAAC,KAAK,CAAC;QACV,IAAI,EAAE,KAAK,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,OAAO,CAAC,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"}
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
+
// locals
|
|
3
|
+
import GCContentAdapterF from './GCContentAdapter';
|
|
4
|
+
import LinearGCContentDisplayF from './LinearGCContentDisplay';
|
|
5
|
+
export default class GCContentPlugin extends Plugin {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.name = 'GCContentPlugin';
|
|
9
|
+
}
|
|
10
|
+
install(pluginManager) {
|
|
11
|
+
GCContentAdapterF(pluginManager);
|
|
12
|
+
LinearGCContentDisplayF(pluginManager);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAGzC,SAAS;AACT,OAAO,iBAAiB,MAAM,oBAAoB,CAAA;AAClD,OAAO,uBAAuB,MAAM,0BAA0B,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,MAAM;IAAnD;;QACE,SAAI,GAAG,iBAAiB,CAAA;IAM1B,CAAC;IAJC,OAAO,CAAC,aAA4B;QAClC,iBAAiB,CAAC,aAAa,CAAC,CAAA;QAChC,uBAAuB,CAAC,aAAa,CAAC,CAAA;IACxC,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jbrowse/plugin-gccontent",
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "JBrowse 2 gccontent concepts",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jbrowse",
|
|
7
|
+
"jbrowse2"
|
|
8
|
+
],
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"homepage": "https://jbrowse.org",
|
|
11
|
+
"bugs": "https://github.com/GMOD/jbrowse-components/issues",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/GMOD/jbrowse-components.git",
|
|
15
|
+
"directory": "plugins/gccontent"
|
|
16
|
+
},
|
|
17
|
+
"author": "JBrowse Team",
|
|
18
|
+
"distMain": "dist/index.js",
|
|
19
|
+
"srcMain": "src/index.ts",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src",
|
|
24
|
+
"esm"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npm-run-all build:*",
|
|
28
|
+
"test": "echo hi",
|
|
29
|
+
"prepublishOnly": "yarn test",
|
|
30
|
+
"prepack": "yarn build; yarn useDist",
|
|
31
|
+
"postpack": "yarn useSrc",
|
|
32
|
+
"useDist": "node ../../scripts/useDist.js",
|
|
33
|
+
"useSrc": "node ../../scripts/useSrc.js",
|
|
34
|
+
"prebuild": "npm run clean",
|
|
35
|
+
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
36
|
+
"build:es5": "tsc --build tsconfig.build.es5.json",
|
|
37
|
+
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@jbrowse/core": "^2.0.0",
|
|
41
|
+
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
42
|
+
"@jbrowse/plugin-sequence": "^2.0.0",
|
|
43
|
+
"@jbrowse/plugin-wiggle": "^2.0.0",
|
|
44
|
+
"@mui/material": "^5.0.0",
|
|
45
|
+
"mobx": "^6.0.0",
|
|
46
|
+
"mobx-react": "^7.0.0",
|
|
47
|
+
"mobx-state-tree": "^5.0.0",
|
|
48
|
+
"prop-types": "^15.0.0",
|
|
49
|
+
"react": ">=16.8.0",
|
|
50
|
+
"rxjs": "^6.0.0"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"distModule": "esm/index.js",
|
|
56
|
+
"srcModule": "src/index.ts",
|
|
57
|
+
"module": "esm/index.js",
|
|
58
|
+
"gitHead": "896d175c5d9345049faea8e1155f243c912aac42"
|
|
59
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseFeatureDataAdapter,
|
|
3
|
+
BaseOptions,
|
|
4
|
+
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
+
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
6
|
+
import { SimpleFeature, Feature, Region } from '@jbrowse/core/util'
|
|
7
|
+
import { toArray } from 'rxjs/operators'
|
|
8
|
+
|
|
9
|
+
export default class extends BaseFeatureDataAdapter {
|
|
10
|
+
private windowSize = 1000
|
|
11
|
+
|
|
12
|
+
private windowDelta = 1000
|
|
13
|
+
|
|
14
|
+
private gcMode = 'content'
|
|
15
|
+
|
|
16
|
+
public static capabilities = ['hasLocalStats']
|
|
17
|
+
|
|
18
|
+
public async configure() {
|
|
19
|
+
const adapter = await this.getSubAdapter?.(this.getConf('sequenceAdapter'))
|
|
20
|
+
if (!adapter) {
|
|
21
|
+
throw new Error('Error getting subadapter')
|
|
22
|
+
}
|
|
23
|
+
return adapter.dataAdapter as BaseFeatureDataAdapter
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public async getRefNames() {
|
|
27
|
+
const adapter = await this.configure()
|
|
28
|
+
return adapter.getRefNames()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public getFeatures(query: Region, opts: BaseOptions) {
|
|
32
|
+
return ObservableCreate<Feature>(async observer => {
|
|
33
|
+
const sequenceAdapter = await this.configure()
|
|
34
|
+
const hw = this.windowSize === 1 ? 1 : this.windowSize / 2 // Half the window size
|
|
35
|
+
const f = this.windowSize === 1
|
|
36
|
+
|
|
37
|
+
let { start: queryStart, end: queryEnd } = query
|
|
38
|
+
queryStart = Math.max(0, queryStart - hw)
|
|
39
|
+
queryEnd += hw
|
|
40
|
+
|
|
41
|
+
if (queryEnd < 0 || queryStart > queryEnd) {
|
|
42
|
+
observer.complete()
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const ret = sequenceAdapter.getFeatures(
|
|
47
|
+
{
|
|
48
|
+
...query,
|
|
49
|
+
start: queryStart,
|
|
50
|
+
end: queryEnd,
|
|
51
|
+
},
|
|
52
|
+
opts,
|
|
53
|
+
)
|
|
54
|
+
const feats = await ret.pipe(toArray()).toPromise()
|
|
55
|
+
const residues = feats[0]?.get('seq') || ''
|
|
56
|
+
|
|
57
|
+
for (let i = hw; i < residues.length - hw; i += this.windowDelta) {
|
|
58
|
+
const r = f ? residues[i] : residues.slice(i - hw, i + hw)
|
|
59
|
+
let nc = 0
|
|
60
|
+
let ng = 0
|
|
61
|
+
let len = 0
|
|
62
|
+
for (let j = 0; j < r.length; j++) {
|
|
63
|
+
if (r[j] === 'c' || r[j] === 'C') {
|
|
64
|
+
nc++
|
|
65
|
+
} else if (r[j] === 'g' || r[j] === 'G') {
|
|
66
|
+
ng++
|
|
67
|
+
}
|
|
68
|
+
if (r[j] !== 'N') {
|
|
69
|
+
len++
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const pos = queryStart
|
|
73
|
+
let score
|
|
74
|
+
if (this.gcMode === 'content') {
|
|
75
|
+
score = (ng + nc) / (len || 1)
|
|
76
|
+
} else if (this.gcMode === 'skew') {
|
|
77
|
+
score = (ng - nc) / (ng + nc || 1)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
observer.next(
|
|
81
|
+
new SimpleFeature({
|
|
82
|
+
uniqueId: `${this.id}_${pos + i}`,
|
|
83
|
+
start: pos + i,
|
|
84
|
+
end: pos + i + this.windowDelta,
|
|
85
|
+
score,
|
|
86
|
+
}),
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
observer.complete()
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* called to provide a hint that data tied to a certain region
|
|
95
|
+
* will not be needed for the forseeable future and can be purged
|
|
96
|
+
* from caches, etc
|
|
97
|
+
*/
|
|
98
|
+
public freeResources(/* { region } */) {}
|
|
99
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* #config GCContentAdapter
|
|
6
|
+
*/
|
|
7
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8
|
+
|
|
9
|
+
const GCContentAdapterF = (pluginManager: PluginManager) => {
|
|
10
|
+
return ConfigurationSchema(
|
|
11
|
+
'GCContentAdapter',
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* #slot
|
|
15
|
+
*/
|
|
16
|
+
sequenceAdapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
17
|
+
},
|
|
18
|
+
{ explicitlyTyped: true },
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default GCContentAdapterF
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
|
|
3
|
+
|
|
4
|
+
import configSchemaF from './configSchema'
|
|
5
|
+
|
|
6
|
+
export default (pluginManager: PluginManager) => {
|
|
7
|
+
pluginManager.addAdapterType(
|
|
8
|
+
() =>
|
|
9
|
+
new AdapterType({
|
|
10
|
+
name: 'GCContentAdapter',
|
|
11
|
+
adapterMetadata: {
|
|
12
|
+
category: null,
|
|
13
|
+
hiddenFromGUI: true,
|
|
14
|
+
displayName: null,
|
|
15
|
+
description: null,
|
|
16
|
+
},
|
|
17
|
+
configSchema: configSchemaF(pluginManager),
|
|
18
|
+
getAdapterClass: () =>
|
|
19
|
+
import('./GCContentAdapter').then(r => r.default),
|
|
20
|
+
}),
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* #config LinearGCContentDisplay
|
|
6
|
+
*/
|
|
7
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8
|
+
|
|
9
|
+
export default function WiggleConfigFactory(pluginManager: PluginManager) {
|
|
10
|
+
const baseConfiguration = pluginManager.getDisplayType(
|
|
11
|
+
'LinearWiggleDisplay',
|
|
12
|
+
).configSchema
|
|
13
|
+
|
|
14
|
+
return ConfigurationSchema(
|
|
15
|
+
'LinearGCContentDisplay',
|
|
16
|
+
{},
|
|
17
|
+
{ baseConfiguration, explicitlyTyped: true },
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view'
|
|
3
|
+
|
|
4
|
+
import configSchemaFactory from './config'
|
|
5
|
+
import stateModelFactory from './stateModel'
|
|
6
|
+
|
|
7
|
+
export default (pluginManager: PluginManager) => {
|
|
8
|
+
pluginManager.addDisplayType(() => {
|
|
9
|
+
const configSchema = configSchemaFactory(pluginManager)
|
|
10
|
+
const stateModel = stateModelFactory(pluginManager, configSchema)
|
|
11
|
+
return {
|
|
12
|
+
name: 'LinearGCContentDisplay',
|
|
13
|
+
configSchema,
|
|
14
|
+
stateModel,
|
|
15
|
+
trackType: 'ReferenceSequenceTrack',
|
|
16
|
+
viewType: 'LinearGenomeView',
|
|
17
|
+
ReactComponent: BaseLinearDisplayComponent,
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getConf,
|
|
3
|
+
AnyConfigurationSchemaType,
|
|
4
|
+
} from '@jbrowse/core/configuration'
|
|
5
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
6
|
+
import { types } from 'mobx-state-tree'
|
|
7
|
+
|
|
8
|
+
export default function stateModelFactory(
|
|
9
|
+
pluginManager: PluginManager,
|
|
10
|
+
configSchema: AnyConfigurationSchemaType,
|
|
11
|
+
) {
|
|
12
|
+
const WigglePlugin = pluginManager.getPlugin(
|
|
13
|
+
'WigglePlugin',
|
|
14
|
+
) as import('@jbrowse/plugin-wiggle').default
|
|
15
|
+
const { linearWiggleDisplayModelFactory } = WigglePlugin.exports
|
|
16
|
+
return types
|
|
17
|
+
.compose(
|
|
18
|
+
'LinearGCContentDisplay',
|
|
19
|
+
linearWiggleDisplayModelFactory(pluginManager, configSchema),
|
|
20
|
+
types.model({
|
|
21
|
+
type: types.literal('LinearGCContentDisplay'),
|
|
22
|
+
}),
|
|
23
|
+
)
|
|
24
|
+
.views(self => {
|
|
25
|
+
const { renderProps: superRenderProps } = self
|
|
26
|
+
return {
|
|
27
|
+
renderProps() {
|
|
28
|
+
const sequenceAdapter = getConf(self.parentTrack, 'adapter')
|
|
29
|
+
return {
|
|
30
|
+
...superRenderProps(),
|
|
31
|
+
adapterConfig: {
|
|
32
|
+
type: 'GCContentAdapter',
|
|
33
|
+
sequenceAdapter,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Plugin from '@jbrowse/core/Plugin'
|
|
2
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
+
|
|
4
|
+
// locals
|
|
5
|
+
import GCContentAdapterF from './GCContentAdapter'
|
|
6
|
+
import LinearGCContentDisplayF from './LinearGCContentDisplay'
|
|
7
|
+
|
|
8
|
+
export default class GCContentPlugin extends Plugin {
|
|
9
|
+
name = 'GCContentPlugin'
|
|
10
|
+
|
|
11
|
+
install(pluginManager: PluginManager) {
|
|
12
|
+
GCContentAdapterF(pluginManager)
|
|
13
|
+
LinearGCContentDisplayF(pluginManager)
|
|
14
|
+
}
|
|
15
|
+
}
|