@platforma-open/milaboratories.vj-usage.model 2.0.1 → 2.1.1

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/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({}).withUiState({
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: "heatmap",
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: "heatmap",
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: "heatmap",
22
- currentTab: null
23
- }
24
- }).argsValid(
25
- (ctx) => ctx.args.vGeneRef !== void 0 && ctx.args.jGeneRef !== void 0 && ctx.args.abundanceRef !== void 0
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
- ], { ignoreMissingDomains: true });
44
- }).output("abundanceOptions", (ctx) => {
45
- const inputRef = ctx.args.vGeneRef;
46
- if (inputRef === void 0) return void 0;
47
- return ctx.resultPool.getCanonicalOptions(
48
- { main: inputRef },
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
- axes: [{
51
- /* sampleId */
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) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.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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, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, isPColumnSpec } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n vGeneRef?: PlRef;\n jGeneRef?: SUniversalPColumnId;\n abundanceRef?: SUniversalPColumnId;\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\n .withUiState<UiState>({\n blockTitle: 'V/J Usage',\n weightedFlag: true,\n vUsagePlotState: {\n title: 'V Usage',\n template: 'heatmap',\n currentTab: 'settings',\n },\n jUsagePlotState: {\n title: 'V Usage',\n template: 'heatmap',\n currentTab: null,\n },\n vjUsagePlotState: {\n title: 'V/J Usage',\n template: 'heatmap',\n currentTab: null,\n },\n })\n\n .argsValid((ctx) =>\n ctx.args.vGeneRef !== undefined\n && ctx.args.jGeneRef !== undefined\n && ctx.args.abundanceRef !== undefined,\n )\n\n .output('vGeneOptions', (ctx) =>\n ctx.resultPool.getOptions((c) =>\n isPColumnSpec(c) && c.valueType === 'String'\n && (c.name === 'pl7.app/vdj/geneHit' || c.name === 'pl7.app/vdj/geneHitWithAllele')\n && c.domain?.['pl7.app/vdj/reference'] === 'VGene',\n ))\n\n .output('jGeneOptions', (ctx) => {\n const inputRef = ctx.args.vGeneRef;\n if (inputRef === undefined) return undefined;\n const vGeneSpec = ctx.resultPool.getPColumnSpecByRef(inputRef);\n if (vGeneSpec === undefined) return undefined;\n return ctx.resultPool.getCanonicalOptions({ main: inputRef }, [\n {\n axes: [{ anchor: 'main', idx: 0 }],\n name: vGeneSpec.name,\n domain: {\n 'pl7.app/vdj/reference': 'JGene',\n 'pl7.app/vdj/scClonotypeChain': { anchor: 'main' },\n 'pl7.app/vdj/scClonotypeChain/index': { anchor: 'main' },\n },\n },\n ], { ignoreMissingDomains: true });\n })\n\n .output('abundanceOptions', (ctx) => {\n const inputRef = ctx.args.vGeneRef;\n if (inputRef === undefined) return undefined;\n return ctx.resultPool.getCanonicalOptions({ main: inputRef },\n {\n axes: [{/* sampleId */}, { anchor: 'main', idx: 0 }],\n annotations: {\n 'pl7.app/isAbundance': 'true',\n 'pl7.app/abundance/normalized': 'false',\n },\n },\n );\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"]}
1
+ {"version":3,"sources":["../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AA,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, SUniversalPColumnId, InferOutputsType } from '@platforma-sdk/model';
2
+ import { PlRef, InferOutputsType } from '@platforma-sdk/model';
3
3
  import { GraphMakerState } from '@milaboratories/graph-maker';
4
4
 
5
5
  type BlockArgs = {
6
- vGeneRef?: PlRef;
7
- jGeneRef?: SUniversalPColumnId;
8
- abundanceRef?: SUniversalPColumnId;
6
+ datasetRef?: PlRef;
7
+ scChain?: string;
8
+ allele?: boolean;
9
9
  };
10
10
  type UiState = {
11
11
  blockTitle: string;
@@ -14,23 +14,39 @@ type UiState = {
14
14
  jUsagePlotState: GraphMakerState;
15
15
  vjUsagePlotState: GraphMakerState;
16
16
  };
17
- declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
18
- vGeneOptions: _platforma_sdk_model.ValueOrErrors<{
17
+ declare const model: _platforma_sdk_model.PlatformaV1<BlockArgs, {
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
- jGeneOptions: _platforma_sdk_model.ValueOrErrors<{
27
- label: string;
28
- value: SUniversalPColumnId;
29
- }[] | undefined>;
30
- abundanceOptions: _platforma_sdk_model.ValueOrErrors<{
31
- label: string;
32
- value: SUniversalPColumnId;
33
- }[] | undefined>;
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, SUniversalPColumnId, InferOutputsType } from '@platforma-sdk/model';
2
+ import { PlRef, InferOutputsType } from '@platforma-sdk/model';
3
3
  import { GraphMakerState } from '@milaboratories/graph-maker';
4
4
 
5
5
  type BlockArgs = {
6
- vGeneRef?: PlRef;
7
- jGeneRef?: SUniversalPColumnId;
8
- abundanceRef?: SUniversalPColumnId;
6
+ datasetRef?: PlRef;
7
+ scChain?: string;
8
+ allele?: boolean;
9
9
  };
10
10
  type UiState = {
11
11
  blockTitle: string;
@@ -14,23 +14,39 @@ type UiState = {
14
14
  jUsagePlotState: GraphMakerState;
15
15
  vjUsagePlotState: GraphMakerState;
16
16
  };
17
- declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
18
- vGeneOptions: _platforma_sdk_model.ValueOrErrors<{
17
+ declare const model: _platforma_sdk_model.PlatformaV1<BlockArgs, {
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
- jGeneOptions: _platforma_sdk_model.ValueOrErrors<{
27
- label: string;
28
- value: SUniversalPColumnId;
29
- }[] | undefined>;
30
- abundanceOptions: _platforma_sdk_model.ValueOrErrors<{
31
- label: string;
32
- value: SUniversalPColumnId;
33
- }[] | undefined>;
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, isPColumnSpec, createPFrameForGraphs } from '@platforma-sdk/model';
1
+ import { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';
2
2
 
3
3
  // src/index.ts
4
- var model = BlockModel.create().withArgs({}).withUiState({
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: "heatmap",
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: "heatmap",
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: "heatmap",
20
- currentTab: null
21
- }
22
- }).argsValid(
23
- (ctx) => ctx.args.vGeneRef !== void 0 && ctx.args.jGeneRef !== void 0 && ctx.args.abundanceRef !== void 0
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
- ], { ignoreMissingDomains: true });
42
- }).output("abundanceOptions", (ctx) => {
43
- const inputRef = ctx.args.vGeneRef;
44
- if (inputRef === void 0) return void 0;
45
- return ctx.resultPool.getCanonicalOptions(
46
- { main: inputRef },
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
- axes: [{
49
- /* sampleId */
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":";;;AAkBa,IAAA,KAAA,GAAQ,WAAW,MAAO,EAAA,CAEpC,SAAoB,EAAE,EAEtB,WAAqB,CAAA;AAAA,EACpB,UAAY,EAAA,WAAA;AAAA,EACZ,YAAc,EAAA,IAAA;AAAA,EACd,eAAiB,EAAA;AAAA,IACf,KAAO,EAAA,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AAA;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, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, isPColumnSpec } from '@platforma-sdk/model';\n\nexport type BlockArgs = {\n vGeneRef?: PlRef;\n jGeneRef?: SUniversalPColumnId;\n abundanceRef?: SUniversalPColumnId;\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\n .withUiState<UiState>({\n blockTitle: 'V/J Usage',\n weightedFlag: true,\n vUsagePlotState: {\n title: 'V Usage',\n template: 'heatmap',\n currentTab: 'settings',\n },\n jUsagePlotState: {\n title: 'V Usage',\n template: 'heatmap',\n currentTab: null,\n },\n vjUsagePlotState: {\n title: 'V/J Usage',\n template: 'heatmap',\n currentTab: null,\n },\n })\n\n .argsValid((ctx) =>\n ctx.args.vGeneRef !== undefined\n && ctx.args.jGeneRef !== undefined\n && ctx.args.abundanceRef !== undefined,\n )\n\n .output('vGeneOptions', (ctx) =>\n ctx.resultPool.getOptions((c) =>\n isPColumnSpec(c) && c.valueType === 'String'\n && (c.name === 'pl7.app/vdj/geneHit' || c.name === 'pl7.app/vdj/geneHitWithAllele')\n && c.domain?.['pl7.app/vdj/reference'] === 'VGene',\n ))\n\n .output('jGeneOptions', (ctx) => {\n const inputRef = ctx.args.vGeneRef;\n if (inputRef === undefined) return undefined;\n const vGeneSpec = ctx.resultPool.getPColumnSpecByRef(inputRef);\n if (vGeneSpec === undefined) return undefined;\n return ctx.resultPool.getCanonicalOptions({ main: inputRef }, [\n {\n axes: [{ anchor: 'main', idx: 0 }],\n name: vGeneSpec.name,\n domain: {\n 'pl7.app/vdj/reference': 'JGene',\n 'pl7.app/vdj/scClonotypeChain': { anchor: 'main' },\n 'pl7.app/vdj/scClonotypeChain/index': { anchor: 'main' },\n },\n },\n ], { ignoreMissingDomains: true });\n })\n\n .output('abundanceOptions', (ctx) => {\n const inputRef = ctx.args.vGeneRef;\n if (inputRef === undefined) return undefined;\n return ctx.resultPool.getCanonicalOptions({ main: inputRef },\n {\n axes: [{/* sampleId */}, { anchor: 'main', idx: 0 }],\n annotations: {\n 'pl7.app/isAbundance': 'true',\n 'pl7.app/abundance/normalized': 'false',\n },\n },\n );\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"]}
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,eA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AoB,KAAM;AAAA;AACrC;AACF,CAEC,CAAA,MAAA,CAAO,aAAe,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,OAAA,qBAAA,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.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"]}