@jbrowse/plugin-arc 3.6.5 → 4.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/esm/ArcRenderer/ArcRendering.d.ts +1 -1
- package/esm/ArcRenderer/ArcRendering.js +31 -54
- package/esm/ArcRenderer/configSchema.d.ts +3 -3
- package/esm/ArcRenderer/configSchema.js +1 -1
- package/esm/ArcRenderer/index.js +4 -4
- package/esm/ArcTooltip.d.ts +1 -1
- package/esm/ArcTooltip.js +1 -1
- package/esm/LinearArcDisplay/configSchema.d.ts +4 -4
- package/esm/LinearArcDisplay/configSchema.js +1 -1
- package/esm/LinearArcDisplay/index.js +2 -2
- package/esm/LinearArcDisplay/model.d.ts +963 -94
- package/esm/LinearArcDisplay/model.js +4 -7
- package/esm/LinearPairedArcDisplay/afterAttach.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/afterAttach.js +2 -2
- package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/Arcs.js +9 -11
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.js +7 -38
- package/esm/LinearPairedArcDisplay/components/ErrorActions.d.ts +4 -0
- package/esm/LinearPairedArcDisplay/components/ErrorActions.js +20 -0
- package/esm/LinearPairedArcDisplay/components/ErrorMessage.d.ts +5 -0
- package/esm/LinearPairedArcDisplay/components/ErrorMessage.js +9 -0
- package/esm/LinearPairedArcDisplay/components/LoadingBar.d.ts +5 -0
- package/esm/LinearPairedArcDisplay/components/LoadingBar.js +23 -0
- package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/ReactComponent.js +3 -3
- package/esm/LinearPairedArcDisplay/components/util.js +6 -8
- package/esm/LinearPairedArcDisplay/configSchema.d.ts +3 -3
- package/esm/LinearPairedArcDisplay/fetchChains.d.ts +2 -2
- package/esm/LinearPairedArcDisplay/fetchChains.js +3 -1
- package/esm/LinearPairedArcDisplay/index.js +5 -4
- package/esm/LinearPairedArcDisplay/model.d.ts +143 -31
- package/esm/LinearPairedArcDisplay/model.js +4 -5
- package/esm/LinearPairedArcDisplay/renderSvg.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/renderSvg.js +1 -1
- package/esm/LinearPairedArcDisplay/util.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/util.js +3 -5
- package/esm/index.js +9 -12
- package/package.json +27 -31
- package/dist/ArcRenderer/ArcRenderer.d.ts +0 -3
- package/dist/ArcRenderer/ArcRenderer.js +0 -9
- package/dist/ArcRenderer/ArcRendering.d.ts +0 -15
- package/dist/ArcRenderer/ArcRendering.js +0 -120
- package/dist/ArcRenderer/configSchema.d.ts +0 -39
- package/dist/ArcRenderer/configSchema.js +0 -44
- package/dist/ArcRenderer/index.d.ts +0 -2
- package/dist/ArcRenderer/index.js +0 -17
- package/dist/ArcTooltip.d.ts +0 -4
- package/dist/ArcTooltip.js +0 -17
- package/dist/LinearArcDisplay/configSchema.d.ts +0 -31
- package/dist/LinearArcDisplay/configSchema.js +0 -14
- package/dist/LinearArcDisplay/index.d.ts +0 -2
- package/dist/LinearArcDisplay/index.js +0 -21
- package/dist/LinearArcDisplay/model.d.ts +0 -327
- package/dist/LinearArcDisplay/model.js +0 -91
- package/dist/LinearPairedArcDisplay/afterAttach.d.ts +0 -2
- package/dist/LinearPairedArcDisplay/afterAttach.js +0 -10
- package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +0 -6
- package/dist/LinearPairedArcDisplay/components/Arcs.js +0 -106
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +0 -6
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.js +0 -83
- package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +0 -6
- package/dist/LinearPairedArcDisplay/components/ReactComponent.js +0 -13
- package/dist/LinearPairedArcDisplay/components/util.d.ts +0 -17
- package/dist/LinearPairedArcDisplay/components/util.js +0 -66
- package/dist/LinearPairedArcDisplay/configSchema.d.ts +0 -35
- package/dist/LinearPairedArcDisplay/configSchema.js +0 -18
- package/dist/LinearPairedArcDisplay/fetchChains.d.ts +0 -27
- package/dist/LinearPairedArcDisplay/fetchChains.js +0 -21
- package/dist/LinearPairedArcDisplay/index.d.ts +0 -2
- package/dist/LinearPairedArcDisplay/index.js +0 -54
- package/dist/LinearPairedArcDisplay/model.d.ts +0 -129
- package/dist/LinearPairedArcDisplay/model.js +0 -105
- package/dist/LinearPairedArcDisplay/renderSvg.d.ts +0 -4
- package/dist/LinearPairedArcDisplay/renderSvg.js +0 -17
- package/dist/LinearPairedArcDisplay/util.d.ts +0 -27
- package/dist/LinearPairedArcDisplay/util.js +0 -119
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -43
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
2
|
-
export declare function makeFeaturePair(feature: Feature, alt?: string): {
|
|
3
|
-
k1: {
|
|
4
|
-
refName: string;
|
|
5
|
-
start: number;
|
|
6
|
-
end: number;
|
|
7
|
-
strand: any;
|
|
8
|
-
mateDirection: number;
|
|
9
|
-
};
|
|
10
|
-
k2: {
|
|
11
|
-
refName: string;
|
|
12
|
-
start: number;
|
|
13
|
-
end: number;
|
|
14
|
-
mateDirection?: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare function makeSummary(feature: Feature, alt?: string): string;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeFeaturePair = makeFeaturePair;
|
|
4
|
-
exports.makeSummary = makeSummary;
|
|
5
|
-
const vcf_1 = require("@gmod/vcf");
|
|
6
|
-
const util_1 = require("@jbrowse/core/util");
|
|
7
|
-
function makeFeaturePair(feature, alt) {
|
|
8
|
-
var _a, _b, _c, _d;
|
|
9
|
-
const bnd = alt ? (0, vcf_1.parseBreakend)(alt) : undefined;
|
|
10
|
-
const start = feature.get('start');
|
|
11
|
-
let end = feature.get('end');
|
|
12
|
-
const strand = feature.get('strand');
|
|
13
|
-
const mate = feature.get('mate');
|
|
14
|
-
const refName = feature.get('refName');
|
|
15
|
-
let mateRefName;
|
|
16
|
-
let mateEnd = 0;
|
|
17
|
-
let mateStart = 0;
|
|
18
|
-
let joinDirection = 0;
|
|
19
|
-
let mateDirection = 0;
|
|
20
|
-
const symbolicAlleles = ['<TRA', '<DEL', '<INV', '<INS', '<DUP', '<CNV'];
|
|
21
|
-
if (symbolicAlleles.some(a => alt === null || alt === void 0 ? void 0 : alt.startsWith(a))) {
|
|
22
|
-
const info = feature.get('INFO');
|
|
23
|
-
const e = (_b = (_a = info === null || info === void 0 ? void 0 : info.END) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : end;
|
|
24
|
-
mateRefName = (_d = (_c = info === null || info === void 0 ? void 0 : info.CHR2) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : refName;
|
|
25
|
-
mateEnd = e;
|
|
26
|
-
mateStart = e - 1;
|
|
27
|
-
end = start + 1;
|
|
28
|
-
}
|
|
29
|
-
else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
|
|
30
|
-
const matePosition = bnd.MatePosition.split(':');
|
|
31
|
-
mateDirection = bnd.MateDirection === 'left' ? 1 : -1;
|
|
32
|
-
joinDirection = bnd.Join === 'left' ? -1 : 1;
|
|
33
|
-
mateEnd = +matePosition[1];
|
|
34
|
-
mateStart = +matePosition[1] - 1;
|
|
35
|
-
mateRefName = matePosition[0];
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
k1: {
|
|
39
|
-
refName,
|
|
40
|
-
start,
|
|
41
|
-
end,
|
|
42
|
-
strand,
|
|
43
|
-
mateDirection,
|
|
44
|
-
},
|
|
45
|
-
k2: mate !== null && mate !== void 0 ? mate : {
|
|
46
|
-
refName: mateRefName || 'unknown',
|
|
47
|
-
end: mateEnd,
|
|
48
|
-
start: mateStart,
|
|
49
|
-
mateDirection: joinDirection,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function makeSummary(feature, alt) {
|
|
54
|
-
var _a;
|
|
55
|
-
const { k1, k2 } = makeFeaturePair(feature, alt);
|
|
56
|
-
return [
|
|
57
|
-
feature.get('name'),
|
|
58
|
-
feature.get('id'),
|
|
59
|
-
(0, util_1.assembleLocString)(k1),
|
|
60
|
-
(0, util_1.assembleLocString)(k2),
|
|
61
|
-
(_a = feature.get('INFO')) === null || _a === void 0 ? void 0 : _a.SVTYPE,
|
|
62
|
-
alt,
|
|
63
|
-
]
|
|
64
|
-
.filter(f => !!f)
|
|
65
|
-
.join('<br/>');
|
|
66
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare function configSchemaFactory(): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
color: {
|
|
3
|
-
type: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultValue: string;
|
|
6
|
-
contextVariable: string[];
|
|
7
|
-
};
|
|
8
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
9
|
-
maxFeatureScreenDensity: {
|
|
10
|
-
type: string;
|
|
11
|
-
description: string;
|
|
12
|
-
defaultValue: number;
|
|
13
|
-
};
|
|
14
|
-
fetchSizeLimit: {
|
|
15
|
-
type: string;
|
|
16
|
-
defaultValue: number;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
height: {
|
|
20
|
-
type: string;
|
|
21
|
-
defaultValue: number;
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
|
-
mouseover: {
|
|
25
|
-
type: string;
|
|
26
|
-
description: string;
|
|
27
|
-
defaultValue: string;
|
|
28
|
-
contextVariable: string[];
|
|
29
|
-
};
|
|
30
|
-
jexlFilters: {
|
|
31
|
-
type: string;
|
|
32
|
-
description: string;
|
|
33
|
-
defaultValue: never[];
|
|
34
|
-
};
|
|
35
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configSchemaFactory = configSchemaFactory;
|
|
4
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
-
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
6
|
-
function configSchemaFactory() {
|
|
7
|
-
return (0, configuration_1.ConfigurationSchema)('LinearPairedArcDisplay', {
|
|
8
|
-
color: {
|
|
9
|
-
type: 'color',
|
|
10
|
-
description: 'the color of the arcs',
|
|
11
|
-
defaultValue: 'jexl:defaultPairedArcColor(feature,alt)',
|
|
12
|
-
contextVariable: ['feature', 'alt'],
|
|
13
|
-
},
|
|
14
|
-
}, {
|
|
15
|
-
baseConfiguration: plugin_linear_genome_view_1.baseLinearDisplayConfigSchema,
|
|
16
|
-
explicitlyTyped: true,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { LinearArcDisplayModel } from './model';
|
|
2
|
-
export interface ReducedFeature {
|
|
3
|
-
name: string;
|
|
4
|
-
strand: number;
|
|
5
|
-
refName: string;
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
id: string;
|
|
9
|
-
flags: number;
|
|
10
|
-
tlen: number;
|
|
11
|
-
pair_orientation: string;
|
|
12
|
-
next_ref?: string;
|
|
13
|
-
next_pos?: number;
|
|
14
|
-
clipPos: number;
|
|
15
|
-
SA?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ChainStats {
|
|
18
|
-
max: number;
|
|
19
|
-
min: number;
|
|
20
|
-
upper: number;
|
|
21
|
-
lower: number;
|
|
22
|
-
}
|
|
23
|
-
export interface ChainData {
|
|
24
|
-
chains: ReducedFeature[][];
|
|
25
|
-
stats?: ChainStats;
|
|
26
|
-
}
|
|
27
|
-
export declare function fetchChains(self: LinearArcDisplayModel): Promise<void>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchChains = fetchChains;
|
|
4
|
-
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
6
|
-
async function fetchChains(self) {
|
|
7
|
-
const sessionId = (0, tracks_1.getRpcSessionId)(self);
|
|
8
|
-
const { rpcManager } = (0, util_1.getSession)(self);
|
|
9
|
-
const view = (0, util_1.getContainingView)(self);
|
|
10
|
-
if (!view.initialized || self.error || !self.statsReadyAndRegionNotTooLarge) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
self.setLoading(true);
|
|
14
|
-
const ret = (await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
15
|
-
sessionId,
|
|
16
|
-
regions: view.staticBlocks.contentBlocks,
|
|
17
|
-
adapterConfig: self.adapterConfig,
|
|
18
|
-
}));
|
|
19
|
-
self.setFeatures((0, util_1.dedupe)(ret, r => r.id()));
|
|
20
|
-
self.setLoading(false);
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.default = LinearPairedArcDisplayF;
|
|
37
|
-
const react_1 = require("react");
|
|
38
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
39
|
-
const configSchema_1 = require("./configSchema");
|
|
40
|
-
const model_1 = require("./model");
|
|
41
|
-
function LinearPairedArcDisplayF(pluginManager) {
|
|
42
|
-
pluginManager.addDisplayType(() => {
|
|
43
|
-
const configSchema = (0, configSchema_1.configSchemaFactory)();
|
|
44
|
-
return new pluggableElementTypes_1.DisplayType({
|
|
45
|
-
name: 'LinearPairedArcDisplay',
|
|
46
|
-
displayName: 'Arc display',
|
|
47
|
-
configSchema,
|
|
48
|
-
stateModel: (0, model_1.stateModelFactory)(configSchema),
|
|
49
|
-
trackType: 'VariantTrack',
|
|
50
|
-
viewType: 'LinearGenomeView',
|
|
51
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ReactComponent')))),
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
-
import type { Instance } from 'mobx-state-tree';
|
|
5
|
-
export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
6
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
7
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
8
|
-
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
9
|
-
} & {
|
|
10
|
-
heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
11
|
-
} & {
|
|
12
|
-
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
13
|
-
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
14
|
-
} & {
|
|
15
|
-
type: import("mobx-state-tree").ISimpleType<"LinearPairedArcDisplay">;
|
|
16
|
-
configuration: AnyConfigurationSchemaType;
|
|
17
|
-
displayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
18
|
-
}, {
|
|
19
|
-
rendererTypeName: string;
|
|
20
|
-
error: unknown;
|
|
21
|
-
message: string | undefined;
|
|
22
|
-
} & {
|
|
23
|
-
readonly RenderingComponent: React.FC<{
|
|
24
|
-
model: {
|
|
25
|
-
id: string;
|
|
26
|
-
type: string;
|
|
27
|
-
rpcDriverName: string | undefined;
|
|
28
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
29
|
-
rendererTypeName: string;
|
|
30
|
-
error: unknown;
|
|
31
|
-
message: string | undefined;
|
|
32
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
33
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
34
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
35
|
-
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
36
|
-
}, {
|
|
37
|
-
rendererTypeName: string;
|
|
38
|
-
error: unknown;
|
|
39
|
-
message: string | undefined;
|
|
40
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
41
|
-
onHorizontalScroll?: () => void;
|
|
42
|
-
blockState?: Record<string, any>;
|
|
43
|
-
}>;
|
|
44
|
-
readonly DisplayBlurb: React.FC<{
|
|
45
|
-
model: {
|
|
46
|
-
id: string;
|
|
47
|
-
type: string;
|
|
48
|
-
rpcDriverName: string | undefined;
|
|
49
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
50
|
-
rendererTypeName: string;
|
|
51
|
-
error: unknown;
|
|
52
|
-
message: string | undefined;
|
|
53
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
54
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
55
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
56
|
-
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
57
|
-
}, {
|
|
58
|
-
rendererTypeName: string;
|
|
59
|
-
error: unknown;
|
|
60
|
-
message: string | undefined;
|
|
61
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
62
|
-
}> | null;
|
|
63
|
-
readonly adapterConfig: any;
|
|
64
|
-
readonly parentTrack: any;
|
|
65
|
-
renderProps(): any;
|
|
66
|
-
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
67
|
-
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
68
|
-
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
69
|
-
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
70
|
-
regionCannotBeRendered(): null;
|
|
71
|
-
} & {
|
|
72
|
-
setMessage(arg?: string): void;
|
|
73
|
-
setError(error?: unknown): void;
|
|
74
|
-
setRpcDriverName(rpcDriverName: string): void;
|
|
75
|
-
reload(): void;
|
|
76
|
-
} & {
|
|
77
|
-
scrollTop: number;
|
|
78
|
-
} & {
|
|
79
|
-
readonly height: number;
|
|
80
|
-
} & {
|
|
81
|
-
setScrollTop(scrollTop: number): void;
|
|
82
|
-
setHeight(displayHeight: number): number;
|
|
83
|
-
resizeHeight(distance: number): number;
|
|
84
|
-
} & {
|
|
85
|
-
featureDensityStatsP: undefined | Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
86
|
-
featureDensityStats: undefined | import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats;
|
|
87
|
-
currStatsBpPerPx: number;
|
|
88
|
-
} & {
|
|
89
|
-
readonly currentBytesRequested: number;
|
|
90
|
-
readonly currentFeatureScreenDensity: number;
|
|
91
|
-
readonly maxFeatureScreenDensity: any;
|
|
92
|
-
readonly featureDensityStatsReady: boolean;
|
|
93
|
-
readonly maxAllowableBytes: number;
|
|
94
|
-
} & {
|
|
95
|
-
afterAttach(): void;
|
|
96
|
-
} & {
|
|
97
|
-
setCurrStatsBpPerPx(n: number): void;
|
|
98
|
-
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats): void;
|
|
99
|
-
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
100
|
-
setFeatureDensityStatsP(arg: any): void;
|
|
101
|
-
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats): void;
|
|
102
|
-
clearFeatureDensityStats(): void;
|
|
103
|
-
} & {
|
|
104
|
-
readonly regionTooLarge: boolean;
|
|
105
|
-
readonly regionTooLargeReason: string;
|
|
106
|
-
} & {
|
|
107
|
-
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
108
|
-
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
109
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
110
|
-
} & {
|
|
111
|
-
lastDrawnOffsetPx: number;
|
|
112
|
-
features: Feature[] | undefined;
|
|
113
|
-
loading: boolean;
|
|
114
|
-
drawn: boolean;
|
|
115
|
-
} & {
|
|
116
|
-
readonly displayModeSetting: any;
|
|
117
|
-
} & {
|
|
118
|
-
selectFeature(feature: Feature): void;
|
|
119
|
-
setLoading(flag: boolean): void;
|
|
120
|
-
setFeatures(f: Feature[]): void;
|
|
121
|
-
setDisplayMode(flag: string): void;
|
|
122
|
-
} & {
|
|
123
|
-
afterAttach(): void;
|
|
124
|
-
renderSvg(opts: {
|
|
125
|
-
rasterizeLayers?: boolean;
|
|
126
|
-
}): Promise<React.ReactNode>;
|
|
127
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
128
|
-
export type LinearArcDisplayStateModel = ReturnType<typeof stateModelFactory>;
|
|
129
|
-
export type LinearArcDisplayModel = Instance<LinearArcDisplayStateModel>;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.stateModelFactory = stateModelFactory;
|
|
37
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
38
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
39
|
-
const util_1 = require("@jbrowse/core/util");
|
|
40
|
-
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
41
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
|
-
function stateModelFactory(configSchema) {
|
|
43
|
-
return mobx_state_tree_1.types
|
|
44
|
-
.compose('LinearPairedArcDisplay', pluggableElementTypes_1.BaseDisplay, (0, plugin_linear_genome_view_1.TrackHeightMixin)(), (0, plugin_linear_genome_view_1.FeatureDensityMixin)(), mobx_state_tree_1.types.model({
|
|
45
|
-
type: mobx_state_tree_1.types.literal('LinearPairedArcDisplay'),
|
|
46
|
-
configuration: (0, configuration_1.ConfigurationReference)(configSchema),
|
|
47
|
-
displayMode: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
48
|
-
}))
|
|
49
|
-
.volatile(() => ({
|
|
50
|
-
lastDrawnOffsetPx: 0,
|
|
51
|
-
features: undefined,
|
|
52
|
-
loading: false,
|
|
53
|
-
drawn: true,
|
|
54
|
-
}))
|
|
55
|
-
.views(self => ({
|
|
56
|
-
get displayModeSetting() {
|
|
57
|
-
var _a;
|
|
58
|
-
return (_a = self.displayMode) !== null && _a !== void 0 ? _a : (0, configuration_1.getConf)(self, ['renderer', 'displayMode']);
|
|
59
|
-
},
|
|
60
|
-
}))
|
|
61
|
-
.actions(self => ({
|
|
62
|
-
selectFeature(feature) {
|
|
63
|
-
const session = (0, util_1.getSession)(self);
|
|
64
|
-
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
65
|
-
const featureWidget = session.addWidget('VariantFeatureWidget', 'variantFeature', {
|
|
66
|
-
view: (0, util_1.getContainingView)(self),
|
|
67
|
-
track: (0, util_1.getContainingTrack)(self),
|
|
68
|
-
featureData: feature.toJSON(),
|
|
69
|
-
});
|
|
70
|
-
session.showWidget(featureWidget);
|
|
71
|
-
}
|
|
72
|
-
if ((0, util_1.isSelectionContainer)(session)) {
|
|
73
|
-
session.setSelection(feature);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
setLoading(flag) {
|
|
77
|
-
self.loading = flag;
|
|
78
|
-
},
|
|
79
|
-
setFeatures(f) {
|
|
80
|
-
self.features = f;
|
|
81
|
-
},
|
|
82
|
-
setDisplayMode(flag) {
|
|
83
|
-
self.displayMode = flag;
|
|
84
|
-
},
|
|
85
|
-
}))
|
|
86
|
-
.actions(self => ({
|
|
87
|
-
afterAttach() {
|
|
88
|
-
;
|
|
89
|
-
(async () => {
|
|
90
|
-
try {
|
|
91
|
-
const { doAfterAttach } = await Promise.resolve().then(() => __importStar(require('./afterAttach')));
|
|
92
|
-
doAfterAttach(self);
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
console.error(e);
|
|
96
|
-
self.setError(e);
|
|
97
|
-
}
|
|
98
|
-
})();
|
|
99
|
-
},
|
|
100
|
-
async renderSvg(opts) {
|
|
101
|
-
const { renderArcSvg } = await Promise.resolve().then(() => __importStar(require('./renderSvg')));
|
|
102
|
-
return renderArcSvg(self, opts);
|
|
103
|
-
},
|
|
104
|
-
}));
|
|
105
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.renderArcSvg = renderArcSvg;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const util_1 = require("@jbrowse/core/util");
|
|
9
|
-
const Arcs_1 = __importDefault(require("./components/Arcs"));
|
|
10
|
-
async function renderArcSvg(model, _opts) {
|
|
11
|
-
await (0, util_1.when)(() => !model.loading);
|
|
12
|
-
const view = (0, util_1.getContainingView)(model);
|
|
13
|
-
const width = view.dynamicBlocks.totalWidthPx;
|
|
14
|
-
const height = model.height;
|
|
15
|
-
const clipid = `arc-${model.id}`;
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipid, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: height }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${clipid})`, children: (0, jsx_runtime_1.jsx)(Arcs_1.default, { model: model, exportSVG: true }) })] }));
|
|
17
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import type { AugmentedRegion, Feature } from '@jbrowse/core/util';
|
|
3
|
-
import type { IAutorunOptions } from 'mobx';
|
|
4
|
-
import type { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
5
|
-
export declare function getTag(feature: Feature, tag: string): any;
|
|
6
|
-
export declare function getTagAlt(feature: Feature, tag: string, alt: string): any;
|
|
7
|
-
export declare const orientationTypes: {
|
|
8
|
-
fr: Record<string, string>;
|
|
9
|
-
rf: Record<string, string>;
|
|
10
|
-
ff: Record<string, string>;
|
|
11
|
-
};
|
|
12
|
-
export declare const pairMap: {
|
|
13
|
-
readonly LR: "color_pair_lr";
|
|
14
|
-
readonly LL: "color_pair_ll";
|
|
15
|
-
readonly RR: "color_pair_rr";
|
|
16
|
-
readonly RL: "color_pair_rl";
|
|
17
|
-
};
|
|
18
|
-
export declare function getColorWGBS(strand: number, base: string): "#f00" | "#00f" | "#888";
|
|
19
|
-
export declare function fetchSequence(region: AugmentedRegion, adapter: BaseFeatureDataAdapter): Promise<any>;
|
|
20
|
-
export declare function shouldFetchReferenceSequence(type?: string): type is "methylation";
|
|
21
|
-
export declare const modificationColors: Record<string, string>;
|
|
22
|
-
type DisplayModel = IAnyStateTreeNode & {
|
|
23
|
-
setError: (arg: unknown) => void;
|
|
24
|
-
};
|
|
25
|
-
export declare function createAutorun(self: DisplayModel, cb: () => Promise<void>, opts?: IAutorunOptions): void;
|
|
26
|
-
export declare function randomColor(): string;
|
|
27
|
-
export {};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modificationColors = exports.pairMap = exports.orientationTypes = void 0;
|
|
4
|
-
exports.getTag = getTag;
|
|
5
|
-
exports.getTagAlt = getTagAlt;
|
|
6
|
-
exports.getColorWGBS = getColorWGBS;
|
|
7
|
-
exports.fetchSequence = fetchSequence;
|
|
8
|
-
exports.shouldFetchReferenceSequence = shouldFetchReferenceSequence;
|
|
9
|
-
exports.createAutorun = createAutorun;
|
|
10
|
-
exports.randomColor = randomColor;
|
|
11
|
-
const mobx_1 = require("mobx");
|
|
12
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
13
|
-
const rxjs_1 = require("rxjs");
|
|
14
|
-
const operators_1 = require("rxjs/operators");
|
|
15
|
-
function getTag(feature, tag) {
|
|
16
|
-
return feature.get('tags')[tag];
|
|
17
|
-
}
|
|
18
|
-
function getTagAlt(feature, tag, alt) {
|
|
19
|
-
var _a;
|
|
20
|
-
return (_a = getTag(feature, tag)) !== null && _a !== void 0 ? _a : getTag(feature, alt);
|
|
21
|
-
}
|
|
22
|
-
exports.orientationTypes = {
|
|
23
|
-
fr: {
|
|
24
|
-
F1R2: 'LR',
|
|
25
|
-
F2R1: 'LR',
|
|
26
|
-
F1F2: 'LL',
|
|
27
|
-
F2F1: 'LL',
|
|
28
|
-
R1R2: 'RR',
|
|
29
|
-
R2R1: 'RR',
|
|
30
|
-
R1F2: 'RL',
|
|
31
|
-
R2F1: 'RL',
|
|
32
|
-
},
|
|
33
|
-
rf: {
|
|
34
|
-
R1F2: 'LR',
|
|
35
|
-
R2F1: 'LR',
|
|
36
|
-
R1R2: 'LL',
|
|
37
|
-
R2R1: 'LL',
|
|
38
|
-
F1F2: 'RR',
|
|
39
|
-
F2F1: 'RR',
|
|
40
|
-
F1R2: 'RL',
|
|
41
|
-
F2R1: 'RL',
|
|
42
|
-
},
|
|
43
|
-
ff: {
|
|
44
|
-
F2F1: 'LR',
|
|
45
|
-
R1R2: 'LR',
|
|
46
|
-
F2R1: 'LL',
|
|
47
|
-
R1F2: 'LL',
|
|
48
|
-
R2F1: 'RR',
|
|
49
|
-
F1R2: 'RR',
|
|
50
|
-
R2R1: 'RL',
|
|
51
|
-
F1F2: 'RL',
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
exports.pairMap = {
|
|
55
|
-
LR: 'color_pair_lr',
|
|
56
|
-
LL: 'color_pair_ll',
|
|
57
|
-
RR: 'color_pair_rr',
|
|
58
|
-
RL: 'color_pair_rl',
|
|
59
|
-
};
|
|
60
|
-
function getColorWGBS(strand, base) {
|
|
61
|
-
if (strand === 1) {
|
|
62
|
-
if (base === 'C') {
|
|
63
|
-
return '#f00';
|
|
64
|
-
}
|
|
65
|
-
if (base === 'T') {
|
|
66
|
-
return '#00f';
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else if (strand === -1) {
|
|
70
|
-
if (base === 'G') {
|
|
71
|
-
return '#f00';
|
|
72
|
-
}
|
|
73
|
-
if (base === 'A') {
|
|
74
|
-
return '#00f';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return '#888';
|
|
78
|
-
}
|
|
79
|
-
async function fetchSequence(region, adapter) {
|
|
80
|
-
var _a;
|
|
81
|
-
const { start, end, originalRefName, refName } = region;
|
|
82
|
-
const feats = await (0, rxjs_1.firstValueFrom)(adapter
|
|
83
|
-
.getFeatures({
|
|
84
|
-
...region,
|
|
85
|
-
refName: originalRefName || refName,
|
|
86
|
-
end: end + 1,
|
|
87
|
-
start: Math.max(0, start - 1),
|
|
88
|
-
})
|
|
89
|
-
.pipe((0, operators_1.toArray)()));
|
|
90
|
-
return (_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq');
|
|
91
|
-
}
|
|
92
|
-
function shouldFetchReferenceSequence(type) {
|
|
93
|
-
return type === 'methylation';
|
|
94
|
-
}
|
|
95
|
-
exports.modificationColors = {
|
|
96
|
-
m: 'rgb(255,0,0)',
|
|
97
|
-
h: 'rgb(11, 132, 165)',
|
|
98
|
-
o: 'rgb(111, 78, 129)',
|
|
99
|
-
f: 'rgb(246, 200, 95)',
|
|
100
|
-
c: 'rgb(157, 216, 102)',
|
|
101
|
-
g: 'rgb(255, 160, 86)',
|
|
102
|
-
e: 'rgb(141, 221, 208)',
|
|
103
|
-
b: 'rgb(202, 71, 47)',
|
|
104
|
-
};
|
|
105
|
-
function createAutorun(self, cb, opts) {
|
|
106
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(async () => {
|
|
107
|
-
try {
|
|
108
|
-
await cb();
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
112
|
-
self.setError(e);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}, opts));
|
|
116
|
-
}
|
|
117
|
-
function randomColor() {
|
|
118
|
-
return `hsl(${Math.random() * 200}, 50%, 50%)`;
|
|
119
|
-
}
|