@jbrowse/plugin-hic 2.17.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GuessAdapter/index.d.ts +2 -0
- package/dist/GuessAdapter/index.js +23 -0
- package/dist/HicAdapter/HicAdapter.d.ts +6 -5
- package/dist/HicAdapter/HicAdapter.js +3 -6
- package/dist/HicAdapter/HicFilehandle.d.ts +3 -3
- package/dist/HicAdapter/HicFilehandle.js +1 -7
- package/dist/HicAdapter/configSchema.d.ts +0 -6
- package/dist/HicAdapter/configSchema.js +1 -11
- package/dist/HicAdapter/index.d.ts +1 -1
- package/dist/HicAdapter/index.js +17 -7
- package/dist/HicRenderer/HicRenderer.d.ts +8 -7
- package/dist/HicRenderer/HicRenderer.js +20 -13
- package/dist/HicRenderer/components/HicRendering.d.ts +2 -3
- package/dist/HicRenderer/components/HicRendering.js +2 -7
- package/dist/HicRenderer/configSchema.d.ts +0 -9
- package/dist/HicRenderer/configSchema.js +1 -14
- package/dist/HicRenderer/index.d.ts +1 -1
- package/dist/HicRenderer/index.js +1 -1
- package/dist/HicRenderer/makeImageData.d.ts +4 -4
- package/dist/HicRenderer/makeImageData.js +11 -10
- package/dist/HicRenderer/viridis.js +0 -17
- package/dist/HicTrack/configSchema.d.ts +1 -1
- package/dist/HicTrack/configSchema.js +1 -8
- package/dist/HicTrack/index.d.ts +1 -1
- package/dist/LinearHicDisplay/configSchema.d.ts +2 -5
- package/dist/LinearHicDisplay/configSchema.js +1 -11
- package/dist/LinearHicDisplay/index.d.ts +1 -1
- package/dist/LinearHicDisplay/model.d.ts +21 -100
- package/dist/LinearHicDisplay/model.js +3 -57
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -28
- package/esm/GuessAdapter/index.d.ts +2 -0
- package/esm/GuessAdapter/index.js +20 -0
- package/esm/HicAdapter/HicAdapter.d.ts +6 -5
- package/esm/HicAdapter/HicAdapter.js +4 -7
- package/esm/HicAdapter/HicFilehandle.d.ts +3 -3
- package/esm/HicAdapter/HicFilehandle.js +1 -7
- package/esm/HicAdapter/configSchema.d.ts +0 -6
- package/esm/HicAdapter/configSchema.js +1 -11
- package/esm/HicAdapter/index.d.ts +1 -1
- package/esm/HicRenderer/HicRenderer.d.ts +8 -7
- package/esm/HicRenderer/HicRenderer.js +3 -6
- package/esm/HicRenderer/components/HicRendering.d.ts +2 -3
- package/esm/HicRenderer/components/HicRendering.js +2 -4
- package/esm/HicRenderer/configSchema.d.ts +0 -9
- package/esm/HicRenderer/configSchema.js +1 -14
- package/esm/HicRenderer/index.d.ts +1 -1
- package/esm/HicRenderer/index.js +1 -1
- package/esm/HicRenderer/makeImageData.d.ts +4 -4
- package/esm/HicRenderer/makeImageData.js +11 -10
- package/esm/HicRenderer/viridis.js +0 -17
- package/esm/HicTrack/configSchema.d.ts +1 -1
- package/esm/HicTrack/configSchema.js +1 -8
- package/esm/HicTrack/index.d.ts +1 -1
- package/esm/LinearHicDisplay/configSchema.d.ts +2 -5
- package/esm/LinearHicDisplay/configSchema.js +1 -11
- package/esm/LinearHicDisplay/index.d.ts +1 -1
- package/esm/LinearHicDisplay/model.d.ts +21 -100
- package/esm/LinearHicDisplay/model.js +3 -57
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -28
- package/package.json +2 -2
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
declare const HicRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
baseColor: {
|
|
6
3
|
type: string;
|
|
7
4
|
description: string;
|
|
8
5
|
defaultValue: string;
|
|
9
6
|
};
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
7
|
color: {
|
|
14
8
|
type: string;
|
|
15
9
|
description: string;
|
|
16
10
|
defaultValue: string;
|
|
17
11
|
contextVariable: string[];
|
|
18
12
|
};
|
|
19
|
-
/**
|
|
20
|
-
* #slot
|
|
21
|
-
*/
|
|
22
13
|
maxHeight: {
|
|
23
14
|
type: string;
|
|
24
15
|
description: string;
|
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config HicRenderer
|
|
4
|
-
* #category renderer
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
7
3
|
const HicRenderer = ConfigurationSchema('HicRenderer', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
4
|
baseColor: {
|
|
12
5
|
type: 'color',
|
|
13
6
|
description: 'base color to be used in the hic alignment',
|
|
14
7
|
defaultValue: '#f00',
|
|
15
8
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
9
|
color: {
|
|
20
10
|
type: 'color',
|
|
21
11
|
description: 'the color of each feature in a hic alignment',
|
|
22
12
|
defaultValue: 'jexl:interpolate(count,scale)',
|
|
23
13
|
contextVariable: ['count', 'maxScore', 'baseColor', 'scale'],
|
|
24
14
|
},
|
|
25
|
-
/**
|
|
26
|
-
* #slot
|
|
27
|
-
*/
|
|
28
15
|
maxHeight: {
|
|
29
16
|
type: 'integer',
|
|
30
17
|
description: 'the maximum height to be used in a hic rendering',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function HicRendererF(pluginManager: PluginManager): void;
|
package/esm/HicRenderer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import HicRenderer from './HicRenderer';
|
|
1
2
|
import ReactComponent from './components/HicRendering';
|
|
2
3
|
import configSchema from './configSchema';
|
|
3
|
-
import HicRenderer from './HicRenderer';
|
|
4
4
|
export default function HicRendererF(pluginManager) {
|
|
5
5
|
pluginManager.addRendererType(() => new HicRenderer({
|
|
6
6
|
name: 'HicRenderer',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import type { RenderArgsDeserializedWithFeatures } from './HicRenderer';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { RenderArgs as ServerSideRenderArgs } from '@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType';
|
|
4
|
+
import type { Region } from '@jbrowse/core/util/types';
|
|
5
5
|
export interface RenderArgs extends ServerSideRenderArgs {
|
|
6
6
|
regions: Region[];
|
|
7
7
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { abortBreakPoint } from '@jbrowse/core/util';
|
|
2
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
2
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
4
3
|
import { colord } from '@jbrowse/core/util/colord';
|
|
5
|
-
import {
|
|
4
|
+
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
6
5
|
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
6
|
+
import { scaleSequential, scaleSequentialLog, } from '@mui/x-charts-vendor/d3-scale';
|
|
7
7
|
import interpolateViridis from './viridis';
|
|
8
8
|
export async function makeImageData(ctx, props) {
|
|
9
|
-
const { features, config, bpPerPx,
|
|
9
|
+
const { features, config, bpPerPx, stopToken, resolution, sessionId, adapterConfig, useLogScale, colorScheme, regions, pluginManager, } = props;
|
|
10
|
+
const { statusCallback = () => { } } = props;
|
|
11
|
+
statusCallback('Drawing Hi-C matrix');
|
|
10
12
|
const region = regions[0];
|
|
11
13
|
const { dataAdapter } = await getAdapter(pluginManager, sessionId, adapterConfig);
|
|
12
14
|
const res = await dataAdapter.getResolution(bpPerPx / resolution);
|
|
@@ -18,13 +20,13 @@ export async function makeImageData(ctx, props) {
|
|
|
18
20
|
let maxScore = 0;
|
|
19
21
|
let minBin = 0;
|
|
20
22
|
let maxBin = 0;
|
|
21
|
-
|
|
23
|
+
checkStopToken(stopToken);
|
|
22
24
|
for (const { bin1, bin2, counts } of features) {
|
|
23
25
|
maxScore = Math.max(counts, maxScore);
|
|
24
26
|
minBin = Math.min(Math.min(bin1, bin2), minBin);
|
|
25
27
|
maxBin = Math.max(Math.max(bin1, bin2), maxBin);
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
checkStopToken(stopToken);
|
|
28
30
|
const colorSchemes = {
|
|
29
31
|
juicebox: ['rgba(0,0,0,0)', 'red'],
|
|
30
32
|
fall: interpolateRgbBasis([
|
|
@@ -43,7 +45,6 @@ export async function makeImageData(ctx, props) {
|
|
|
43
45
|
viridis: interpolateViridis,
|
|
44
46
|
};
|
|
45
47
|
const m = useLogScale ? maxScore : maxScore / 20;
|
|
46
|
-
// @ts-expect-error
|
|
47
48
|
const x1 = colorSchemes[colorScheme] || colorSchemes.juicebox;
|
|
48
49
|
const scale = useLogScale
|
|
49
50
|
? scaleSequentialLog(x1).domain([1, m])
|
|
@@ -54,7 +55,7 @@ export async function makeImageData(ctx, props) {
|
|
|
54
55
|
ctx.translate(-width, 0);
|
|
55
56
|
}
|
|
56
57
|
ctx.rotate(-Math.PI / 4);
|
|
57
|
-
let start =
|
|
58
|
+
let start = performance.now();
|
|
58
59
|
for (const { bin1, bin2, counts } of features) {
|
|
59
60
|
ctx.fillStyle = readConfObject(config, 'color', {
|
|
60
61
|
count: counts,
|
|
@@ -64,9 +65,9 @@ export async function makeImageData(ctx, props) {
|
|
|
64
65
|
useLogScale,
|
|
65
66
|
});
|
|
66
67
|
ctx.fillRect((bin1 - offset) * w, (bin2 - offset) * w, w, w);
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
start =
|
|
68
|
+
if (performance.now() - start > 400) {
|
|
69
|
+
checkStopToken(stopToken);
|
|
70
|
+
start = performance.now();
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
ctx.restore();
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// vendored from
|
|
3
|
-
// https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/viridis.js,
|
|
4
|
-
// license reproduced below
|
|
5
|
-
//
|
|
6
|
-
// Copyright 2010-2024 Mike Bostock
|
|
7
|
-
// Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
8
|
-
// with or without fee is hereby granted, provided that the above copyright notice
|
|
9
|
-
// and this permission notice appear in all copies.
|
|
10
|
-
//
|
|
11
|
-
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
-
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
13
|
-
// FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
-
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
15
|
-
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
16
|
-
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
17
|
-
// THIS SOFTWARE.
|
|
18
1
|
function colors(specifier) {
|
|
19
2
|
const n = (specifier.length / 6) | 0;
|
|
20
3
|
const colors = new Array(n);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
declare const configSchema: (pluginManager: PluginManager) => import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
3
|
name: {
|
|
4
4
|
description: string;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
2
|
import { createBaseTrackConfig } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
-
|
|
4
|
-
* #config HicTrack
|
|
5
|
-
* #category track
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
function x() { }
|
|
8
4
|
const configSchema = (pluginManager) => ConfigurationSchema('HicTrack', {}, {
|
|
9
|
-
/**
|
|
10
|
-
* #baseConfiguration
|
|
11
|
-
*/
|
|
12
5
|
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
13
6
|
});
|
|
14
7
|
export default configSchema;
|
package/esm/HicTrack/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function HicTrackF(pluginManager: PluginManager): void;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type { Instance } from 'mobx-state-tree';
|
|
3
3
|
declare const HicTrackConfigFactory: (pluginManager: PluginManager) => import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
4
|
-
/**
|
|
5
|
-
* #slot
|
|
6
|
-
*/
|
|
7
4
|
renderer: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
8
5
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
9
6
|
maxFeatureScreenDensity: {
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
2
|
import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
-
|
|
4
|
-
* #config LinearHicDisplay
|
|
5
|
-
* #category display
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
function x() { }
|
|
8
4
|
const HicTrackConfigFactory = (pluginManager) => {
|
|
9
5
|
return ConfigurationSchema('LinearHicDisplay', {
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
6
|
renderer: pluginManager.getRendererType('HicRenderer').configSchema,
|
|
14
7
|
}, {
|
|
15
|
-
/**
|
|
16
|
-
* #baseConfiguration
|
|
17
|
-
*/
|
|
18
8
|
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
19
9
|
explicitlyTyped: true,
|
|
20
10
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LinearHicDisplayF(pluginManager: PluginManager): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
1
|
+
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
2
2
|
export default function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
3
3
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
4
4
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -11,25 +11,12 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
11
11
|
} & {
|
|
12
12
|
blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
13
13
|
key: import("mobx-state-tree").ISimpleType<string>;
|
|
14
|
-
region: import("mobx-state-tree").
|
|
15
|
-
refName: import("mobx-state-tree" /**
|
|
16
|
-
* #property
|
|
17
|
-
*/).ISimpleType<string>;
|
|
18
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
19
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
20
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
21
|
-
} & {
|
|
22
|
-
assemblyName: import("mobx-state-tree" /**
|
|
23
|
-
* #property
|
|
24
|
-
*/).ISimpleType<string>;
|
|
25
|
-
}, {
|
|
26
|
-
setRefName(newRefName: string): void;
|
|
27
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
14
|
+
region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
|
|
28
15
|
reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
29
16
|
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
30
17
|
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
31
18
|
}, {
|
|
32
|
-
|
|
19
|
+
stopToken: string | undefined;
|
|
33
20
|
filled: boolean;
|
|
34
21
|
reactElement: React.ReactElement | undefined;
|
|
35
22
|
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
@@ -44,30 +31,18 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
44
31
|
reload: () => void;
|
|
45
32
|
message: React.ReactNode;
|
|
46
33
|
filled?: boolean;
|
|
47
|
-
status
|
|
48
|
-
/**
|
|
49
|
-
* #getter
|
|
50
|
-
*/
|
|
51
|
-
? /**
|
|
52
|
-
* #getter
|
|
53
|
-
*/: string;
|
|
34
|
+
status?: string;
|
|
54
35
|
reactElement?: React.ReactElement;
|
|
55
36
|
};
|
|
56
|
-
}) => import("react").JSX.Element | undefined;
|
|
37
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
57
38
|
renderProps: any;
|
|
58
39
|
} & {
|
|
59
40
|
doReload(): void;
|
|
60
41
|
afterAttach(): void;
|
|
61
42
|
setStatus(message: string): void;
|
|
62
|
-
setLoading(
|
|
43
|
+
setLoading(newStopToken: string): void;
|
|
63
44
|
setMessage(messageText: string): void;
|
|
64
|
-
setRendered(props:
|
|
65
|
-
reactElement: React.ReactElement;
|
|
66
|
-
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
67
|
-
layout: any;
|
|
68
|
-
maxHeightReached: boolean;
|
|
69
|
-
renderProps: any;
|
|
70
|
-
} | undefined): void;
|
|
45
|
+
setRendered(props: import("@jbrowse/plugin-linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
|
|
71
46
|
setError(error: unknown): void;
|
|
72
47
|
reload(): void;
|
|
73
48
|
beforeDestroy(): void;
|
|
@@ -121,9 +96,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
121
96
|
rendererTypeName: string;
|
|
122
97
|
error: unknown;
|
|
123
98
|
message: string | undefined;
|
|
124
|
-
} & import("mobx-state-tree"
|
|
125
|
-
* #property
|
|
126
|
-
*/).IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
99
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
127
100
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
128
101
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
129
102
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -131,9 +104,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
131
104
|
rendererTypeName: string;
|
|
132
105
|
error: unknown;
|
|
133
106
|
message: string | undefined;
|
|
134
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree"
|
|
135
|
-
* #method
|
|
136
|
-
*/)._NotCustomized>>;
|
|
107
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
137
108
|
onHorizontalScroll?: () => void;
|
|
138
109
|
blockState?: Record<string, any>;
|
|
139
110
|
}>;
|
|
@@ -200,14 +171,15 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
200
171
|
readonly regionTooLarge: boolean;
|
|
201
172
|
readonly regionTooLargeReason: string;
|
|
202
173
|
} & {
|
|
174
|
+
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
203
175
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
204
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
176
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
205
177
|
} & {
|
|
206
178
|
featureIdUnderMouse: undefined | string;
|
|
207
179
|
contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
|
|
208
180
|
} & {
|
|
209
|
-
readonly DisplayMessageComponent:
|
|
210
|
-
readonly blockType: "
|
|
181
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
182
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
211
183
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
212
184
|
} & {
|
|
213
185
|
readonly renderDelay: number;
|
|
@@ -234,51 +206,21 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
234
206
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
235
207
|
renderProps(): any;
|
|
236
208
|
} & {
|
|
237
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
209
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
238
210
|
afterAttach(): void;
|
|
239
211
|
} & {
|
|
240
|
-
/**
|
|
241
|
-
* #volatile
|
|
242
|
-
*/
|
|
243
212
|
availableNormalizations: string[] | undefined;
|
|
244
213
|
} & {
|
|
245
|
-
/**
|
|
246
|
-
* #getter
|
|
247
|
-
*/
|
|
248
214
|
readonly blockType: string;
|
|
249
|
-
/**
|
|
250
|
-
* #getter
|
|
251
|
-
*/
|
|
252
215
|
readonly rendererTypeName: string;
|
|
253
|
-
/**
|
|
254
|
-
* #method
|
|
255
|
-
*/
|
|
256
216
|
renderProps(): any;
|
|
257
217
|
} & {
|
|
258
|
-
/**
|
|
259
|
-
* #action
|
|
260
|
-
*/
|
|
261
218
|
setResolution(n: number): void;
|
|
262
|
-
/**
|
|
263
|
-
* #action
|
|
264
|
-
*/
|
|
265
219
|
setUseLogScale(f: boolean): void;
|
|
266
|
-
/**
|
|
267
|
-
* #action
|
|
268
|
-
*/
|
|
269
220
|
setColorScheme(f?: string): void;
|
|
270
|
-
/**
|
|
271
|
-
* #action
|
|
272
|
-
*/
|
|
273
221
|
setActiveNormalization(f: string): void;
|
|
274
|
-
/**
|
|
275
|
-
* #action
|
|
276
|
-
*/
|
|
277
222
|
setAvailableNormalizations(f: string[]): void;
|
|
278
223
|
} & {
|
|
279
|
-
/**
|
|
280
|
-
* #getter
|
|
281
|
-
*/
|
|
282
224
|
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 | {
|
|
283
225
|
label: string;
|
|
284
226
|
type: string;
|
|
@@ -322,21 +264,12 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
322
264
|
} & {
|
|
323
265
|
blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
324
266
|
key: import("mobx-state-tree").ISimpleType<string>;
|
|
325
|
-
region: import("mobx-state-tree").
|
|
326
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
327
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
328
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
329
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
330
|
-
} & {
|
|
331
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
332
|
-
}, {
|
|
333
|
-
setRefName(newRefName: string): void;
|
|
334
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
267
|
+
region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
|
|
335
268
|
reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
336
269
|
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
337
270
|
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
338
271
|
}, {
|
|
339
|
-
|
|
272
|
+
stopToken: string | undefined;
|
|
340
273
|
filled: boolean;
|
|
341
274
|
reactElement: React.ReactElement | undefined;
|
|
342
275
|
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
@@ -351,30 +284,18 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
351
284
|
reload: () => void;
|
|
352
285
|
message: React.ReactNode;
|
|
353
286
|
filled?: boolean;
|
|
354
|
-
status
|
|
355
|
-
/**
|
|
356
|
-
* #getter
|
|
357
|
-
*/
|
|
358
|
-
? /**
|
|
359
|
-
* #getter
|
|
360
|
-
*/: string;
|
|
287
|
+
status?: string;
|
|
361
288
|
reactElement?: React.ReactElement;
|
|
362
289
|
};
|
|
363
|
-
}) => import("react").JSX.Element | undefined;
|
|
290
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
364
291
|
renderProps: any;
|
|
365
292
|
} & {
|
|
366
293
|
doReload(): void;
|
|
367
294
|
afterAttach(): void;
|
|
368
295
|
setStatus(message: string): void;
|
|
369
|
-
setLoading(
|
|
296
|
+
setLoading(newStopToken: string): void;
|
|
370
297
|
setMessage(messageText: string): void;
|
|
371
|
-
setRendered(props:
|
|
372
|
-
reactElement: React.ReactElement;
|
|
373
|
-
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
374
|
-
layout: any;
|
|
375
|
-
maxHeightReached: boolean;
|
|
376
|
-
renderProps: any;
|
|
377
|
-
} | undefined): void;
|
|
298
|
+
setRendered(props: import("@jbrowse/plugin-linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
|
|
378
299
|
setError(error: unknown): void;
|
|
379
300
|
reload(): void;
|
|
380
301
|
beforeDestroy(): void;
|
|
@@ -411,8 +332,8 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
411
332
|
type: string;
|
|
412
333
|
id: string;
|
|
413
334
|
configuration: import("mobx-state-tree").ModelSnapshotType<Record<string, any>>;
|
|
414
|
-
heightPreConfig: number | undefined;
|
|
415
335
|
rpcDriverName: string | undefined;
|
|
336
|
+
heightPreConfig: number | undefined;
|
|
416
337
|
userBpPerPxLimit: number | undefined;
|
|
417
338
|
userByteSizeLimit: number | undefined;
|
|
418
339
|
} & import("mobx-state-tree")._NotCustomized>;
|
|
@@ -1,70 +1,34 @@
|
|
|
1
1
|
import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
|
|
2
|
+
import { getContainingTrack, getSession } from '@jbrowse/core/util';
|
|
2
3
|
import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
-
import { types, getEnv, addDisposer } from 'mobx-state-tree';
|
|
4
4
|
import { autorun } from 'mobx';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
* #stateModel LinearHicDisplay
|
|
8
|
-
* #category display
|
|
9
|
-
* extends `BaseLinearDisplay`
|
|
10
|
-
*/
|
|
11
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { addDisposer, getEnv, types } from 'mobx-state-tree';
|
|
6
|
+
function x() { }
|
|
12
7
|
export default function stateModelFactory(configSchema) {
|
|
13
8
|
return types
|
|
14
9
|
.compose('LinearHicDisplay', BaseLinearDisplay, types.model({
|
|
15
|
-
/**
|
|
16
|
-
* #property
|
|
17
|
-
*/
|
|
18
10
|
type: types.literal('LinearHicDisplay'),
|
|
19
|
-
/**
|
|
20
|
-
* #property
|
|
21
|
-
*/
|
|
22
11
|
configuration: ConfigurationReference(configSchema),
|
|
23
|
-
/**
|
|
24
|
-
* #property
|
|
25
|
-
*/
|
|
26
12
|
resolution: types.optional(types.number, 1),
|
|
27
|
-
/**
|
|
28
|
-
* #property
|
|
29
|
-
*/
|
|
30
13
|
useLogScale: false,
|
|
31
|
-
/**
|
|
32
|
-
* #property
|
|
33
|
-
*/
|
|
34
14
|
colorScheme: types.maybe(types.string),
|
|
35
|
-
/**
|
|
36
|
-
* #property
|
|
37
|
-
*/
|
|
38
15
|
activeNormalization: 'KR',
|
|
39
16
|
}))
|
|
40
17
|
.volatile(() => ({
|
|
41
|
-
/**
|
|
42
|
-
* #volatile
|
|
43
|
-
*/
|
|
44
18
|
availableNormalizations: undefined,
|
|
45
19
|
}))
|
|
46
20
|
.views(self => {
|
|
47
21
|
const { renderProps: superRenderProps } = self;
|
|
48
22
|
return {
|
|
49
|
-
/**
|
|
50
|
-
* #getter
|
|
51
|
-
*/
|
|
52
23
|
get blockType() {
|
|
53
24
|
return 'dynamicBlocks';
|
|
54
25
|
},
|
|
55
|
-
/**
|
|
56
|
-
* #getter
|
|
57
|
-
*/
|
|
58
26
|
get rendererTypeName() {
|
|
59
27
|
return 'HicRenderer';
|
|
60
28
|
},
|
|
61
|
-
/**
|
|
62
|
-
* #method
|
|
63
|
-
*/
|
|
64
29
|
renderProps() {
|
|
65
30
|
const config = self.rendererType.configSchema.create({
|
|
66
31
|
...getConf(self, 'renderer'),
|
|
67
|
-
// add specific jexl color callback when using pre-defined color schemes
|
|
68
32
|
...(self.colorScheme
|
|
69
33
|
? { color: 'jexl:interpolate(count,scale)' }
|
|
70
34
|
: {}),
|
|
@@ -83,33 +47,18 @@ export default function stateModelFactory(configSchema) {
|
|
|
83
47
|
};
|
|
84
48
|
})
|
|
85
49
|
.actions(self => ({
|
|
86
|
-
/**
|
|
87
|
-
* #action
|
|
88
|
-
*/
|
|
89
50
|
setResolution(n) {
|
|
90
51
|
self.resolution = n;
|
|
91
52
|
},
|
|
92
|
-
/**
|
|
93
|
-
* #action
|
|
94
|
-
*/
|
|
95
53
|
setUseLogScale(f) {
|
|
96
54
|
self.useLogScale = f;
|
|
97
55
|
},
|
|
98
|
-
/**
|
|
99
|
-
* #action
|
|
100
|
-
*/
|
|
101
56
|
setColorScheme(f) {
|
|
102
57
|
self.colorScheme = f;
|
|
103
58
|
},
|
|
104
|
-
/**
|
|
105
|
-
* #action
|
|
106
|
-
*/
|
|
107
59
|
setActiveNormalization(f) {
|
|
108
60
|
self.activeNormalization = f;
|
|
109
61
|
},
|
|
110
|
-
/**
|
|
111
|
-
* #action
|
|
112
|
-
*/
|
|
113
62
|
setAvailableNormalizations(f) {
|
|
114
63
|
self.availableNormalizations = f;
|
|
115
64
|
},
|
|
@@ -117,9 +66,6 @@ export default function stateModelFactory(configSchema) {
|
|
|
117
66
|
.views(self => {
|
|
118
67
|
const { trackMenuItems: superTrackMenuItems } = self;
|
|
119
68
|
return {
|
|
120
|
-
/**
|
|
121
|
-
* #getter
|
|
122
|
-
*/
|
|
123
69
|
trackMenuItems() {
|
|
124
70
|
return [
|
|
125
71
|
...superTrackMenuItems(),
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class HicPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
2
|
import { colord } from '@jbrowse/core/util/colord';
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import GuessAdapterF from './GuessAdapter';
|
|
4
|
+
import HicAdapterF from './HicAdapter';
|
|
5
5
|
import HicRendererF from './HicRenderer';
|
|
6
6
|
import HicTrackF from './HicTrack';
|
|
7
7
|
import LinearHicDisplayF from './LinearHicDisplay';
|
|
8
|
-
import HicAdapterF from './HicAdapter';
|
|
9
8
|
export default class HicPlugin extends Plugin {
|
|
10
9
|
constructor() {
|
|
11
10
|
super(...arguments);
|
|
@@ -16,31 +15,7 @@ export default class HicPlugin extends Plugin {
|
|
|
16
15
|
HicRendererF(pluginManager);
|
|
17
16
|
HicTrackF(pluginManager);
|
|
18
17
|
LinearHicDisplayF(pluginManager);
|
|
19
|
-
pluginManager
|
|
20
|
-
return (file, index, adapterHint) => {
|
|
21
|
-
const regexGuess = /\.hic/i;
|
|
22
|
-
const adapterName = 'HicAdapter';
|
|
23
|
-
const fileName = getFileName(file);
|
|
24
|
-
const obj = {
|
|
25
|
-
type: adapterName,
|
|
26
|
-
hicLocation: file,
|
|
27
|
-
};
|
|
28
|
-
if (regexGuess.test(fileName) && !adapterHint) {
|
|
29
|
-
return obj;
|
|
30
|
-
}
|
|
31
|
-
else if (adapterHint === adapterName) {
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return adapterGuesser(file, index, adapterHint);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', (trackTypeGuesser) => {
|
|
40
|
-
return (adapterName) => adapterName === 'HicAdapter'
|
|
41
|
-
? 'HicTrack'
|
|
42
|
-
: trackTypeGuesser(adapterName);
|
|
43
|
-
});
|
|
18
|
+
GuessAdapterF(pluginManager);
|
|
44
19
|
}
|
|
45
20
|
configure(pluginManager) {
|
|
46
21
|
const { jexl } = pluginManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-hic",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "JBrowse 2 hic adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
|
|
59
59
|
}
|