@platforma-open/milaboratories.vj-usage.model 2.0.0 → 2.1.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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +12 -0
- package/dist/bundle.js +839 -716
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +48 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -13
- package/dist/index.d.ts +29 -13
- package/dist/index.js +49 -40
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +4 -4
- package/src/index.ts +52 -49
package/dist/index.cjs
CHANGED
|
@@ -3,59 +3,68 @@
|
|
|
3
3
|
var model$1 = require('@platforma-sdk/model');
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
|
-
var model = model$1.BlockModel.create().withArgs({
|
|
6
|
+
var model = model$1.BlockModel.create().withArgs({
|
|
7
|
+
scChain: "A",
|
|
8
|
+
allele: false
|
|
9
|
+
}).withUiState({
|
|
7
10
|
blockTitle: "V/J Usage",
|
|
8
11
|
weightedFlag: true,
|
|
9
12
|
vUsagePlotState: {
|
|
10
13
|
title: "V Usage",
|
|
11
|
-
template: "
|
|
12
|
-
currentTab: "settings"
|
|
14
|
+
template: "heatmapClustered",
|
|
15
|
+
currentTab: "settings",
|
|
16
|
+
layersSettings: {
|
|
17
|
+
heatmapClustered: {
|
|
18
|
+
normalizationDirection: null
|
|
19
|
+
}
|
|
20
|
+
}
|
|
13
21
|
},
|
|
14
22
|
jUsagePlotState: {
|
|
15
23
|
title: "V Usage",
|
|
16
|
-
template: "
|
|
17
|
-
currentTab: null
|
|
24
|
+
template: "heatmapClustered",
|
|
25
|
+
currentTab: null,
|
|
26
|
+
layersSettings: {
|
|
27
|
+
heatmapClustered: {
|
|
28
|
+
normalizationDirection: null
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
},
|
|
19
32
|
vjUsagePlotState: {
|
|
20
33
|
title: "V/J Usage",
|
|
21
|
-
template: "
|
|
22
|
-
currentTab: null
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
).output("vGeneOptions", (ctx) => ctx.resultPool.getOptions(
|
|
27
|
-
(c) => model$1.isPColumnSpec(c) && c.valueType === "String" && (c.name === "pl7.app/vdj/geneHit" || c.name === "pl7.app/vdj/geneHitWithAllele") && c.domain?.["pl7.app/vdj/reference"] === "VGene"
|
|
28
|
-
)).output("jGeneOptions", (ctx) => {
|
|
29
|
-
const inputRef = ctx.args.vGeneRef;
|
|
30
|
-
if (inputRef === void 0) return void 0;
|
|
31
|
-
const vGeneSpec = ctx.resultPool.getPColumnSpecByRef(inputRef);
|
|
32
|
-
if (vGeneSpec === void 0) return void 0;
|
|
33
|
-
return ctx.resultPool.getCanonicalOptions({ main: inputRef }, [
|
|
34
|
-
{
|
|
35
|
-
axes: [{ anchor: "main", idx: 0 }],
|
|
36
|
-
name: vGeneSpec.name,
|
|
37
|
-
domain: {
|
|
38
|
-
"pl7.app/vdj/reference": "JGene",
|
|
39
|
-
"pl7.app/vdj/scClonotypeChain": { anchor: "main" },
|
|
40
|
-
"pl7.app/vdj/scClonotypeChain/index": { anchor: "main" }
|
|
34
|
+
template: "heatmapClustered",
|
|
35
|
+
currentTab: null,
|
|
36
|
+
layersSettings: {
|
|
37
|
+
heatmapClustered: {
|
|
38
|
+
normalizationDirection: null
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
}).
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
}
|
|
42
|
+
}).argsValid((ctx) => ctx.args.datasetRef !== void 0).output(
|
|
43
|
+
"datasetOptions",
|
|
44
|
+
(ctx) => ctx.resultPool.getOptions(
|
|
45
|
+
[{
|
|
46
|
+
axes: [
|
|
47
|
+
{ name: "pl7.app/sampleId" },
|
|
48
|
+
{ name: "pl7.app/vdj/clonotypeKey" }
|
|
49
|
+
],
|
|
50
|
+
annotations: { "pl7.app/isAnchor": "true" }
|
|
51
|
+
}, {
|
|
52
|
+
axes: [
|
|
53
|
+
{ name: "pl7.app/sampleId" },
|
|
54
|
+
{ name: "pl7.app/vdj/scClonotypeKey" }
|
|
55
|
+
],
|
|
56
|
+
annotations: { "pl7.app/isAnchor": "true" }
|
|
57
|
+
}],
|
|
49
58
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, { anchor: "main", idx: 0 }],
|
|
53
|
-
annotations: {
|
|
54
|
-
"pl7.app/isAbundance": "true",
|
|
55
|
-
"pl7.app/abundance/normalized": "false"
|
|
56
|
-
}
|
|
59
|
+
// suppress native label of the column (e.g. "Number of Reads") to show only the dataset label
|
|
60
|
+
label: { includeNativeLabel: false }
|
|
57
61
|
}
|
|
58
|
-
)
|
|
62
|
+
)
|
|
63
|
+
).output("datasetSpec", (ctx) => {
|
|
64
|
+
if (ctx.args.datasetRef === void 0) {
|
|
65
|
+
return void 0;
|
|
66
|
+
}
|
|
67
|
+
return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);
|
|
59
68
|
}).output("pf", (ctx) => {
|
|
60
69
|
const pCols = ctx.outputs?.resolve("pf")?.getPColumns();
|
|
61
70
|
if (pCols === void 0) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["BlockModel","
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["BlockModel","createPFrameForGraphs"],"mappings":";;;;;AAkBO,IAAM,KAAQ,GAAAA,kBAAA,CAAW,MAAO,EAAA,CAEpC,QAAoB,CAAA;AAAA,EACnB,OAAS,EAAA,GAAA;AAAA,EACT,MAAQ,EAAA;AACV,CAAC,EAEA,WAAqB,CAAA;AAAA,EACpB,UAAY,EAAA,WAAA;AAAA,EACZ,YAAc,EAAA,IAAA;AAAA,EACd,eAAiB,EAAA;AAAA,IACf,KAAO,EAAA,SAAA;AAAA,IACP,QAAU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e,EAAA,CAAC,GAAQ,KAAA;AAC9B,EAAI,IAAA,GAAA,CAAI,IAAK,CAAA,UAAA,KAAe,MAAW,EAAA;AACrC,IAAO,OAAA,MAAA;AAAA;AAGT,EAAA,OAAO,GAAI,CAAA,UAAA,CAAW,mBAAoB,CAAA,GAAA,CAAI,KAAK,UAAU,CAAA;AAC/D,CAAC,CAEA,CAAA,MAAA,CAAO,IAAM,EAAA,CAAC,GAAQ,KAAA;AACrB,EAAA,MAAM,QAAQ,GAAI,CAAA,OAAA,EAAS,OAAQ,CAAA,IAAI,GAAG,WAAY,EAAA;AACtD,EAAA,IAAI,UAAU,MAAW,EAAA;AACvB,IAAO,OAAA,MAAA;AAAA;AAGT,EAAO,OAAAC,6BAAA,CAAsB,KAAK,KAAK,CAAA;AACzC,CAAC,CAAA,CAEA,OAAO,WAAa,EAAA,CAAC,QAAQ,GAAI,CAAA,OAAA,EAAS,mBAAwB,KAAA,KAAK,EAEvE,KAAM,CAAA,CAAC,QAAQ,GAAI,CAAA,OAAA,EAAS,cAAc,WAAW,CAAA,CAErD,QAAS,CAAA,CAAC,CAAM,KAAA;AAAA,EACf,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,GAAA,EAAK,OAAO,cAAe,EAAA;AAAA,EACjD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,cAAe,EAAA;AAAA,EACvD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,UAAA,EAAY,OAAO,gBAAiB;AAC5D,CAAC,EAEA,IAAK","file":"index.cjs","sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { InferOutputsType, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n datasetRef?: PlRef;\n scChain?: string;\n allele?: boolean;\n};\n\nexport type UiState = {\n blockTitle: string;\n weightedFlag: boolean;\n vUsagePlotState: GraphMakerState;\n jUsagePlotState: GraphMakerState;\n vjUsagePlotState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n scChain: 'A',\n allele: false,\n })\n\n .withUiState<UiState>({\n blockTitle: 'V/J Usage',\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: 'V 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 .output('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((ctx) => ctx.uiState?.blockTitle ?? 'V/J Usage')\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();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { PlRef,
|
|
2
|
+
import { PlRef, InferOutputsType } from '@platforma-sdk/model';
|
|
3
3
|
import { GraphMakerState } from '@milaboratories/graph-maker';
|
|
4
4
|
|
|
5
5
|
type BlockArgs = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
datasetRef?: PlRef;
|
|
7
|
+
scChain?: string;
|
|
8
|
+
allele?: boolean;
|
|
9
9
|
};
|
|
10
10
|
type UiState = {
|
|
11
11
|
blockTitle: string;
|
|
@@ -15,22 +15,38 @@ type UiState = {
|
|
|
15
15
|
vjUsagePlotState: GraphMakerState;
|
|
16
16
|
};
|
|
17
17
|
declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
18
|
-
|
|
18
|
+
datasetOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
19
19
|
readonly ref: {
|
|
20
20
|
readonly __isRef: true;
|
|
21
21
|
readonly blockId: string;
|
|
22
22
|
readonly name: string;
|
|
23
|
+
readonly requireEnrichments?: true | undefined;
|
|
23
24
|
};
|
|
24
25
|
readonly label: string;
|
|
25
26
|
}[]>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
datasetSpec: _platforma_sdk_model.ValueOrErrors<{
|
|
28
|
+
readonly valueType: _platforma_sdk_model.ValueType;
|
|
29
|
+
readonly kind: "PColumn";
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly domain?: {
|
|
32
|
+
[x: string]: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
readonly annotations?: {
|
|
35
|
+
[x: string]: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
readonly parentAxes?: number[] | undefined;
|
|
38
|
+
readonly axesSpec: {
|
|
39
|
+
readonly type: _platforma_sdk_model.ValueType;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly domain?: {
|
|
42
|
+
[x: string]: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
readonly annotations?: {
|
|
45
|
+
[x: string]: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
readonly parentAxes?: number[] | undefined;
|
|
48
|
+
}[];
|
|
49
|
+
} | undefined>;
|
|
34
50
|
pf: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PFrameHandle | undefined>;
|
|
35
51
|
isRunning: _platforma_sdk_model.ValueOrErrors<boolean>;
|
|
36
52
|
}, UiState, "/" | "/jUsage" | "/vjUsage">;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { PlRef,
|
|
2
|
+
import { PlRef, InferOutputsType } from '@platforma-sdk/model';
|
|
3
3
|
import { GraphMakerState } from '@milaboratories/graph-maker';
|
|
4
4
|
|
|
5
5
|
type BlockArgs = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
datasetRef?: PlRef;
|
|
7
|
+
scChain?: string;
|
|
8
|
+
allele?: boolean;
|
|
9
9
|
};
|
|
10
10
|
type UiState = {
|
|
11
11
|
blockTitle: string;
|
|
@@ -15,22 +15,38 @@ type UiState = {
|
|
|
15
15
|
vjUsagePlotState: GraphMakerState;
|
|
16
16
|
};
|
|
17
17
|
declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
18
|
-
|
|
18
|
+
datasetOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
19
19
|
readonly ref: {
|
|
20
20
|
readonly __isRef: true;
|
|
21
21
|
readonly blockId: string;
|
|
22
22
|
readonly name: string;
|
|
23
|
+
readonly requireEnrichments?: true | undefined;
|
|
23
24
|
};
|
|
24
25
|
readonly label: string;
|
|
25
26
|
}[]>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
datasetSpec: _platforma_sdk_model.ValueOrErrors<{
|
|
28
|
+
readonly valueType: _platforma_sdk_model.ValueType;
|
|
29
|
+
readonly kind: "PColumn";
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly domain?: {
|
|
32
|
+
[x: string]: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
readonly annotations?: {
|
|
35
|
+
[x: string]: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
readonly parentAxes?: number[] | undefined;
|
|
38
|
+
readonly axesSpec: {
|
|
39
|
+
readonly type: _platforma_sdk_model.ValueType;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly domain?: {
|
|
42
|
+
[x: string]: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
readonly annotations?: {
|
|
45
|
+
[x: string]: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
readonly parentAxes?: number[] | undefined;
|
|
48
|
+
}[];
|
|
49
|
+
} | undefined>;
|
|
34
50
|
pf: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.PFrameHandle | undefined>;
|
|
35
51
|
isRunning: _platforma_sdk_model.ValueOrErrors<boolean>;
|
|
36
52
|
}, UiState, "/" | "/jUsage" | "/vjUsage">;
|
package/dist/index.js
CHANGED
|
@@ -1,59 +1,68 @@
|
|
|
1
|
-
import { BlockModel,
|
|
1
|
+
import { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
var model = BlockModel.create().withArgs({
|
|
4
|
+
var model = BlockModel.create().withArgs({
|
|
5
|
+
scChain: "A",
|
|
6
|
+
allele: false
|
|
7
|
+
}).withUiState({
|
|
5
8
|
blockTitle: "V/J Usage",
|
|
6
9
|
weightedFlag: true,
|
|
7
10
|
vUsagePlotState: {
|
|
8
11
|
title: "V Usage",
|
|
9
|
-
template: "
|
|
10
|
-
currentTab: "settings"
|
|
12
|
+
template: "heatmapClustered",
|
|
13
|
+
currentTab: "settings",
|
|
14
|
+
layersSettings: {
|
|
15
|
+
heatmapClustered: {
|
|
16
|
+
normalizationDirection: null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
11
19
|
},
|
|
12
20
|
jUsagePlotState: {
|
|
13
21
|
title: "V Usage",
|
|
14
|
-
template: "
|
|
15
|
-
currentTab: null
|
|
22
|
+
template: "heatmapClustered",
|
|
23
|
+
currentTab: null,
|
|
24
|
+
layersSettings: {
|
|
25
|
+
heatmapClustered: {
|
|
26
|
+
normalizationDirection: null
|
|
27
|
+
}
|
|
28
|
+
}
|
|
16
29
|
},
|
|
17
30
|
vjUsagePlotState: {
|
|
18
31
|
title: "V/J Usage",
|
|
19
|
-
template: "
|
|
20
|
-
currentTab: null
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
).output("vGeneOptions", (ctx) => ctx.resultPool.getOptions(
|
|
25
|
-
(c) => isPColumnSpec(c) && c.valueType === "String" && (c.name === "pl7.app/vdj/geneHit" || c.name === "pl7.app/vdj/geneHitWithAllele") && c.domain?.["pl7.app/vdj/reference"] === "VGene"
|
|
26
|
-
)).output("jGeneOptions", (ctx) => {
|
|
27
|
-
const inputRef = ctx.args.vGeneRef;
|
|
28
|
-
if (inputRef === void 0) return void 0;
|
|
29
|
-
const vGeneSpec = ctx.resultPool.getPColumnSpecByRef(inputRef);
|
|
30
|
-
if (vGeneSpec === void 0) return void 0;
|
|
31
|
-
return ctx.resultPool.getCanonicalOptions({ main: inputRef }, [
|
|
32
|
-
{
|
|
33
|
-
axes: [{ anchor: "main", idx: 0 }],
|
|
34
|
-
name: vGeneSpec.name,
|
|
35
|
-
domain: {
|
|
36
|
-
"pl7.app/vdj/reference": "JGene",
|
|
37
|
-
"pl7.app/vdj/scClonotypeChain": { anchor: "main" },
|
|
38
|
-
"pl7.app/vdj/scClonotypeChain/index": { anchor: "main" }
|
|
32
|
+
template: "heatmapClustered",
|
|
33
|
+
currentTab: null,
|
|
34
|
+
layersSettings: {
|
|
35
|
+
heatmapClustered: {
|
|
36
|
+
normalizationDirection: null
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
|
-
|
|
42
|
-
}).
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
}
|
|
40
|
+
}).argsValid((ctx) => ctx.args.datasetRef !== void 0).output(
|
|
41
|
+
"datasetOptions",
|
|
42
|
+
(ctx) => ctx.resultPool.getOptions(
|
|
43
|
+
[{
|
|
44
|
+
axes: [
|
|
45
|
+
{ name: "pl7.app/sampleId" },
|
|
46
|
+
{ name: "pl7.app/vdj/clonotypeKey" }
|
|
47
|
+
],
|
|
48
|
+
annotations: { "pl7.app/isAnchor": "true" }
|
|
49
|
+
}, {
|
|
50
|
+
axes: [
|
|
51
|
+
{ name: "pl7.app/sampleId" },
|
|
52
|
+
{ name: "pl7.app/vdj/scClonotypeKey" }
|
|
53
|
+
],
|
|
54
|
+
annotations: { "pl7.app/isAnchor": "true" }
|
|
55
|
+
}],
|
|
47
56
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, { anchor: "main", idx: 0 }],
|
|
51
|
-
annotations: {
|
|
52
|
-
"pl7.app/isAbundance": "true",
|
|
53
|
-
"pl7.app/abundance/normalized": "false"
|
|
54
|
-
}
|
|
57
|
+
// suppress native label of the column (e.g. "Number of Reads") to show only the dataset label
|
|
58
|
+
label: { includeNativeLabel: false }
|
|
55
59
|
}
|
|
56
|
-
)
|
|
60
|
+
)
|
|
61
|
+
).output("datasetSpec", (ctx) => {
|
|
62
|
+
if (ctx.args.datasetRef === void 0) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
return ctx.resultPool.getPColumnSpecByRef(ctx.args.datasetRef);
|
|
57
66
|
}).output("pf", (ctx) => {
|
|
58
67
|
const pCols = ctx.outputs?.resolve("pf")?.getPColumns();
|
|
59
68
|
if (pCols === void 0) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAkBO,IAAM,KAAQ,GAAA,UAAA,CAAW,MAAO,EAAA,CAEpC,QAAoB,CAAA;AAAA,EACnB,OAAS,EAAA,GAAA;AAAA,EACT,MAAQ,EAAA;AACV,CAAC,EAEA,WAAqB,CAAA;AAAA,EACpB,UAAY,EAAA,WAAA;AAAA,EACZ,YAAc,EAAA,IAAA;AAAA,EACd,eAAiB,EAAA;AAAA,IACf,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,kBAAA;AAAA,IACV,UAAY,EAAA,UAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,MACd,gBAAkB,EAAA;AAAA,QAChB,sBAAwB,EAAA;AAAA;AAC1B;AACF,GACF;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,kBAAA;AAAA,IACV,UAAY,EAAA,IAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,MACd,gBAAkB,EAAA;AAAA,QAChB,sBAAwB,EAAA;AAAA;AAC1B;AACF,GACF;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA,WAAA;AAAA,IACP,QAAU,EAAA,kBAAA;AAAA,IACV,UAAY,EAAA,IAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,MACd,gBAAkB,EAAA;AAAA,QAChB,sBAAwB,EAAA;AAAA;AAC1B;AACF;AAEJ,CAAC,CAAA,CAEA,UAAU,CAAC,GAAA,KAAQ,IAAI,IAAK,CAAA,UAAA,KAAe,MAAS,CAEpD,CAAA,MAAA;AAAA,EAA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C,CAAM,KAAA;AAAA,EACf,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,GAAA,EAAK,OAAO,cAAe,EAAA;AAAA,EACjD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,SAAA,EAAW,OAAO,cAAe,EAAA;AAAA,EACvD,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,UAAA,EAAY,OAAO,gBAAiB;AAC5D,CAAC,EAEA,IAAK","file":"index.js","sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { InferOutputsType, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n datasetRef?: PlRef;\n scChain?: string;\n allele?: boolean;\n};\n\nexport type UiState = {\n blockTitle: string;\n weightedFlag: boolean;\n vUsagePlotState: GraphMakerState;\n jUsagePlotState: GraphMakerState;\n vjUsagePlotState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n scChain: 'A',\n allele: false,\n })\n\n .withUiState<UiState>({\n blockTitle: 'V/J Usage',\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: 'V 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 .output('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((ctx) => ctx.uiState?.blockTitle ?? 'V/J Usage')\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();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"]}
|