jbrowse-plugin-gwas 1.0.3 → 1.0.5
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/CHANGELOG.md +8 -0
- package/README.md +69 -55
- package/dist/LinearManhattanDisplay/configSchemaFactory.d.ts +2 -0
- package/dist/LinearManhattanDisplay/index.d.ts +2 -1
- package/dist/LinearManhattanRenderer/index.d.ts +1 -1
- package/dist/jbrowse-plugin-gwas.cjs.development.js +31 -26
- package/dist/jbrowse-plugin-gwas.cjs.development.js.map +1 -1
- package/dist/jbrowse-plugin-gwas.cjs.production.min.js +1 -1
- package/dist/jbrowse-plugin-gwas.cjs.production.min.js.map +1 -1
- package/dist/jbrowse-plugin-gwas.esm.js +27 -22
- package/dist/jbrowse-plugin-gwas.esm.js.map +1 -1
- package/dist/jbrowse-plugin-gwas.umd.development.js +33 -30
- package/dist/jbrowse-plugin-gwas.umd.development.js.map +1 -1
- package/dist/jbrowse-plugin-gwas.umd.production.min.js +1 -1
- package/dist/jbrowse-plugin-gwas.umd.production.min.js.map +1 -1
- package/package.json +1 -1
- package/src/LinearManhattanDisplay/configSchemaFactory.ts +70 -0
- package/src/LinearManhattanDisplay/index.ts +4 -66
- package/src/LinearManhattanRenderer/LinearManhattanRenderer.ts +1 -2
- package/src/LinearManhattanRenderer/index.ts +14 -0
- package/src/index.ts +8 -15
- package/src/LinearManhattanRenderer/index.js +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# v1.0.5
|
|
2
|
+
|
|
3
|
+
- Fix ability to configure the renderer on the display, see sample config.json for custom coloring
|
|
4
|
+
|
|
5
|
+
# v1.0.4
|
|
6
|
+
|
|
7
|
+
- Make the code always try to render (never produce the force load)
|
|
8
|
+
|
|
1
9
|
# v1.0.3
|
|
2
10
|
|
|
3
11
|
- Fix for v1.1.0 of jbrowse-web requires passing pluginManager to renderer constructor
|
package/README.md
CHANGED
|
@@ -1,89 +1,103 @@
|
|
|
1
|
-
#
|
|
1
|
+
# jbrowse-plugin-gwas
|
|
2
2
|
|
|
3
3
|
Plugin for displaying GWAS results such as manhattan plot renderings
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Screenshot
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+

|
|
8
|
+

|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Data format
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
jbrowse-plugin-gwas will render any features with a "score". A common format is a BED-like file, perhaps with tabix added. Example with plain BED, where the score is in column 5
|
|
12
13
|
|
|
13
14
|
```
|
|
14
|
-
|
|
15
|
+
chr22 1000 5000 rs123 84.141
|
|
16
|
+
chr22 2000 6000 rs456 40.12312
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Sometimes, the file format is not a strict BED but something with just one coordinate instead of a start and end. Example with BED-like data (only one coordinate column)
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
```
|
|
22
|
+
#chrom pos rsid ref alt neg_log_pvalue beta stderr_beta alt_allele_freq
|
|
23
|
+
1 721290 rs12565286 G C 0.275233 . . .
|
|
24
|
+
1 752566 rs3094315 G A 0.0315638 . . .
|
|
25
|
+
1 775659 rs2905035 A G 0.183626 . . .
|
|
26
|
+
1 777122 rs2980319 A T 0.207258 . . .
|
|
27
|
+
1 779322 rs4040617 A G 0.0326393 . . .
|
|
28
|
+
1 780785 rs2977612 T A 0.0225965 . . .
|
|
29
|
+
```
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
This file format can be indexed using tabix with something BED-like
|
|
22
32
|
|
|
23
33
|
```
|
|
24
|
-
|
|
25
|
-
cd jbrowse-plugin-gwas
|
|
26
|
-
yarn
|
|
27
|
-
yarn start
|
|
34
|
+
tabix -0 -b 2 -s 1 -e 2 -f out.bed.gz
|
|
28
35
|
```
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
The beginning (-b) and end (-e) coordinates of the features are set to the same
|
|
38
|
+
column (2), and the sequence column (-s) is 1. Also assumes zero-based
|
|
39
|
+
coordinates (-0)
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
Note that this is just one format that can be used for the plugin, any adapter
|
|
42
|
+
can be used that provides features with a score attribute, and it assumes the
|
|
43
|
+
score is already -log10(p) transformed (this means if your file has raw
|
|
44
|
+
p-values, you may need to modify them or add a -log10(p) to the file)
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
## Example config
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
The below config uses the "scoreColumn" attribute to set neg_log_pvalue (as
|
|
49
|
+
seen in above section) to be the score that is plotted
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"type": "FeatureTrack",
|
|
54
|
+
"trackId": "gwas_track",
|
|
55
|
+
"name": "GWAS",
|
|
56
|
+
"category": ["Annotation"],
|
|
57
|
+
"assemblyNames": ["hg19"],
|
|
58
|
+
"adapter": {
|
|
59
|
+
"type": "BedTabixAdapter",
|
|
60
|
+
"scoreColumn": "neg_log_pvalue",
|
|
61
|
+
"bedGzLocation": {
|
|
62
|
+
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/gwas/summary_stats.txt.gz"
|
|
63
|
+
},
|
|
64
|
+
"index": {
|
|
65
|
+
"location": {
|
|
66
|
+
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/gwas/summary_stats.txt.gz.tbi"
|
|
67
|
+
},
|
|
68
|
+
"indexType": "TBI"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"displays": [
|
|
72
|
+
{
|
|
73
|
+
"displayId": "gwas_display",
|
|
74
|
+
"type": "LinearManhattanDisplay"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Usage in jbrowse-web
|
|
39
81
|
|
|
40
|
-
Add to the "plugins" of your JBrowse Web config
|
|
82
|
+
Add to the "plugins" of your JBrowse Web config. The unpkg CDN should be stable, or you can download the js file to your server
|
|
41
83
|
|
|
42
84
|
```json
|
|
43
85
|
{
|
|
44
86
|
"plugins": [
|
|
45
87
|
{
|
|
46
|
-
"name": "
|
|
88
|
+
"name": "GWAS",
|
|
47
89
|
"url": "https://unpkg.com/jbrowse-plugin-gwas/dist/jbrowse-plugin-gwas.umd.production.min.js"
|
|
48
90
|
}
|
|
49
91
|
]
|
|
50
92
|
}
|
|
51
93
|
```
|
|
52
94
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```tsx
|
|
56
|
-
import React from "react";
|
|
57
|
-
import "fontsource-roboto";
|
|
58
|
-
import {
|
|
59
|
-
createViewState,
|
|
60
|
-
createJBrowseTheme,
|
|
61
|
-
JBrowseLinearGenomeView,
|
|
62
|
-
ThemeProvider,
|
|
63
|
-
} from "@jbrowse/react-linear-view";
|
|
64
|
-
import GWAS from "jbrowse-plugin-gwas";
|
|
65
|
-
|
|
66
|
-
const theme = createJBrowseTheme();
|
|
67
|
-
|
|
68
|
-
function View() {
|
|
69
|
-
const state = createViewState({
|
|
70
|
-
assembly: {
|
|
71
|
-
/* assembly */
|
|
72
|
-
},
|
|
73
|
-
tracks: [
|
|
74
|
-
/* tracks */
|
|
75
|
-
],
|
|
76
|
-
plugins: [GWAS],
|
|
77
|
-
});
|
|
78
|
-
return (
|
|
79
|
-
<ThemeProvider theme={theme}>
|
|
80
|
-
<JBrowseLinearGenomeView viewState={state} />
|
|
81
|
-
</ThemeProvider>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
```
|
|
95
|
+
This plugin is currently quite basic, and there is no mouseover interactivity or drawn labels on features
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
#### Demo
|
|
87
98
|
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
https://jbrowse.org/code/jb2/main/index.html?config=https%3A%2F%2Funpkg.com%2Fjbrowse-plugin-gwas%2Fdist%2Fconfig.json&session=share-iehjT6AoHd&password=lZS7v
|
|
100
|
+
|
|
101
|
+
### For use in jbrowse/react-linear-genome-view
|
|
102
|
+
|
|
103
|
+
See [DEVELOPMENT](DEVELOPMENT.md)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import PluginManager from "@jbrowse/core/PluginManager";
|
|
2
|
-
export
|
|
2
|
+
export { configSchemaFactory } from "./configSchemaFactory";
|
|
3
3
|
export declare function stateModelFactory(pluginManager: PluginManager, configSchema: any): import("mobx-state-tree").IModelType<import("mobx-state-tree").ModelProperties & {
|
|
4
4
|
type: import("mobx-state-tree").ISimpleType<"LinearManhattanDisplay">;
|
|
5
5
|
}, {
|
|
6
6
|
readonly rendererTypeName: string;
|
|
7
7
|
readonly needsScalebar: boolean;
|
|
8
|
+
readonly regionTooLarge: boolean;
|
|
8
9
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
9
10
|
export declare type LinearManhattanDisplayModel = ReturnType<typeof stateModelFactory>;
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
7
|
var Plugin = _interopDefault(require('@jbrowse/core/Plugin'));
|
|
8
|
+
var DisplayType = _interopDefault(require('@jbrowse/core/pluggableElementTypes/DisplayType'));
|
|
8
9
|
var configuration = require('@jbrowse/core/configuration');
|
|
10
|
+
var util = require('@jbrowse/core/util');
|
|
11
|
+
var mobxStateTree = require('mobx-state-tree');
|
|
9
12
|
|
|
10
13
|
function _classCallCheck(instance, Constructor) {
|
|
11
14
|
if (!(instance instanceof Constructor)) {
|
|
@@ -275,7 +278,6 @@ function rendererFactory(pluginManager) {
|
|
|
275
278
|
var _WigglePlugin$exports = WigglePlugin.exports,
|
|
276
279
|
getScale = _WigglePlugin$exports.utils.getScale,
|
|
277
280
|
WiggleBaseRenderer = _WigglePlugin$exports.WiggleBaseRenderer;
|
|
278
|
-
var featureSpanPx = pluginManager.lib["@jbrowse/core/util"].featureSpanPx;
|
|
279
281
|
return /*#__PURE__*/function (_WiggleBaseRenderer) {
|
|
280
282
|
_inherits(ManhattanPlotRenderer, _WiggleBaseRenderer);
|
|
281
283
|
|
|
@@ -323,7 +325,7 @@ function rendererFactory(pluginManager) {
|
|
|
323
325
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
324
326
|
var feature = _step.value;
|
|
325
327
|
|
|
326
|
-
var _featureSpanPx = featureSpanPx(feature, region, bpPerPx),
|
|
328
|
+
var _featureSpanPx = util.featureSpanPx(feature, region, bpPerPx),
|
|
327
329
|
_featureSpanPx2 = _slicedToArray(_featureSpanPx, 1),
|
|
328
330
|
leftPx = _featureSpanPx2[0];
|
|
329
331
|
|
|
@@ -356,30 +358,26 @@ function rendererFactory(pluginManager) {
|
|
|
356
358
|
}(WiggleBaseRenderer);
|
|
357
359
|
}
|
|
358
360
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
explicitlyTyped: true
|
|
369
|
-
});
|
|
370
|
-
}
|
|
361
|
+
var configSchema = /*#__PURE__*/configuration.ConfigurationSchema("LinearManhattanRenderer", {
|
|
362
|
+
color: {
|
|
363
|
+
type: "color",
|
|
364
|
+
description: "the color of the marks",
|
|
365
|
+
defaultValue: "darkblue"
|
|
366
|
+
}
|
|
367
|
+
}, {
|
|
368
|
+
explicitlyTyped: true
|
|
369
|
+
});
|
|
371
370
|
|
|
372
|
-
function configSchemaFactory
|
|
373
|
-
var types = pluginManager.lib["mobx-state-tree"].types;
|
|
374
|
-
var ConfigurationSchema = pluginManager.lib["@jbrowse/core/configuration"].ConfigurationSchema;
|
|
371
|
+
function configSchemaFactory(pluginManager) {
|
|
375
372
|
var LGVPlugin = pluginManager.getPlugin("LinearGenomeViewPlugin"); //@ts-ignore
|
|
376
373
|
|
|
377
374
|
var baseLinearDisplayConfigSchema = LGVPlugin.exports.baseLinearDisplayConfigSchema;
|
|
378
|
-
|
|
375
|
+
var LinearManhattanRendererConfigSchema = pluginManager.getRendererType("LinearManhattanRenderer").configSchema;
|
|
376
|
+
return configuration.ConfigurationSchema("LinearManhattanDisplay", {
|
|
379
377
|
autoscale: {
|
|
380
378
|
type: "stringEnum",
|
|
381
379
|
defaultValue: "local",
|
|
382
|
-
model: types.enumeration("Autoscale type", ["global", "local", "globalsd", "localsd", "zscore"]),
|
|
380
|
+
model: mobxStateTree.types.enumeration("Autoscale type", ["global", "local", "globalsd", "localsd", "zscore"]),
|
|
383
381
|
description: "global/local using their min/max values or w/ standard deviations (globalsd/localsd)"
|
|
384
382
|
},
|
|
385
383
|
minScore: {
|
|
@@ -399,7 +397,7 @@ function configSchemaFactory$1(pluginManager) {
|
|
|
399
397
|
},
|
|
400
398
|
scaleType: {
|
|
401
399
|
type: "stringEnum",
|
|
402
|
-
model: types.enumeration("Scale type", ["linear", "log"]),
|
|
400
|
+
model: mobxStateTree.types.enumeration("Scale type", ["linear", "log"]),
|
|
403
401
|
description: "The type of scale to use",
|
|
404
402
|
defaultValue: "linear"
|
|
405
403
|
},
|
|
@@ -410,14 +408,18 @@ function configSchemaFactory$1(pluginManager) {
|
|
|
410
408
|
},
|
|
411
409
|
defaultRendering: {
|
|
412
410
|
type: "stringEnum",
|
|
413
|
-
model: types.enumeration("Rendering", ["density", "xyplot", "line"]),
|
|
411
|
+
model: mobxStateTree.types.enumeration("Rendering", ["density", "xyplot", "line"]),
|
|
414
412
|
defaultValue: "xyplot"
|
|
415
|
-
}
|
|
413
|
+
},
|
|
414
|
+
renderers: configuration.ConfigurationSchema("RenderersConfiguration", {
|
|
415
|
+
LinearManhattanRenderer: LinearManhattanRendererConfigSchema
|
|
416
|
+
})
|
|
416
417
|
}, {
|
|
417
418
|
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
418
419
|
explicitlyTyped: true
|
|
419
420
|
});
|
|
420
421
|
}
|
|
422
|
+
|
|
421
423
|
function stateModelFactory(pluginManager, configSchema) {
|
|
422
424
|
var types = pluginManager.lib["mobx-state-tree"].types;
|
|
423
425
|
var WigglePlugin = pluginManager.getPlugin("WigglePlugin"); //@ts-ignore
|
|
@@ -433,6 +435,10 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
433
435
|
|
|
434
436
|
get needsScalebar() {
|
|
435
437
|
return true;
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
get regionTooLarge() {
|
|
441
|
+
return false;
|
|
436
442
|
}
|
|
437
443
|
|
|
438
444
|
};
|
|
@@ -458,12 +464,11 @@ var AlignmentsPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
458
464
|
key: "install",
|
|
459
465
|
value: function install(pluginManager) {
|
|
460
466
|
var WigglePlugin = pluginManager.getPlugin("WigglePlugin");
|
|
461
|
-
var DisplayType = pluginManager.lib["@jbrowse/core/pluggableElementTypes/DisplayType"];
|
|
462
467
|
var _WigglePlugin$exports = WigglePlugin.exports,
|
|
463
468
|
LinearWiggleDisplayReactComponent = _WigglePlugin$exports.LinearWiggleDisplayReactComponent,
|
|
464
469
|
XYPlotRendererReactComponent = _WigglePlugin$exports.XYPlotRendererReactComponent;
|
|
465
470
|
pluginManager.addDisplayType(function () {
|
|
466
|
-
var configSchema = configSchemaFactory
|
|
471
|
+
var configSchema = configSchemaFactory(pluginManager);
|
|
467
472
|
return new DisplayType({
|
|
468
473
|
name: "LinearManhattanDisplay",
|
|
469
474
|
configSchema: configSchema,
|
|
@@ -476,11 +481,11 @@ var AlignmentsPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
476
481
|
pluginManager.addRendererType(function () {
|
|
477
482
|
//@ts-ignore
|
|
478
483
|
var ManhattanRenderer = new rendererFactory(pluginManager);
|
|
479
|
-
var configSchema =
|
|
484
|
+
var configSchema$1 = configSchema;
|
|
480
485
|
return new ManhattanRenderer({
|
|
481
486
|
name: "LinearManhattanRenderer",
|
|
482
487
|
ReactComponent: XYPlotRendererReactComponent,
|
|
483
|
-
configSchema: configSchema,
|
|
488
|
+
configSchema: configSchema$1,
|
|
484
489
|
pluginManager: pluginManager
|
|
485
490
|
});
|
|
486
491
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jbrowse-plugin-gwas.cjs.development.js","sources":["../src/LinearManhattanRenderer/LinearManhattanRenderer.ts","../src/LinearManhattanRenderer/index.js","../src/LinearManhattanDisplay/index.ts","../src/index.ts"],"sourcesContent":["import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { readConfObject } from \"@jbrowse/core/configuration\";\n\nexport default function rendererFactory(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const {\n utils: { getScale },\n WiggleBaseRenderer,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n const { featureSpanPx } = pluginManager.lib[\"@jbrowse/core/util\"];\n\n return class ManhattanPlotRenderer extends WiggleBaseRenderer {\n draw(ctx: CanvasRenderingContext2D, props: any) {\n const {\n features,\n regions,\n bpPerPx,\n config,\n scaleOpts,\n height: unadjustedHeight,\n displayCrossHatches,\n ticks: { values },\n } = props;\n const [region] = regions;\n const YSCALEBAR_LABEL_OFFSET = 5;\n const height = unadjustedHeight - YSCALEBAR_LABEL_OFFSET * 2;\n const opts = { ...scaleOpts, range: [0, height] };\n const width = (region.end - region.start) / bpPerPx;\n\n const scale = getScale(opts);\n const toY = (n: number) => height - scale(n) + YSCALEBAR_LABEL_OFFSET;\n\n for (const feature of features.values()) {\n const [leftPx] = featureSpanPx(feature, region, bpPerPx);\n const score = feature.get(\"score\") as number;\n ctx.fillStyle = readConfObject(config, \"color\", [feature]);\n ctx.beginPath();\n ctx.arc(leftPx, toY(score), 2, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n if (displayCrossHatches) {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(200,200,200,0.8)\";\n values.forEach((tick: number) => {\n ctx.beginPath();\n ctx.moveTo(0, Math.round(toY(tick)));\n ctx.lineTo(width, Math.round(toY(tick)));\n ctx.stroke();\n });\n }\n }\n };\n}\n","export { default } from \"./LinearManhattanRenderer\";\n\nexport function configSchemaFactory(pluginManager) {\n const { ConfigurationSchema } = pluginManager.lib[\n \"@jbrowse/core/configuration\"\n ];\n\n return ConfigurationSchema(\n \"LinearManhattanRenderer\",\n {\n color: {\n type: \"color\",\n description: \"the color of the marks\",\n defaultValue: \"darkblue\",\n },\n },\n { explicitlyTyped: true },\n );\n}\n","import PluginManager from \"@jbrowse/core/PluginManager\";\n\nexport function configSchemaFactory(pluginManager: PluginManager) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const { ConfigurationSchema } = pluginManager.lib[\n \"@jbrowse/core/configuration\"\n ];\n\n const LGVPlugin = pluginManager.getPlugin(\n \"LinearGenomeViewPlugin\",\n ) as import(\"@jbrowse/plugin-linear-genome-view\").default;\n //@ts-ignore\n const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;\n\n return ConfigurationSchema(\n \"LinearManhattanDisplay\",\n {\n autoscale: {\n type: \"stringEnum\",\n defaultValue: \"local\",\n model: types.enumeration(\"Autoscale type\", [\n \"global\",\n \"local\",\n \"globalsd\",\n \"localsd\",\n \"zscore\",\n ]),\n description:\n \"global/local using their min/max values or w/ standard deviations (globalsd/localsd)\",\n },\n minScore: {\n type: \"number\",\n defaultValue: Number.MIN_VALUE,\n description: \"minimum value for the y-scale\",\n },\n maxScore: {\n type: \"number\",\n description: \"maximum value for the y-scale\",\n defaultValue: Number.MAX_VALUE,\n },\n numStdDev: {\n type: \"number\",\n description:\n \"number of standard deviations to use for autoscale types globalsd or localsd\",\n defaultValue: 3,\n },\n scaleType: {\n type: \"stringEnum\",\n model: types.enumeration(\"Scale type\", [\"linear\", \"log\"]), // todo zscale\n description: \"The type of scale to use\",\n defaultValue: \"linear\",\n },\n inverted: {\n type: \"boolean\",\n description: \"draw upside down\",\n defaultValue: false,\n },\n\n defaultRendering: {\n type: \"stringEnum\",\n model: types.enumeration(\"Rendering\", [\"density\", \"xyplot\", \"line\"]),\n defaultValue: \"xyplot\",\n },\n },\n { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true },\n );\n}\n\nexport function stateModelFactory(\n pluginManager: PluginManager,\n configSchema: any,\n) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n //@ts-ignore\n const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;\n return types.compose(\n \"LinearManhattanDisplay\",\n linearWiggleDisplayModelFactory(pluginManager, configSchema),\n types\n .model({\n type: types.literal(\"LinearManhattanDisplay\"),\n })\n .views(() => ({\n get rendererTypeName() {\n return \"LinearManhattanRenderer\";\n },\n get needsScalebar() {\n return true;\n },\n })),\n );\n}\n\nexport type LinearManhattanDisplayModel = ReturnType<typeof stateModelFactory>;\n","import Plugin from \"@jbrowse/core/Plugin\";\nimport PluginManager from \"@jbrowse/core/PluginManager\";\nimport rendererFactory, {\n configSchemaFactory as linearManhattanRendererConfigSchemaFactory,\n} from \"./LinearManhattanRenderer\";\nimport {\n configSchemaFactory as linearManhattanDisplayConfigSchemaFactory,\n stateModelFactory as linearManhattanDisplayModelFactory,\n} from \"./LinearManhattanDisplay\";\n\nexport default class AlignmentsPlugin extends Plugin {\n name = \"GWASPlugin\";\n\n install(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const DisplayType =\n pluginManager.lib[\"@jbrowse/core/pluggableElementTypes/DisplayType\"];\n const {\n LinearWiggleDisplayReactComponent,\n XYPlotRendererReactComponent,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n pluginManager.addDisplayType(() => {\n const configSchema = linearManhattanDisplayConfigSchemaFactory(\n pluginManager,\n );\n return new DisplayType({\n name: \"LinearManhattanDisplay\",\n configSchema,\n stateModel: linearManhattanDisplayModelFactory(\n pluginManager,\n configSchema,\n ),\n trackType: \"FeatureTrack\",\n viewType: \"LinearGenomeView\",\n ReactComponent: LinearWiggleDisplayReactComponent,\n });\n });\n\n pluginManager.addRendererType(() => {\n //@ts-ignore\n const ManhattanRenderer = new rendererFactory(pluginManager);\n const configSchema = linearManhattanRendererConfigSchemaFactory(\n pluginManager,\n );\n return new ManhattanRenderer({\n name: \"LinearManhattanRenderer\",\n ReactComponent: XYPlotRendererReactComponent,\n configSchema,\n pluginManager,\n });\n });\n }\n}\n"],"names":["rendererFactory","pluginManager","WigglePlugin","getPlugin","exports","getScale","utils","WiggleBaseRenderer","featureSpanPx","lib","ctx","props","features","regions","bpPerPx","config","scaleOpts","unadjustedHeight","height","displayCrossHatches","values","ticks","region","YSCALEBAR_LABEL_OFFSET","opts","range","width","end","start","scale","toY","n","feature","leftPx","score","get","fillStyle","readConfObject","beginPath","arc","Math","PI","fill","lineWidth","strokeStyle","forEach","tick","moveTo","round","lineTo","stroke","configSchemaFactory","ConfigurationSchema","color","type","description","defaultValue","explicitlyTyped","types","LGVPlugin","baseLinearDisplayConfigSchema","autoscale","model","enumeration","minScore","Number","MIN_VALUE","maxScore","MAX_VALUE","numStdDev","scaleType","inverted","defaultRendering","baseConfiguration","stateModelFactory","configSchema","linearWiggleDisplayModelFactory","compose","literal","views","rendererTypeName","needsScalebar","AlignmentsPlugin","DisplayType","LinearWiggleDisplayReactComponent","XYPlotRendererReactComponent","addDisplayType","linearManhattanDisplayConfigSchemaFactory","name","stateModel","linearManhattanDisplayModelFactory","trackType","viewType","ReactComponent","addRendererType","ManhattanRenderer","linearManhattanRendererConfigSchemaFactory","Plugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A6CD;;;;4BA3CSjF;AACN,UAAMC,YAAY,GAAGD,aAAa,CAACE,SAAd,CACnB,cADmB,CAArB;AAGA,UAAMgF,WAAW,GACflF,aAAa,CAACQ,GAAd,CAAkB,iDAAlB,CADF;kCAMIP,YAAY,CAACE;UAHfgF,0DAAAA;UACAC,qDAAAA;AAIFpF,MAAAA,aAAa,CAACqF,cAAd,CAA6B;AAC3B,YAAMX,YAAY,GAAGY,qBAAyC,CAC5DtF,aAD4D,CAA9D;AAGA,eAAO,IAAIkF,WAAJ,CAAgB;AACrBK,UAAAA,IAAI,EAAE,wBADe;AAErBb,UAAAA,YAAY,EAAZA,YAFqB;AAGrBc,UAAAA,UAAU,EAAEC,iBAAkC,CAC5CzF,aAD4C,EAE5C0E,YAF4C,CAHzB;AAOrBgB,UAAAA,SAAS,EAAE,cAPU;AAQrBC,UAAAA,QAAQ,EAAE,kBARW;AASrBC,UAAAA,cAAc,EAAET;AATK,SAAhB,CAAP;AAWD,OAfD;AAiBAnF,MAAAA,aAAa,CAAC6F,eAAd,CAA8B;AAC5B;AACA,YAAMC,iBAAiB,GAAG,IAAI/F,eAAJ,CAAoBC,aAApB,CAA1B;AACA,YAAM0E,YAAY,GAAGqB,mBAA0C,CAC7D/F,aAD6D,CAA/D;AAGA,eAAO,IAAI8F,iBAAJ,CAAsB;AAC3BP,UAAAA,IAAI,EAAE,yBADqB;AAE3BK,UAAAA,cAAc,EAAER,4BAFW;AAG3BV,UAAAA,YAAY,EAAZA,YAH2B;AAI3B1E,UAAAA,aAAa,EAAbA;AAJ2B,SAAtB,CAAP;AAMD,OAZD;AAaD;;;;EA7C2CgG;;;;"}
|
|
1
|
+
{"version":3,"file":"jbrowse-plugin-gwas.cjs.development.js","sources":["../src/LinearManhattanRenderer/LinearManhattanRenderer.ts","../src/LinearManhattanRenderer/index.ts","../src/LinearManhattanDisplay/configSchemaFactory.ts","../src/LinearManhattanDisplay/index.ts","../src/index.ts"],"sourcesContent":["import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { readConfObject } from \"@jbrowse/core/configuration\";\nimport { featureSpanPx } from \"@jbrowse/core/util\";\n\nexport default function rendererFactory(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const {\n utils: { getScale },\n WiggleBaseRenderer,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n return class ManhattanPlotRenderer extends WiggleBaseRenderer {\n draw(ctx: CanvasRenderingContext2D, props: any) {\n const {\n features,\n regions,\n bpPerPx,\n config,\n scaleOpts,\n height: unadjustedHeight,\n displayCrossHatches,\n ticks: { values },\n } = props;\n const [region] = regions;\n const YSCALEBAR_LABEL_OFFSET = 5;\n const height = unadjustedHeight - YSCALEBAR_LABEL_OFFSET * 2;\n const opts = { ...scaleOpts, range: [0, height] };\n const width = (region.end - region.start) / bpPerPx;\n\n const scale = getScale(opts);\n const toY = (n: number) => height - scale(n) + YSCALEBAR_LABEL_OFFSET;\n\n for (const feature of features.values()) {\n const [leftPx] = featureSpanPx(feature, region, bpPerPx);\n const score = feature.get(\"score\") as number;\n ctx.fillStyle = readConfObject(config, \"color\", [feature]);\n ctx.beginPath();\n ctx.arc(leftPx, toY(score), 2, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n if (displayCrossHatches) {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(200,200,200,0.8)\";\n values.forEach((tick: number) => {\n ctx.beginPath();\n ctx.moveTo(0, Math.round(toY(tick)));\n ctx.lineTo(width, Math.round(toY(tick)));\n ctx.stroke();\n });\n }\n }\n };\n}\n","import { ConfigurationSchema } from \"@jbrowse/core/configuration\";\nexport { default } from \"./LinearManhattanRenderer\";\n\nexport const configSchema = ConfigurationSchema(\n \"LinearManhattanRenderer\",\n {\n color: {\n type: \"color\",\n description: \"the color of the marks\",\n defaultValue: \"darkblue\",\n },\n },\n { explicitlyTyped: true },\n);\n","import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { types } from \"mobx-state-tree\";\nimport { ConfigurationSchema } from \"@jbrowse/core/configuration\";\n\nexport function configSchemaFactory(pluginManager: PluginManager) {\n const LGVPlugin = pluginManager.getPlugin(\n \"LinearGenomeViewPlugin\",\n ) as import(\"@jbrowse/plugin-linear-genome-view\").default;\n //@ts-ignore\n const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;\n\n const LinearManhattanRendererConfigSchema = pluginManager.getRendererType(\n \"LinearManhattanRenderer\",\n ).configSchema;\n return ConfigurationSchema(\n \"LinearManhattanDisplay\",\n {\n autoscale: {\n type: \"stringEnum\",\n defaultValue: \"local\",\n model: types.enumeration(\"Autoscale type\", [\n \"global\",\n \"local\",\n \"globalsd\",\n \"localsd\",\n \"zscore\",\n ]),\n description:\n \"global/local using their min/max values or w/ standard deviations (globalsd/localsd)\",\n },\n minScore: {\n type: \"number\",\n defaultValue: Number.MIN_VALUE,\n description: \"minimum value for the y-scale\",\n },\n maxScore: {\n type: \"number\",\n description: \"maximum value for the y-scale\",\n defaultValue: Number.MAX_VALUE,\n },\n numStdDev: {\n type: \"number\",\n description:\n \"number of standard deviations to use for autoscale types globalsd or localsd\",\n defaultValue: 3,\n },\n scaleType: {\n type: \"stringEnum\",\n model: types.enumeration(\"Scale type\", [\"linear\", \"log\"]), // todo zscale\n description: \"The type of scale to use\",\n defaultValue: \"linear\",\n },\n inverted: {\n type: \"boolean\",\n description: \"draw upside down\",\n defaultValue: false,\n },\n\n defaultRendering: {\n type: \"stringEnum\",\n model: types.enumeration(\"Rendering\", [\"density\", \"xyplot\", \"line\"]),\n defaultValue: \"xyplot\",\n },\n renderers: ConfigurationSchema(\"RenderersConfiguration\", {\n LinearManhattanRenderer: LinearManhattanRendererConfigSchema,\n }),\n },\n { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true },\n );\n}\n","import PluginManager from \"@jbrowse/core/PluginManager\";\nexport { configSchemaFactory } from \"./configSchemaFactory\";\n\nexport function stateModelFactory(\n pluginManager: PluginManager,\n configSchema: any,\n) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n //@ts-ignore\n const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;\n return types.compose(\n \"LinearManhattanDisplay\",\n linearWiggleDisplayModelFactory(pluginManager, configSchema),\n types\n .model({\n type: types.literal(\"LinearManhattanDisplay\"),\n })\n .views(() => ({\n get rendererTypeName() {\n return \"LinearManhattanRenderer\";\n },\n get needsScalebar() {\n return true;\n },\n get regionTooLarge() {\n return false;\n },\n })),\n );\n}\n\nexport type LinearManhattanDisplayModel = ReturnType<typeof stateModelFactory>;\n","import Plugin from \"@jbrowse/core/Plugin\";\nimport PluginManager from \"@jbrowse/core/PluginManager\";\nimport DisplayType from \"@jbrowse/core/pluggableElementTypes/DisplayType\";\nimport rendererFactory, {\n configSchema as rendererConfigSchema,\n} from \"./LinearManhattanRenderer\";\nimport {\n configSchemaFactory as displayConfigSchemaFactory,\n stateModelFactory as displayModelFactory,\n} from \"./LinearManhattanDisplay\";\n\nexport default class AlignmentsPlugin extends Plugin {\n name = \"GWASPlugin\";\n\n install(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n\n const {\n LinearWiggleDisplayReactComponent,\n XYPlotRendererReactComponent,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n pluginManager.addDisplayType(() => {\n const configSchema = displayConfigSchemaFactory(pluginManager);\n return new DisplayType({\n name: \"LinearManhattanDisplay\",\n configSchema,\n stateModel: displayModelFactory(pluginManager, configSchema),\n trackType: \"FeatureTrack\",\n viewType: \"LinearGenomeView\",\n ReactComponent: LinearWiggleDisplayReactComponent,\n });\n });\n\n pluginManager.addRendererType(() => {\n //@ts-ignore\n const ManhattanRenderer = new rendererFactory(pluginManager);\n const configSchema = rendererConfigSchema;\n return new ManhattanRenderer({\n name: \"LinearManhattanRenderer\",\n ReactComponent: XYPlotRendererReactComponent,\n configSchema,\n pluginManager,\n });\n });\n }\n}\n"],"names":["rendererFactory","pluginManager","WigglePlugin","getPlugin","exports","getScale","utils","WiggleBaseRenderer","ctx","props","features","regions","bpPerPx","config","scaleOpts","unadjustedHeight","height","displayCrossHatches","values","ticks","region","YSCALEBAR_LABEL_OFFSET","opts","range","width","end","start","scale","toY","n","feature","featureSpanPx","leftPx","score","get","fillStyle","readConfObject","beginPath","arc","Math","PI","fill","lineWidth","strokeStyle","forEach","tick","moveTo","round","lineTo","stroke","configSchema","ConfigurationSchema","color","type","description","defaultValue","explicitlyTyped","configSchemaFactory","LGVPlugin","baseLinearDisplayConfigSchema","LinearManhattanRendererConfigSchema","getRendererType","autoscale","model","types","enumeration","minScore","Number","MIN_VALUE","maxScore","MAX_VALUE","numStdDev","scaleType","inverted","defaultRendering","renderers","LinearManhattanRenderer","baseConfiguration","stateModelFactory","lib","linearWiggleDisplayModelFactory","compose","literal","views","rendererTypeName","needsScalebar","regionTooLarge","AlignmentsPlugin","LinearWiggleDisplayReactComponent","XYPlotRendererReactComponent","addDisplayType","displayConfigSchemaFactory","DisplayType","name","stateModel","displayModelFactory","trackType","viewType","ReactComponent","addRendererType","ManhattanRenderer","rendererConfigSchema","Plugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIwBA,gBAAgBC;AACtC,MAAMC,YAAY,GAAGD,aAAa,CAACE,SAAd,CACnB,c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,YAAY,EAAZA,YAFqB;AAGrB4C,UAAAA,UAAU,EAAEC,iBAAmB,CAAC9F,aAAD,EAAgBiD,YAAhB,CAHV;AAIrB8C,UAAAA,SAAS,EAAE,cAJU;AAKrBC,UAAAA,QAAQ,EAAE,kBALW;AAMrBC,UAAAA,cAAc,EAAEV;AANK,SAAhB,CAAP;AAQD,OAVD;AAYAvF,MAAAA,aAAa,CAACkG,eAAd,CAA8B;AAC5B;AACA,YAAMC,iBAAiB,GAAG,IAAIpG,eAAJ,CAAoBC,aAApB,CAA1B;AACA,YAAMiD,cAAY,GAAGmD,YAArB;AACA,eAAO,IAAID,iBAAJ,CAAsB;AAC3BP,UAAAA,IAAI,EAAE,yBADqB;AAE3BK,UAAAA,cAAc,EAAET,4BAFW;AAG3BvC,UAAAA,YAAY,EAAZA,cAH2B;AAI3BjD,UAAAA,aAAa,EAAbA;AAJ2B,SAAtB,CAAP;AAMD,OAVD;AAWD;;;;EArC2CqG;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@jbrowse/core/Plugin")),r=e(require("@jbrowse/core/pluggableElementTypes/DisplayType")),n=require("@jbrowse/core/configuration"),o=require("@jbrowse/core/util"),a=require("mobx-state-tree");function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=y(e);if(t){var o=y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e){var t=e.getPlugin("WigglePlugin").exports,r=t.utils.getScale;return function(e){p(a,e);var t=g(a);function a(){return i(this,a),t.apply(this,arguments)}return l(a,[{key:"draw",value:function(e,t){var a,i=t.features,u=t.bpPerPx,l=t.config,c=t.scaleOpts,f=t.height,p=t.displayCrossHatches,y=t.ticks.values,d=b(t.regions,1)[0],g=f-10,h=s(s({},c),{},{range:[0,g]}),v=(d.end-d.start)/u,w=r(h),O=function(e){return g-w(e)+5},P=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=m(e))){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(i.values());try{for(P.s();!(a=P.n()).done;){var j=a.value,S=b(o.featureSpanPx(j,d,u),1)[0],R=j.get("score");e.fillStyle=n.readConfObject(l,"color",[j]),e.beginPath(),e.arc(S,O(R),2,0,2*Math.PI),e.fill()}}catch(e){P.e(e)}finally{P.f()}p&&(e.lineWidth=1,e.strokeStyle="rgba(200,200,200,0.8)",y.forEach((function(t){e.beginPath(),e.moveTo(0,Math.round(O(t))),e.lineTo(v,Math.round(O(t))),e.stroke()})))}}]),a}(t.WiggleBaseRenderer)}var w=n.ConfigurationSchema("LinearManhattanRenderer",{color:{type:"color",description:"the color of the marks",defaultValue:"darkblue"}},{explicitlyTyped:!0});function O(e,t){var r=e.lib["mobx-state-tree"].types,n=e.getPlugin("WigglePlugin");return r.compose("LinearManhattanDisplay",(0,n.exports.linearWiggleDisplayModelFactory)(e,t),r.model({type:r.literal("LinearManhattanDisplay")}).views((function(){return{get rendererTypeName(){return"LinearManhattanRenderer"},get needsScalebar(){return!0},get regionTooLarge(){return!1}}})))}exports.default=function(e){p(u,t);var o=g(u);function u(){var e;return i(this,u),(e=o.apply(this,arguments)).name="GWASPlugin",e}return l(u,[{key:"install",value:function(e){var t=e.getPlugin("WigglePlugin").exports,o=t.LinearWiggleDisplayReactComponent,i=t.XYPlotRendererReactComponent;e.addDisplayType((function(){var t=function(e){var t=e.getPlugin("LinearGenomeViewPlugin").exports.baseLinearDisplayConfigSchema,r=e.getRendererType("LinearManhattanRenderer").configSchema;return n.ConfigurationSchema("LinearManhattanDisplay",{autoscale:{type:"stringEnum",defaultValue:"local",model:a.types.enumeration("Autoscale type",["global","local","globalsd","localsd","zscore"]),description:"global/local using their min/max values or w/ standard deviations (globalsd/localsd)"},minScore:{type:"number",defaultValue:Number.MIN_VALUE,description:"minimum value for the y-scale"},maxScore:{type:"number",description:"maximum value for the y-scale",defaultValue:Number.MAX_VALUE},numStdDev:{type:"number",description:"number of standard deviations to use for autoscale types globalsd or localsd",defaultValue:3},scaleType:{type:"stringEnum",model:a.types.enumeration("Scale type",["linear","log"]),description:"The type of scale to use",defaultValue:"linear"},inverted:{type:"boolean",description:"draw upside down",defaultValue:!1},defaultRendering:{type:"stringEnum",model:a.types.enumeration("Rendering",["density","xyplot","line"]),defaultValue:"xyplot"},renderers:n.ConfigurationSchema("RenderersConfiguration",{LinearManhattanRenderer:r})},{baseConfiguration:t,explicitlyTyped:!0})}(e);return new r({name:"LinearManhattanDisplay",configSchema:t,stateModel:O(e,t),trackType:"FeatureTrack",viewType:"LinearGenomeView",ReactComponent:o})})),e.addRendererType((function(){return new new v(e)({name:"LinearManhattanRenderer",ReactComponent:i,configSchema:w,pluginManager:e})}))}}]),u}();
|
|
2
2
|
//# sourceMappingURL=jbrowse-plugin-gwas.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jbrowse-plugin-gwas.cjs.production.min.js","sources":["../src/LinearManhattanRenderer/LinearManhattanRenderer.ts","../src/LinearManhattanDisplay/index.ts","../src/index.ts","../src/LinearManhattanRenderer/index.js"],"sourcesContent":["import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { readConfObject } from \"@jbrowse/core/configuration\";\n\nexport default function rendererFactory(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const {\n utils: { getScale },\n WiggleBaseRenderer,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n const { featureSpanPx } = pluginManager.lib[\"@jbrowse/core/util\"];\n\n return class ManhattanPlotRenderer extends WiggleBaseRenderer {\n draw(ctx: CanvasRenderingContext2D, props: any) {\n const {\n features,\n regions,\n bpPerPx,\n config,\n scaleOpts,\n height: unadjustedHeight,\n displayCrossHatches,\n ticks: { values },\n } = props;\n const [region] = regions;\n const YSCALEBAR_LABEL_OFFSET = 5;\n const height = unadjustedHeight - YSCALEBAR_LABEL_OFFSET * 2;\n const opts = { ...scaleOpts, range: [0, height] };\n const width = (region.end - region.start) / bpPerPx;\n\n const scale = getScale(opts);\n const toY = (n: number) => height - scale(n) + YSCALEBAR_LABEL_OFFSET;\n\n for (const feature of features.values()) {\n const [leftPx] = featureSpanPx(feature, region, bpPerPx);\n const score = feature.get(\"score\") as number;\n ctx.fillStyle = readConfObject(config, \"color\", [feature]);\n ctx.beginPath();\n ctx.arc(leftPx, toY(score), 2, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n if (displayCrossHatches) {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(200,200,200,0.8)\";\n values.forEach((tick: number) => {\n ctx.beginPath();\n ctx.moveTo(0, Math.round(toY(tick)));\n ctx.lineTo(width, Math.round(toY(tick)));\n ctx.stroke();\n });\n }\n }\n };\n}\n","import PluginManager from \"@jbrowse/core/PluginManager\";\n\nexport function configSchemaFactory(pluginManager: PluginManager) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const { ConfigurationSchema } = pluginManager.lib[\n \"@jbrowse/core/configuration\"\n ];\n\n const LGVPlugin = pluginManager.getPlugin(\n \"LinearGenomeViewPlugin\",\n ) as import(\"@jbrowse/plugin-linear-genome-view\").default;\n //@ts-ignore\n const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;\n\n return ConfigurationSchema(\n \"LinearManhattanDisplay\",\n {\n autoscale: {\n type: \"stringEnum\",\n defaultValue: \"local\",\n model: types.enumeration(\"Autoscale type\", [\n \"global\",\n \"local\",\n \"globalsd\",\n \"localsd\",\n \"zscore\",\n ]),\n description:\n \"global/local using their min/max values or w/ standard deviations (globalsd/localsd)\",\n },\n minScore: {\n type: \"number\",\n defaultValue: Number.MIN_VALUE,\n description: \"minimum value for the y-scale\",\n },\n maxScore: {\n type: \"number\",\n description: \"maximum value for the y-scale\",\n defaultValue: Number.MAX_VALUE,\n },\n numStdDev: {\n type: \"number\",\n description:\n \"number of standard deviations to use for autoscale types globalsd or localsd\",\n defaultValue: 3,\n },\n scaleType: {\n type: \"stringEnum\",\n model: types.enumeration(\"Scale type\", [\"linear\", \"log\"]), // todo zscale\n description: \"The type of scale to use\",\n defaultValue: \"linear\",\n },\n inverted: {\n type: \"boolean\",\n description: \"draw upside down\",\n defaultValue: false,\n },\n\n defaultRendering: {\n type: \"stringEnum\",\n model: types.enumeration(\"Rendering\", [\"density\", \"xyplot\", \"line\"]),\n defaultValue: \"xyplot\",\n },\n },\n { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true },\n );\n}\n\nexport function stateModelFactory(\n pluginManager: PluginManager,\n configSchema: any,\n) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n //@ts-ignore\n const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;\n return types.compose(\n \"LinearManhattanDisplay\",\n linearWiggleDisplayModelFactory(pluginManager, configSchema),\n types\n .model({\n type: types.literal(\"LinearManhattanDisplay\"),\n })\n .views(() => ({\n get rendererTypeName() {\n return \"LinearManhattanRenderer\";\n },\n get needsScalebar() {\n return true;\n },\n })),\n );\n}\n\nexport type LinearManhattanDisplayModel = ReturnType<typeof stateModelFactory>;\n","import Plugin from \"@jbrowse/core/Plugin\";\nimport PluginManager from \"@jbrowse/core/PluginManager\";\nimport rendererFactory, {\n configSchemaFactory as linearManhattanRendererConfigSchemaFactory,\n} from \"./LinearManhattanRenderer\";\nimport {\n configSchemaFactory as linearManhattanDisplayConfigSchemaFactory,\n stateModelFactory as linearManhattanDisplayModelFactory,\n} from \"./LinearManhattanDisplay\";\n\nexport default class AlignmentsPlugin extends Plugin {\n name = \"GWASPlugin\";\n\n install(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const DisplayType =\n pluginManager.lib[\"@jbrowse/core/pluggableElementTypes/DisplayType\"];\n const {\n LinearWiggleDisplayReactComponent,\n XYPlotRendererReactComponent,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n pluginManager.addDisplayType(() => {\n const configSchema = linearManhattanDisplayConfigSchemaFactory(\n pluginManager,\n );\n return new DisplayType({\n name: \"LinearManhattanDisplay\",\n configSchema,\n stateModel: linearManhattanDisplayModelFactory(\n pluginManager,\n configSchema,\n ),\n trackType: \"FeatureTrack\",\n viewType: \"LinearGenomeView\",\n ReactComponent: LinearWiggleDisplayReactComponent,\n });\n });\n\n pluginManager.addRendererType(() => {\n //@ts-ignore\n const ManhattanRenderer = new rendererFactory(pluginManager);\n const configSchema = linearManhattanRendererConfigSchemaFactory(\n pluginManager,\n );\n return new ManhattanRenderer({\n name: \"LinearManhattanRenderer\",\n ReactComponent: XYPlotRendererReactComponent,\n configSchema,\n pluginManager,\n });\n });\n }\n}\n","export { default } from \"./LinearManhattanRenderer\";\n\nexport function configSchemaFactory(pluginManager) {\n const { ConfigurationSchema } = pluginManager.lib[\n \"@jbrowse/core/configuration\"\n ];\n\n return ConfigurationSchema(\n \"LinearManhattanRenderer\",\n {\n color: {\n type: \"color\",\n description: \"the color of the marks\",\n defaultValue: \"darkblue\",\n },\n },\n { explicitlyTyped: true },\n );\n}\n"],"names":["rendererFactory","pluginManager","getPlugin","exports","getScale","utils","featureSpanPx","lib","ctx","props","features","bpPerPx","config","scaleOpts","unadjustedHeight","height","displayCrossHatches","values","ticks","region","regions","YSCALEBAR_LABEL_OFFSET","opts","range","width","end","start","scale","toY","n","feature","leftPx","score","get","fillStyle","readConfObject","beginPath","arc","Math","PI","fill","lineWidth","strokeStyle","forEach","tick","moveTo","round","lineTo","stroke","WiggleBaseRenderer","stateModelFactory","configSchema","types","WigglePlugin","compose","linearWiggleDisplayModelFactory","model","type","literal","views","Plugin","DisplayType","LinearWiggleDisplayReactComponent","XYPlotRendererReactComponent","addDisplayType","ConfigurationSchema","baseLinearDisplayConfigSchema","autoscale","defaultValue","enumeration","description","minScore","Number","MIN_VALUE","maxScore","MAX_VALUE","numStdDev","scaleType","inverted","defaultRendering","baseConfiguration","explicitlyTyped","linearManhattanDisplayConfigSchemaFactory","name","stateModel","linearManhattanDisplayModelFactory","trackType","viewType","ReactComponent","addRendererType","ManhattanRenderer","color","linearManhattanRendererConfigSchemaFactory"],"mappings":"goGAGwBA,EAAgBC,SACjBA,EAAcC,UACjC,gBAMeC,QAHNC,IAATC,MAASD,SAKHE,EAAkBL,EAAcM,IAAI,sBAApCD,gJAGDE,EAA+BC,SAEhCC,EAQED,EARFC,SAEAC,EAMEF,EANFE,QACAC,EAKEH,EALFG,OACAC,EAIEJ,EAJFI,UACQC,EA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AAcM,IAC5C,+BADM0D,oBAQAC,EAJUjE,EAAcC,UAC9B,0BAGkDC,QAA5C+D,qCAEDD,EACL,yBACA,CACEE,UAAW,CACTV,KAAM,aACNW,aAAc,QACdZ,MAAOJ,EAAMiB,YAAY,iBAAkB,CACzC,SACA,QACA,WACA,UACA,WAEFC,YACE,wFAEJC,SAAU,CACRd,KAAM,SACNW,aAAcI,OAAOC,UACrBH,YAAa,iCAEfI,SAAU,CACRjB,KAAM,SACNa,YAAa,gCACbF,aAAcI,OAAOG,WAEvBC,UAAW,CACTnB,KAAM,SACNa,YACE,+EACFF,aAAc,GAEhBS,UAAW,CACTpB,KAAM,aACND,MAAOJ,EAAMiB,YAAY,aAAc,CAAC,SAAU,QAClDC,YAAa,2BACbF,aAAc,UAEhBU,SAAU,CACRrB,KAAM,UACNa,YAAa,mBACbF,cAAc,GAGhBW,iBAAkB,CAChBtB,KAAM,aACND,MAAOJ,EAAMiB,YAAY,YAAa,CAAC,UAAW,SAAU,SAC5DD,aAAc,WAGlB,CAAEY,kBAAmBd,EAA+Be,iBAAiB,ICtC9CC,CACnBjF,UAEK,IAAI4D,EAAY,CACrBsB,KAAM,yBACNhC,aAAAA,EACAiC,WAAYC,EACVpF,EACAkD,GAEFmC,UAAW,eACXC,SAAU,mBACVC,eAAgB1B,OAIpB7D,EAAcwF,iBAAgB,eAEtBC,EAAoB,IAAI1F,EAAgBC,GACxCkD,EC3CL,SAA6BlD,UAK3BgE,EAJyBhE,EAAcM,IAC5C,+BADM0D,qBAKN,0BACA,CACE0B,MAAO,CACLlC,KAAM,QACNa,YAAa,yBACbF,aAAc,aAGlB,CAAEa,iBAAiB,ID6BIW,CACnB3F,UAEK,IAAIyF,EAAkB,CAC3BP,KAAM,0BACNK,eAAgBzB,EAChBZ,aAAAA,EACAlD,cAAAA"}
|
|
1
|
+
{"version":3,"file":"jbrowse-plugin-gwas.cjs.production.min.js","sources":["../src/LinearManhattanRenderer/LinearManhattanRenderer.ts","../src/LinearManhattanRenderer/index.ts","../src/LinearManhattanDisplay/index.ts","../src/index.ts","../src/LinearManhattanDisplay/configSchemaFactory.ts"],"sourcesContent":["import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { readConfObject } from \"@jbrowse/core/configuration\";\nimport { featureSpanPx } from \"@jbrowse/core/util\";\n\nexport default function rendererFactory(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n const {\n utils: { getScale },\n WiggleBaseRenderer,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n return class ManhattanPlotRenderer extends WiggleBaseRenderer {\n draw(ctx: CanvasRenderingContext2D, props: any) {\n const {\n features,\n regions,\n bpPerPx,\n config,\n scaleOpts,\n height: unadjustedHeight,\n displayCrossHatches,\n ticks: { values },\n } = props;\n const [region] = regions;\n const YSCALEBAR_LABEL_OFFSET = 5;\n const height = unadjustedHeight - YSCALEBAR_LABEL_OFFSET * 2;\n const opts = { ...scaleOpts, range: [0, height] };\n const width = (region.end - region.start) / bpPerPx;\n\n const scale = getScale(opts);\n const toY = (n: number) => height - scale(n) + YSCALEBAR_LABEL_OFFSET;\n\n for (const feature of features.values()) {\n const [leftPx] = featureSpanPx(feature, region, bpPerPx);\n const score = feature.get(\"score\") as number;\n ctx.fillStyle = readConfObject(config, \"color\", [feature]);\n ctx.beginPath();\n ctx.arc(leftPx, toY(score), 2, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n if (displayCrossHatches) {\n ctx.lineWidth = 1;\n ctx.strokeStyle = \"rgba(200,200,200,0.8)\";\n values.forEach((tick: number) => {\n ctx.beginPath();\n ctx.moveTo(0, Math.round(toY(tick)));\n ctx.lineTo(width, Math.round(toY(tick)));\n ctx.stroke();\n });\n }\n }\n };\n}\n","import { ConfigurationSchema } from \"@jbrowse/core/configuration\";\nexport { default } from \"./LinearManhattanRenderer\";\n\nexport const configSchema = ConfigurationSchema(\n \"LinearManhattanRenderer\",\n {\n color: {\n type: \"color\",\n description: \"the color of the marks\",\n defaultValue: \"darkblue\",\n },\n },\n { explicitlyTyped: true },\n);\n","import PluginManager from \"@jbrowse/core/PluginManager\";\nexport { configSchemaFactory } from \"./configSchemaFactory\";\n\nexport function stateModelFactory(\n pluginManager: PluginManager,\n configSchema: any,\n) {\n const { types } = pluginManager.lib[\"mobx-state-tree\"];\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n //@ts-ignore\n const { linearWiggleDisplayModelFactory } = WigglePlugin.exports;\n return types.compose(\n \"LinearManhattanDisplay\",\n linearWiggleDisplayModelFactory(pluginManager, configSchema),\n types\n .model({\n type: types.literal(\"LinearManhattanDisplay\"),\n })\n .views(() => ({\n get rendererTypeName() {\n return \"LinearManhattanRenderer\";\n },\n get needsScalebar() {\n return true;\n },\n get regionTooLarge() {\n return false;\n },\n })),\n );\n}\n\nexport type LinearManhattanDisplayModel = ReturnType<typeof stateModelFactory>;\n","import Plugin from \"@jbrowse/core/Plugin\";\nimport PluginManager from \"@jbrowse/core/PluginManager\";\nimport DisplayType from \"@jbrowse/core/pluggableElementTypes/DisplayType\";\nimport rendererFactory, {\n configSchema as rendererConfigSchema,\n} from \"./LinearManhattanRenderer\";\nimport {\n configSchemaFactory as displayConfigSchemaFactory,\n stateModelFactory as displayModelFactory,\n} from \"./LinearManhattanDisplay\";\n\nexport default class AlignmentsPlugin extends Plugin {\n name = \"GWASPlugin\";\n\n install(pluginManager: PluginManager) {\n const WigglePlugin = pluginManager.getPlugin(\n \"WigglePlugin\",\n ) as import(\"@jbrowse/plugin-wiggle\").default;\n\n const {\n LinearWiggleDisplayReactComponent,\n XYPlotRendererReactComponent,\n //@ts-ignore\n } = WigglePlugin.exports;\n\n pluginManager.addDisplayType(() => {\n const configSchema = displayConfigSchemaFactory(pluginManager);\n return new DisplayType({\n name: \"LinearManhattanDisplay\",\n configSchema,\n stateModel: displayModelFactory(pluginManager, configSchema),\n trackType: \"FeatureTrack\",\n viewType: \"LinearGenomeView\",\n ReactComponent: LinearWiggleDisplayReactComponent,\n });\n });\n\n pluginManager.addRendererType(() => {\n //@ts-ignore\n const ManhattanRenderer = new rendererFactory(pluginManager);\n const configSchema = rendererConfigSchema;\n return new ManhattanRenderer({\n name: \"LinearManhattanRenderer\",\n ReactComponent: XYPlotRendererReactComponent,\n configSchema,\n pluginManager,\n });\n });\n }\n}\n","import PluginManager from \"@jbrowse/core/PluginManager\";\nimport { types } from \"mobx-state-tree\";\nimport { ConfigurationSchema } from \"@jbrowse/core/configuration\";\n\nexport function configSchemaFactory(pluginManager: PluginManager) {\n const LGVPlugin = pluginManager.getPlugin(\n \"LinearGenomeViewPlugin\",\n ) as import(\"@jbrowse/plugin-linear-genome-view\").default;\n //@ts-ignore\n const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;\n\n const LinearManhattanRendererConfigSchema = pluginManager.getRendererType(\n \"LinearManhattanRenderer\",\n ).configSchema;\n return ConfigurationSchema(\n \"LinearManhattanDisplay\",\n {\n autoscale: {\n type: \"stringEnum\",\n defaultValue: \"local\",\n model: types.enumeration(\"Autoscale type\", [\n \"global\",\n \"local\",\n \"globalsd\",\n \"localsd\",\n \"zscore\",\n ]),\n description:\n \"global/local using their min/max values or w/ standard deviations (globalsd/localsd)\",\n },\n minScore: {\n type: \"number\",\n defaultValue: Number.MIN_VALUE,\n description: \"minimum value for the y-scale\",\n },\n maxScore: {\n type: \"number\",\n description: \"maximum value for the y-scale\",\n defaultValue: Number.MAX_VALUE,\n },\n numStdDev: {\n type: \"number\",\n description:\n \"number of standard deviations to use for autoscale types globalsd or localsd\",\n defaultValue: 3,\n },\n scaleType: {\n type: \"stringEnum\",\n model: types.enumeration(\"Scale type\", [\"linear\", \"log\"]), // todo zscale\n description: \"The type of scale to use\",\n defaultValue: \"linear\",\n },\n inverted: {\n type: \"boolean\",\n description: \"draw upside down\",\n defaultValue: false,\n },\n\n defaultRendering: {\n type: \"stringEnum\",\n model: types.enumeration(\"Rendering\", [\"density\", \"xyplot\", \"line\"]),\n defaultValue: \"xyplot\",\n },\n renderers: ConfigurationSchema(\"RenderersConfiguration\", {\n LinearManhattanRenderer: LinearManhattanRendererConfigSchema,\n }),\n },\n { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true },\n );\n}\n"],"names":["rendererFactory","pluginManager","getPlugin","exports","getScale","utils","ctx","props","features","bpPerPx","config","scaleOpts","unadjustedHeight","height","displayCrossHatches","values","ticks","region","regions","YSCALEBAR_LABEL_OFFSET","opts","range","width","end","start","scale","toY","n","feature","leftPx","featureSpanPx","score","get","fillStyle","readConfObject","beginPath","arc","Math","PI","fill","lineWidth","strokeStyle","forEach","tick","moveTo","round","lineTo","stroke","WiggleBaseRenderer","configSchema","ConfigurationSchema","color","type","description","defaultValue","explicitlyTyped","stateModelFactory","types","lib","WigglePlugin","compose","linearWiggleDisplayModelFactory","model","literal","views","Plugin","LinearWiggleDisplayReactComponent","XYPlotRendererReactComponent","addDisplayType","baseLinearDisplayConfigSchema","LinearManhattanRendererConfigSchema","getRendererType","autoscale","enumeration","minScore","Number","MIN_VALUE","maxScore","MAX_VALUE","numStdDev","scaleType","inverted","defaultRendering","renderers","LinearManhattanRenderer","baseConfiguration","displayConfigSchemaFactory","DisplayType","name","stateModel","displayModelFactory","trackType","viewType","ReactComponent","addRendererType","rendererConfigSchema"],"mappings":"ixGAIwBA,EAAgBC,SACjBA,EAAcC,UACjC,gBAMeC,QAHNC,IAATC,MAASD,2IAMJE,EAA+BC,SAEhCC,EAQED,EARFC,SAEAC,EAMEF,EANFE,QACAC,EAKEH,EALFG,OACAC,EAIEJ,EAJFI,UACQC,EAGNL,EAHFM,OACAC,EAEEP,EAFFO,oBACSC,EACPR,EADFS,MAASD,OAEJE,IADHV,EAPFW,cAUIL,EAASD,EAAmBO,GAC5BC,SAAYT,OAAWU,MAAO,CAAC,EAAGR,KAClCS,GAASL,EAAOM,IAAMN,EAAOO,OAASf,EAEtC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AY,iBAAkB,CACzC,SACA,QACA,WACA,UACA,WAEFpB,YACE,wFAEJqB,SAAU,CACRtB,KAAM,SACNE,aAAcqB,OAAOC,UACrBvB,YAAa,iCAEfwB,SAAU,CACRzB,KAAM,SACNC,YAAa,gCACbC,aAAcqB,OAAOG,WAEvBC,UAAW,CACT3B,KAAM,SACNC,YACE,+EACFC,aAAc,GAEhB0B,UAAW,CACT5B,KAAM,aACNU,MAAOL,QAAMgB,YAAY,aAAc,CAAC,SAAU,QAClDpB,YAAa,2BACbC,aAAc,UAEhB2B,SAAU,CACR7B,KAAM,UACNC,YAAa,mBACbC,cAAc,GAGhB4B,iBAAkB,CAChB9B,KAAM,aACNU,MAAOL,QAAMgB,YAAY,YAAa,CAAC,UAAW,SAAU,SAC5DnB,aAAc,UAEhB6B,UAAWjC,sBAAoB,yBAA0B,CACvDkC,wBAAyBd,KAG7B,CAAEe,kBAAmBhB,EAA+Bd,iBAAiB,IDzC9C+B,CAA2BrF,UACzC,IAAIsF,EAAY,CACrBC,KAAM,yBACNvC,aAAAA,EACAwC,WAAYC,EAAoBzF,EAAegD,GAC/C0C,UAAW,eACXC,SAAU,mBACVC,eAAgB3B,OAIpBjE,EAAc6F,iBAAgB,kBAIrB,IAFmB,IAAI9F,EAAgBC,EAEvC,CAAsB,CAC3BuF,KAAM,0BACNK,eAAgB1B,EAChBlB,aAJmB8C,EAKnB9F,cAAAA"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import
|
|
2
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
|
|
3
|
+
import { readConfObject, ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
4
|
+
import { featureSpanPx } from '@jbrowse/core/util';
|
|
5
|
+
import { types } from 'mobx-state-tree';
|
|
3
6
|
|
|
4
7
|
function _classCallCheck(instance, Constructor) {
|
|
5
8
|
if (!(instance instanceof Constructor)) {
|
|
@@ -269,7 +272,6 @@ function rendererFactory(pluginManager) {
|
|
|
269
272
|
var _WigglePlugin$exports = WigglePlugin.exports,
|
|
270
273
|
getScale = _WigglePlugin$exports.utils.getScale,
|
|
271
274
|
WiggleBaseRenderer = _WigglePlugin$exports.WiggleBaseRenderer;
|
|
272
|
-
var featureSpanPx = pluginManager.lib["@jbrowse/core/util"].featureSpanPx;
|
|
273
275
|
return /*#__PURE__*/function (_WiggleBaseRenderer) {
|
|
274
276
|
_inherits(ManhattanPlotRenderer, _WiggleBaseRenderer);
|
|
275
277
|
|
|
@@ -350,25 +352,21 @@ function rendererFactory(pluginManager) {
|
|
|
350
352
|
}(WiggleBaseRenderer);
|
|
351
353
|
}
|
|
352
354
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
explicitlyTyped: true
|
|
363
|
-
});
|
|
364
|
-
}
|
|
355
|
+
var configSchema = /*#__PURE__*/ConfigurationSchema("LinearManhattanRenderer", {
|
|
356
|
+
color: {
|
|
357
|
+
type: "color",
|
|
358
|
+
description: "the color of the marks",
|
|
359
|
+
defaultValue: "darkblue"
|
|
360
|
+
}
|
|
361
|
+
}, {
|
|
362
|
+
explicitlyTyped: true
|
|
363
|
+
});
|
|
365
364
|
|
|
366
|
-
function configSchemaFactory
|
|
367
|
-
var types = pluginManager.lib["mobx-state-tree"].types;
|
|
368
|
-
var ConfigurationSchema = pluginManager.lib["@jbrowse/core/configuration"].ConfigurationSchema;
|
|
365
|
+
function configSchemaFactory(pluginManager) {
|
|
369
366
|
var LGVPlugin = pluginManager.getPlugin("LinearGenomeViewPlugin"); //@ts-ignore
|
|
370
367
|
|
|
371
368
|
var baseLinearDisplayConfigSchema = LGVPlugin.exports.baseLinearDisplayConfigSchema;
|
|
369
|
+
var LinearManhattanRendererConfigSchema = pluginManager.getRendererType("LinearManhattanRenderer").configSchema;
|
|
372
370
|
return ConfigurationSchema("LinearManhattanDisplay", {
|
|
373
371
|
autoscale: {
|
|
374
372
|
type: "stringEnum",
|
|
@@ -406,12 +404,16 @@ function configSchemaFactory$1(pluginManager) {
|
|
|
406
404
|
type: "stringEnum",
|
|
407
405
|
model: types.enumeration("Rendering", ["density", "xyplot", "line"]),
|
|
408
406
|
defaultValue: "xyplot"
|
|
409
|
-
}
|
|
407
|
+
},
|
|
408
|
+
renderers: ConfigurationSchema("RenderersConfiguration", {
|
|
409
|
+
LinearManhattanRenderer: LinearManhattanRendererConfigSchema
|
|
410
|
+
})
|
|
410
411
|
}, {
|
|
411
412
|
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
412
413
|
explicitlyTyped: true
|
|
413
414
|
});
|
|
414
415
|
}
|
|
416
|
+
|
|
415
417
|
function stateModelFactory(pluginManager, configSchema) {
|
|
416
418
|
var types = pluginManager.lib["mobx-state-tree"].types;
|
|
417
419
|
var WigglePlugin = pluginManager.getPlugin("WigglePlugin"); //@ts-ignore
|
|
@@ -427,6 +429,10 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
427
429
|
|
|
428
430
|
get needsScalebar() {
|
|
429
431
|
return true;
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
get regionTooLarge() {
|
|
435
|
+
return false;
|
|
430
436
|
}
|
|
431
437
|
|
|
432
438
|
};
|
|
@@ -452,12 +458,11 @@ var AlignmentsPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
452
458
|
key: "install",
|
|
453
459
|
value: function install(pluginManager) {
|
|
454
460
|
var WigglePlugin = pluginManager.getPlugin("WigglePlugin");
|
|
455
|
-
var DisplayType = pluginManager.lib["@jbrowse/core/pluggableElementTypes/DisplayType"];
|
|
456
461
|
var _WigglePlugin$exports = WigglePlugin.exports,
|
|
457
462
|
LinearWiggleDisplayReactComponent = _WigglePlugin$exports.LinearWiggleDisplayReactComponent,
|
|
458
463
|
XYPlotRendererReactComponent = _WigglePlugin$exports.XYPlotRendererReactComponent;
|
|
459
464
|
pluginManager.addDisplayType(function () {
|
|
460
|
-
var configSchema = configSchemaFactory
|
|
465
|
+
var configSchema = configSchemaFactory(pluginManager);
|
|
461
466
|
return new DisplayType({
|
|
462
467
|
name: "LinearManhattanDisplay",
|
|
463
468
|
configSchema: configSchema,
|
|
@@ -470,11 +475,11 @@ var AlignmentsPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
470
475
|
pluginManager.addRendererType(function () {
|
|
471
476
|
//@ts-ignore
|
|
472
477
|
var ManhattanRenderer = new rendererFactory(pluginManager);
|
|
473
|
-
var configSchema =
|
|
478
|
+
var configSchema$1 = configSchema;
|
|
474
479
|
return new ManhattanRenderer({
|
|
475
480
|
name: "LinearManhattanRenderer",
|
|
476
481
|
ReactComponent: XYPlotRendererReactComponent,
|
|
477
|
-
configSchema: configSchema,
|
|
482
|
+
configSchema: configSchema$1,
|
|
478
483
|
pluginManager: pluginManager
|
|
479
484
|
});
|
|
480
485
|
});
|