@platforma-open/milaboratories.vj-usage.model 2.1.4 → 2.1.6
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/.turbo/turbo-build.log +13 -28
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-type-check.log +6 -0
- package/CHANGELOG.md +12 -0
- package/dist/bundle.js +8252 -6953
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +82 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -74
- package/dist/index.js.map +1 -1
- package/dist/label.cjs +19 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +17 -0
- package/dist/label.js.map +1 -0
- package/dist/model.json +1 -1
- package/package.json +24 -27
- package/src/index.ts +15 -5
- package/src/label.ts +23 -0
- package/tsconfig.json +2 -14
- package/vitest.config.mts +8 -0
- package/dist/index.d.cts +0 -55
- package/vite.config.mts +0 -20
package/dist/index.cjs
CHANGED
|
@@ -1,82 +1,91 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var model$1 = require('@platforma-sdk/model');
|
|
4
|
+
var label = require('./label.cjs');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
6
|
+
const model = model$1.BlockModel.create()
|
|
7
|
+
.withArgs({
|
|
8
|
+
defaultBlockLabel: label.getDefaultBlockLabel({
|
|
9
|
+
allele: false,
|
|
10
|
+
isSingleCell: false,
|
|
11
|
+
}),
|
|
12
|
+
customBlockLabel: '',
|
|
13
|
+
scChain: 'A',
|
|
14
|
+
allele: false,
|
|
15
|
+
})
|
|
16
|
+
.withUiState({
|
|
17
|
+
weightedFlag: true,
|
|
18
|
+
vUsagePlotState: {
|
|
19
|
+
title: 'V Usage',
|
|
20
|
+
template: 'heatmapClustered',
|
|
21
|
+
currentTab: 'settings',
|
|
22
|
+
layersSettings: {
|
|
23
|
+
heatmapClustered: {
|
|
24
|
+
normalizationDirection: null,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
jUsagePlotState: {
|
|
29
|
+
title: 'J Usage',
|
|
30
|
+
template: 'heatmapClustered',
|
|
31
|
+
currentTab: null,
|
|
32
|
+
layersSettings: {
|
|
33
|
+
heatmapClustered: {
|
|
34
|
+
normalizationDirection: null,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
vjUsagePlotState: {
|
|
39
|
+
title: 'V/J Usage',
|
|
40
|
+
template: 'heatmapClustered',
|
|
41
|
+
currentTab: null,
|
|
42
|
+
layersSettings: {
|
|
43
|
+
heatmapClustered: {
|
|
44
|
+
normalizationDirection: null,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
.argsValid((ctx) => ctx.args.datasetRef !== undefined)
|
|
50
|
+
.output('datasetOptions', (ctx) => ctx.resultPool.getOptions([{
|
|
51
|
+
axes: [
|
|
52
|
+
{ name: 'pl7.app/sampleId' },
|
|
53
|
+
{ name: 'pl7.app/vdj/clonotypeKey' },
|
|
54
|
+
],
|
|
55
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
51
56
|
}, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
axes: [
|
|
58
|
+
{ name: 'pl7.app/sampleId' },
|
|
59
|
+
{ name: 'pl7.app/vdj/scClonotypeKey' },
|
|
60
|
+
],
|
|
61
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
62
|
+
}], {
|
|
63
|
+
// suppress native label of the column (e.g. "Number of Reads") to show only the dataset label
|
|
64
|
+
label: { includeNativeLabel: false },
|
|
65
|
+
}))
|
|
66
|
+
.output('datasetSpec', (ctx) => {
|
|
67
|
+
if (ctx.args.datasetRef === undefined) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);
|
|
71
|
+
})
|
|
72
|
+
.outputWithStatus('pf', (ctx) => {
|
|
73
|
+
const pCols = ctx.outputs?.resolve('pf')?.getPColumns();
|
|
74
|
+
if (pCols === undefined) {
|
|
75
|
+
return undefined;
|
|
61
76
|
}
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return model$1.createPFrameForGraphs(ctx, pCols);
|
|
74
|
-
}).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title((ctx) => ctx.uiState?.blockTitle ?? "V/J Usage").sections((_) => [
|
|
75
|
-
{ type: "link", href: "/", label: "V Gene Usage" },
|
|
76
|
-
{ type: "link", href: "/jUsage", label: "J Gene Usage" },
|
|
77
|
-
{ type: "link", href: "/vjUsage", label: "V/J Gene Usage" }
|
|
78
|
-
]).done(2);
|
|
77
|
+
return model$1.createPFrameForGraphs(ctx, pCols);
|
|
78
|
+
})
|
|
79
|
+
.output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
|
|
80
|
+
.title(() => 'V/J Usage')
|
|
81
|
+
.subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
|
|
82
|
+
.sections((_) => [
|
|
83
|
+
{ type: 'link', href: '/', label: 'V Gene Usage' },
|
|
84
|
+
{ type: 'link', href: '/jUsage', label: 'J Gene Usage' },
|
|
85
|
+
{ type: 'link', href: '/vjUsage', label: 'V/J Gene Usage' },
|
|
86
|
+
])
|
|
87
|
+
.done(2);
|
|
79
88
|
|
|
89
|
+
exports.getDefaultBlockLabel = label.getDefaultBlockLabel;
|
|
80
90
|
exports.model = model;
|
|
81
91
|
//# sourceMappingURL=index.cjs.map
|
|
82
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { InferOutputsType, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';\nimport { getDefaultBlockLabel } from './label';\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n datasetRef?: PlRef;\n scChain?: string;\n allele?: boolean;\n};\n\nexport type UiState = {\n weightedFlag: boolean;\n vUsagePlotState: GraphMakerState;\n jUsagePlotState: GraphMakerState;\n vjUsagePlotState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n defaultBlockLabel: getDefaultBlockLabel({\n allele: false,\n isSingleCell: false,\n }),\n customBlockLabel: '',\n scChain: 'A',\n allele: false,\n })\n\n .withUiState<UiState>({\n weightedFlag: true,\n vUsagePlotState: {\n title: 'V Usage',\n template: 'heatmapClustered',\n currentTab: 'settings',\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n jUsagePlotState: {\n title: 'J Usage',\n template: 'heatmapClustered',\n currentTab: null,\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n vjUsagePlotState: {\n title: 'V/J Usage',\n template: 'heatmapClustered',\n currentTab: null,\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n })\n\n .argsValid((ctx) => ctx.args.datasetRef !== undefined)\n\n .output('datasetOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/clonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }, {\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/scClonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }],\n {\n // suppress native label of the column (e.g. \"Number of Reads\") to show only the dataset label\n label: { includeNativeLabel: false },\n }),\n )\n\n .output('datasetSpec', (ctx) => {\n if (ctx.args.datasetRef === undefined) {\n return undefined;\n }\n\n return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);\n })\n\n .outputWithStatus('pf', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPFrameForGraphs(ctx, pCols);\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title(() => 'V/J Usage')\n\n .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)\n\n .sections((_) => [\n { type: 'link', href: '/', label: 'V Gene Usage' },\n { type: 'link', href: '/jUsage', label: 'J Gene Usage' },\n { type: 'link', href: '/vjUsage', label: 'V/J Gene Usage' },\n ])\n\n .done(2);\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n\nexport { getDefaultBlockLabel } from './label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G,KAAK,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB;AAEzE,KAAA,QAAQ,CAAC,CAAC,CAAC,KAAK;IACf,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE;IAClD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;IACxD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE;CAC5D;KAEA,IAAI,CAAC,CAAC;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { GraphMakerState } from '@milaboratories/graph-maker';
|
|
2
|
+
import type { InferOutputsType, PlRef } from '@platforma-sdk/model';
|
|
3
|
+
export type BlockArgs = {
|
|
4
|
+
defaultBlockLabel: string;
|
|
5
|
+
customBlockLabel: string;
|
|
6
6
|
datasetRef?: PlRef;
|
|
7
7
|
scChain?: string;
|
|
8
8
|
allele?: boolean;
|
|
9
9
|
};
|
|
10
|
-
type UiState = {
|
|
11
|
-
blockTitle: string;
|
|
10
|
+
export type UiState = {
|
|
12
11
|
weightedFlag: boolean;
|
|
13
12
|
vUsagePlotState: GraphMakerState;
|
|
14
13
|
jUsagePlotState: GraphMakerState;
|
|
15
14
|
vjUsagePlotState: GraphMakerState;
|
|
16
15
|
};
|
|
17
|
-
declare const model:
|
|
18
|
-
datasetOptions:
|
|
16
|
+
export declare const model: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV2<BlockArgs, import("@platforma-sdk/model").InferOutputsFromConfigs<BlockArgs, {
|
|
17
|
+
datasetOptions: import("@platforma-sdk/model").ConfigRenderLambda<{
|
|
19
18
|
readonly ref: {
|
|
20
19
|
readonly __isRef: true;
|
|
21
20
|
readonly blockId: string;
|
|
@@ -24,8 +23,8 @@ declare const model: _platforma_sdk_model.PlatformaV2<BlockArgs, {
|
|
|
24
23
|
};
|
|
25
24
|
readonly label: string;
|
|
26
25
|
}[]>;
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
} & {
|
|
27
|
+
datasetSpec: import("@platforma-sdk/model").ConfigRenderLambda<{
|
|
29
28
|
readonly kind: "PColumn";
|
|
30
29
|
readonly name: string;
|
|
31
30
|
readonly domain?: {
|
|
@@ -34,9 +33,10 @@ declare const model: _platforma_sdk_model.PlatformaV2<BlockArgs, {
|
|
|
34
33
|
readonly annotations?: {
|
|
35
34
|
[x: string]: string;
|
|
36
35
|
} | undefined;
|
|
36
|
+
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
37
37
|
readonly parentAxes?: number[] | undefined;
|
|
38
38
|
readonly axesSpec: {
|
|
39
|
-
readonly type:
|
|
39
|
+
readonly type: import("@platforma-sdk/model").ValueType;
|
|
40
40
|
readonly name: string;
|
|
41
41
|
readonly domain?: {
|
|
42
42
|
[x: string]: string;
|
|
@@ -47,9 +47,13 @@ declare const model: _platforma_sdk_model.PlatformaV2<BlockArgs, {
|
|
|
47
47
|
readonly parentAxes?: number[] | undefined;
|
|
48
48
|
}[];
|
|
49
49
|
} | undefined>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
} & {
|
|
51
|
+
pf: import("@platforma-sdk/model").ConfigRenderLambda<import("@platforma-sdk/model").PFrameHandle | undefined> & {
|
|
52
|
+
withStatus: true;
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
55
|
+
isRunning: import("@platforma-sdk/model").ConfigRenderLambda<boolean>;
|
|
56
|
+
}, UiState>, UiState, "/" | "/jUsage" | "/vjUsage">>;
|
|
57
|
+
export type BlockOutputs = InferOutputsType<typeof model>;
|
|
58
|
+
export { getDefaultBlockLabel } from './label';
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAIpE,MAAM,MAAM,SAAS,GAAG;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAiGR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,KAAK,CAAC,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,80 +1,88 @@
|
|
|
1
1
|
import { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';
|
|
2
|
+
import { getDefaultBlockLabel } from './label.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
4
|
+
const model = BlockModel.create()
|
|
5
|
+
.withArgs({
|
|
6
|
+
defaultBlockLabel: getDefaultBlockLabel({
|
|
7
|
+
allele: false,
|
|
8
|
+
isSingleCell: false,
|
|
9
|
+
}),
|
|
10
|
+
customBlockLabel: '',
|
|
11
|
+
scChain: 'A',
|
|
12
|
+
allele: false,
|
|
13
|
+
})
|
|
14
|
+
.withUiState({
|
|
15
|
+
weightedFlag: true,
|
|
16
|
+
vUsagePlotState: {
|
|
17
|
+
title: 'V Usage',
|
|
18
|
+
template: 'heatmapClustered',
|
|
19
|
+
currentTab: 'settings',
|
|
20
|
+
layersSettings: {
|
|
21
|
+
heatmapClustered: {
|
|
22
|
+
normalizationDirection: null,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
jUsagePlotState: {
|
|
27
|
+
title: 'J Usage',
|
|
28
|
+
template: 'heatmapClustered',
|
|
29
|
+
currentTab: null,
|
|
30
|
+
layersSettings: {
|
|
31
|
+
heatmapClustered: {
|
|
32
|
+
normalizationDirection: null,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
vjUsagePlotState: {
|
|
37
|
+
title: 'V/J Usage',
|
|
38
|
+
template: 'heatmapClustered',
|
|
39
|
+
currentTab: null,
|
|
40
|
+
layersSettings: {
|
|
41
|
+
heatmapClustered: {
|
|
42
|
+
normalizationDirection: null,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
.argsValid((ctx) => ctx.args.datasetRef !== undefined)
|
|
48
|
+
.output('datasetOptions', (ctx) => ctx.resultPool.getOptions([{
|
|
49
|
+
axes: [
|
|
50
|
+
{ name: 'pl7.app/sampleId' },
|
|
51
|
+
{ name: 'pl7.app/vdj/clonotypeKey' },
|
|
52
|
+
],
|
|
53
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
49
54
|
}, {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}],
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
axes: [
|
|
56
|
+
{ name: 'pl7.app/sampleId' },
|
|
57
|
+
{ name: 'pl7.app/vdj/scClonotypeKey' },
|
|
58
|
+
],
|
|
59
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
60
|
+
}], {
|
|
61
|
+
// suppress native label of the column (e.g. "Number of Reads") to show only the dataset label
|
|
62
|
+
label: { includeNativeLabel: false },
|
|
63
|
+
}))
|
|
64
|
+
.output('datasetSpec', (ctx) => {
|
|
65
|
+
if (ctx.args.datasetRef === undefined) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);
|
|
69
|
+
})
|
|
70
|
+
.outputWithStatus('pf', (ctx) => {
|
|
71
|
+
const pCols = ctx.outputs?.resolve('pf')?.getPColumns();
|
|
72
|
+
if (pCols === undefined) {
|
|
73
|
+
return undefined;
|
|
59
74
|
}
|
|
60
|
-
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return createPFrameForGraphs(ctx, pCols);
|
|
72
|
-
}).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title((ctx) => ctx.uiState?.blockTitle ?? "V/J Usage").sections((_) => [
|
|
73
|
-
{ type: "link", href: "/", label: "V Gene Usage" },
|
|
74
|
-
{ type: "link", href: "/jUsage", label: "J Gene Usage" },
|
|
75
|
-
{ type: "link", href: "/vjUsage", label: "V/J Gene Usage" }
|
|
76
|
-
]).done(2);
|
|
75
|
+
return createPFrameForGraphs(ctx, pCols);
|
|
76
|
+
})
|
|
77
|
+
.output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
|
|
78
|
+
.title(() => 'V/J Usage')
|
|
79
|
+
.subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
|
|
80
|
+
.sections((_) => [
|
|
81
|
+
{ type: 'link', href: '/', label: 'V Gene Usage' },
|
|
82
|
+
{ type: 'link', href: '/jUsage', label: 'J Gene Usage' },
|
|
83
|
+
{ type: 'link', href: '/vjUsage', label: 'V/J Gene Usage' },
|
|
84
|
+
])
|
|
85
|
+
.done(2);
|
|
77
86
|
|
|
78
|
-
export { model };
|
|
87
|
+
export { getDefaultBlockLabel, model };
|
|
79
88
|
//# sourceMappingURL=index.js.map
|
|
80
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { InferOutputsType, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';\nimport { getDefaultBlockLabel } from './label';\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n datasetRef?: PlRef;\n scChain?: string;\n allele?: boolean;\n};\n\nexport type UiState = {\n weightedFlag: boolean;\n vUsagePlotState: GraphMakerState;\n jUsagePlotState: GraphMakerState;\n vjUsagePlotState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n defaultBlockLabel: getDefaultBlockLabel({\n allele: false,\n isSingleCell: false,\n }),\n customBlockLabel: '',\n scChain: 'A',\n allele: false,\n })\n\n .withUiState<UiState>({\n weightedFlag: true,\n vUsagePlotState: {\n title: 'V Usage',\n template: 'heatmapClustered',\n currentTab: 'settings',\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n jUsagePlotState: {\n title: 'J Usage',\n template: 'heatmapClustered',\n currentTab: null,\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n vjUsagePlotState: {\n title: 'V/J Usage',\n template: 'heatmapClustered',\n currentTab: null,\n layersSettings: {\n heatmapClustered: {\n normalizationDirection: null,\n },\n },\n },\n })\n\n .argsValid((ctx) => ctx.args.datasetRef !== undefined)\n\n .output('datasetOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/clonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }, {\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/scClonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }],\n {\n // suppress native label of the column (e.g. \"Number of Reads\") to show only the dataset label\n label: { includeNativeLabel: false },\n }),\n )\n\n .output('datasetSpec', (ctx) => {\n if (ctx.args.datasetRef === undefined) {\n return undefined;\n }\n\n return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);\n })\n\n .outputWithStatus('pf', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPFrameForGraphs(ctx, pCols);\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title(() => 'V/J Usage')\n\n .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)\n\n .sections((_) => [\n { type: 'link', href: '/', label: 'V Gene Usage' },\n { type: 'link', href: '/jUsage', label: 'J Gene Usage' },\n { type: 'link', href: '/vjUsage', label: 'V/J Gene Usage' },\n ])\n\n .done(2);\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n\nexport { getDefaultBlockLabel } from './label';\n"],"names":[],"mappings":";;;AAoBO,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM;AAEnC,KAAA,QAAQ,CAAY;IACnB,iBAAiB,EAAE,oBAAoB,CAAC;AACtC,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,YAAY,EAAE,KAAK;KACpB,CAAC;AACF,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,OAAO,EAAE,GAAG;AACZ,IAAA,MAAM,EAAE,KAAK;CACd;AAEA,KAAA,WAAW,CAAU;AACpB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,QAAQ,EAAE,kBAAkB;AAC5B,QAAA,UAAU,EAAE,UAAU;AACtB,QAAA,cAAc,EAAE;AACd,YAAA,gBAAgB,EAAE;AAChB,gBAAA,sBAAsB,EAAE,IAAI;AAC7B,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,QAAQ,EAAE,kBAAkB;AAC5B,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,cAAc,EAAE;AACd,YAAA,gBAAgB,EAAE;AAChB,gBAAA,sBAAsB,EAAE,IAAI;AAC7B,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,QAAQ,EAAE,kBAAkB;AAC5B,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,cAAc,EAAE;AACd,YAAA,gBAAgB,EAAE;AAChB,gBAAA,sBAAsB,EAAE,IAAI;AAC7B,aAAA;AACF,SAAA;AACF,KAAA;CACF;AAEA,KAAA,SAAS,CA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O,EAAE,iBAAiB,EAAE,KAAK,KAAK;AAEvE,KAAA,KAAK,CAAC,MAAM,WAAW;AAEvB,KAAA,QAAQ,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB;AAEzE,KAAA,QAAQ,CAAC,CAAC,CAAC,KAAK;IACf,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE;IAClD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;IACxD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE;CAC5D;KAEA,IAAI,CAAC,CAAC;;;;"}
|
package/dist/label.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function getDefaultBlockLabel(data) {
|
|
4
|
+
const parts = [];
|
|
5
|
+
// Add dataset name
|
|
6
|
+
if (data.datasetLabel) {
|
|
7
|
+
parts.push(data.datasetLabel);
|
|
8
|
+
}
|
|
9
|
+
// Add allele/gene
|
|
10
|
+
parts.push(data.allele ? 'Allele' : 'Gene');
|
|
11
|
+
// Add chain info for single-cell datasets
|
|
12
|
+
if (data.isSingleCell && data.chainLabel) {
|
|
13
|
+
parts.push(data.chainLabel);
|
|
14
|
+
}
|
|
15
|
+
return parts.join(' - ');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.getDefaultBlockLabel = getDefaultBlockLabel;
|
|
19
|
+
//# sourceMappingURL=label.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.cjs","sources":["../src/label.ts"],"sourcesContent":["export function getDefaultBlockLabel(data: {\n datasetLabel?: string;\n allele: boolean;\n isSingleCell: boolean;\n chainLabel?: string;\n}) {\n const parts: string[] = [];\n\n // Add dataset name\n if (data.datasetLabel) {\n parts.push(data.datasetLabel);\n }\n\n // Add allele/gene\n parts.push(data.allele ? 'Allele' : 'Gene');\n\n // Add chain info for single-cell datasets\n if (data.isSingleCell && data.chainLabel) {\n parts.push(data.chainLabel);\n }\n\n return parts.join(' - ');\n}\n"],"names":[],"mappings":";;AAAM,SAAU,oBAAoB,CAAC,IAKpC,EAAA;IACC,MAAM,KAAK,GAAa,EAAE;;AAG1B,IAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAC/B;;AAGA,IAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;;IAG3C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,EAAE;AACxC,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IAC7B;AAEA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1B;;;;"}
|
package/dist/label.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../src/label.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,UAiBA"}
|
package/dist/label.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function getDefaultBlockLabel(data) {
|
|
2
|
+
const parts = [];
|
|
3
|
+
// Add dataset name
|
|
4
|
+
if (data.datasetLabel) {
|
|
5
|
+
parts.push(data.datasetLabel);
|
|
6
|
+
}
|
|
7
|
+
// Add allele/gene
|
|
8
|
+
parts.push(data.allele ? 'Allele' : 'Gene');
|
|
9
|
+
// Add chain info for single-cell datasets
|
|
10
|
+
if (data.isSingleCell && data.chainLabel) {
|
|
11
|
+
parts.push(data.chainLabel);
|
|
12
|
+
}
|
|
13
|
+
return parts.join(' - ');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { getDefaultBlockLabel };
|
|
17
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../src/label.ts"],"sourcesContent":["export function getDefaultBlockLabel(data: {\n datasetLabel?: string;\n allele: boolean;\n isSingleCell: boolean;\n chainLabel?: string;\n}) {\n const parts: string[] = [];\n\n // Add dataset name\n if (data.datasetLabel) {\n parts.push(data.datasetLabel);\n }\n\n // Add allele/gene\n parts.push(data.allele ? 'Allele' : 'Gene');\n\n // Add chain info for single-cell datasets\n if (data.isSingleCell && data.chainLabel) {\n parts.push(data.chainLabel);\n }\n\n return parts.join(' - ');\n}\n"],"names":[],"mappings":"AAAM,SAAU,oBAAoB,CAAC,IAKpC,EAAA;IACC,MAAM,KAAK,GAAa,EAAE;;AAG1B,IAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAC/B;;AAGA,IAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;;IAG3C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,EAAE;AACxC,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IAC7B;AAEA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1B;;;;"}
|