@platforma-open/milaboratories.vj-usage.model 2.1.5 → 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/dist/index.cjs CHANGED
@@ -1,14 +1,19 @@
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
  const model = model$1.BlockModel.create()
6
7
  .withArgs({
8
+ defaultBlockLabel: label.getDefaultBlockLabel({
9
+ allele: false,
10
+ isSingleCell: false,
11
+ }),
12
+ customBlockLabel: '',
7
13
  scChain: 'A',
8
14
  allele: false,
9
15
  })
10
16
  .withUiState({
11
- blockTitle: 'V/J Usage',
12
17
  weightedFlag: true,
13
18
  vUsagePlotState: {
14
19
  title: 'V Usage',
@@ -21,7 +26,7 @@ const model = model$1.BlockModel.create()
21
26
  },
22
27
  },
23
28
  jUsagePlotState: {
24
- title: 'V Usage',
29
+ title: 'J Usage',
25
30
  template: 'heatmapClustered',
26
31
  currentTab: null,
27
32
  layersSettings: {
@@ -72,7 +77,8 @@ const model = model$1.BlockModel.create()
72
77
  return model$1.createPFrameForGraphs(ctx, pCols);
73
78
  })
74
79
  .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
75
- .title((ctx) => ctx.uiState?.blockTitle ?? 'V/J Usage')
80
+ .title(() => 'V/J Usage')
81
+ .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
76
82
  .sections((_) => [
77
83
  { type: 'link', href: '/', label: 'V Gene Usage' },
78
84
  { type: 'link', href: '/jUsage', label: 'J Gene Usage' },
@@ -80,5 +86,6 @@ const model = model$1.BlockModel.create()
80
86
  ])
81
87
  .done(2);
82
88
 
89
+ exports.getDefaultBlockLabel = label.getDefaultBlockLabel;
83
90
  exports.model = model;
84
91
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
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';\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 .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((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(2);\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"],"names":["BlockModel","createPFrameForGraphs"],"mappings":";;;;AAkBO,MAAM,KAAK,GAAGA,kBAAU,CAAC,MAAM;AAEnC,KAAA,QAAQ,CAAY;AACnB,IAAA,OAAO,EAAE,GAAG;AACZ,IAAA,MAAM,EAAE,KAAK;CACd;AAEA,KAAA,WAAW,CAAU;AACpB,IAAA,UAAU,EAAE,WAAW;AACvB,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,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EA,IAAA,OAAOC,6BAAqB,CAAC,GAAG,EAAE,KAAK,CAAC;AAC1C,CAAC;AAEA,KAAA,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,KAAK;AAEvE,KAAA,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,IAAI,WAAW;AAErD,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;;;;"}
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';\n"],"names":["BlockModel","getDefaultBlockLabel","createPFrameForGraphs"],"mappings":";;;;;AAoBO,M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AC,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,19 +1,20 @@
1
1
  import type { GraphMakerState } from '@milaboratories/graph-maker';
2
2
  import type { InferOutputsType, PlRef } from '@platforma-sdk/model';
3
3
  export type BlockArgs = {
4
+ defaultBlockLabel: string;
5
+ customBlockLabel: string;
4
6
  datasetRef?: PlRef;
5
7
  scChain?: string;
6
8
  allele?: boolean;
7
9
  };
8
10
  export type UiState = {
9
- blockTitle: string;
10
11
  weightedFlag: boolean;
11
12
  vUsagePlotState: GraphMakerState;
12
13
  jUsagePlotState: GraphMakerState;
13
14
  vjUsagePlotState: GraphMakerState;
14
15
  };
15
- export declare const model: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV2<BlockArgs, {
16
- datasetOptions: import("@platforma-sdk/model").OutputWithStatus<{
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<{
17
18
  readonly ref: {
18
19
  readonly __isRef: true;
19
20
  readonly blockId: string;
@@ -21,10 +22,9 @@ export declare const model: import("@platforma-sdk/model").PlatformaExtended<imp
21
22
  readonly requireEnrichments?: true | undefined;
22
23
  };
23
24
  readonly label: string;
24
- }[]> & {
25
- __unwrap: true;
26
- };
27
- datasetSpec: import("@platforma-sdk/model").OutputWithStatus<{
25
+ }[]>;
26
+ } & {
27
+ datasetSpec: import("@platforma-sdk/model").ConfigRenderLambda<{
28
28
  readonly kind: "PColumn";
29
29
  readonly name: string;
30
30
  readonly domain?: {
@@ -46,15 +46,14 @@ export declare const model: import("@platforma-sdk/model").PlatformaExtended<imp
46
46
  } | undefined;
47
47
  readonly parentAxes?: number[] | undefined;
48
48
  }[];
49
- } | undefined> & {
50
- __unwrap: true;
51
- };
52
- pf: import("@platforma-sdk/model").OutputWithStatus<import("@platforma-sdk/model").PFrameHandle> & {
53
- __unwrap: false;
54
- };
55
- isRunning: import("@platforma-sdk/model").OutputWithStatus<boolean> & {
56
- __unwrap: true;
49
+ } | undefined>;
50
+ } & {
51
+ pf: import("@platforma-sdk/model").ConfigRenderLambda<import("@platforma-sdk/model").PFrameHandle | undefined> & {
52
+ withStatus: true;
57
53
  };
58
- }, UiState, "/" | "/jUsage" | "/vjUsage">>;
54
+ } & {
55
+ isRunning: import("@platforma-sdk/model").ConfigRenderLambda<boolean>;
56
+ }, UiState>, UiState, "/" | "/jUsage" | "/vjUsage">>;
59
57
  export type BlockOutputs = InferOutputsType<typeof model>;
58
+ export { getDefaultBlockLabel } from './label';
60
59
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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;AAGpE,MAAM,MAAM,SAAS,GAAG;IACtB,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,UAAU,EAAE,MAAM,CAAC;IACnB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CA2FR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,KAAK,CAAC,CAAC"}
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,12 +1,17 @@
1
1
  import { BlockModel, createPFrameForGraphs } from '@platforma-sdk/model';
2
+ import { getDefaultBlockLabel } from './label.js';
2
3
 
3
4
  const model = BlockModel.create()
4
5
  .withArgs({
6
+ defaultBlockLabel: getDefaultBlockLabel({
7
+ allele: false,
8
+ isSingleCell: false,
9
+ }),
10
+ customBlockLabel: '',
5
11
  scChain: 'A',
6
12
  allele: false,
7
13
  })
8
14
  .withUiState({
9
- blockTitle: 'V/J Usage',
10
15
  weightedFlag: true,
11
16
  vUsagePlotState: {
12
17
  title: 'V Usage',
@@ -19,7 +24,7 @@ const model = BlockModel.create()
19
24
  },
20
25
  },
21
26
  jUsagePlotState: {
22
- title: 'V Usage',
27
+ title: 'J Usage',
23
28
  template: 'heatmapClustered',
24
29
  currentTab: null,
25
30
  layersSettings: {
@@ -70,7 +75,8 @@ const model = BlockModel.create()
70
75
  return createPFrameForGraphs(ctx, pCols);
71
76
  })
72
77
  .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
73
- .title((ctx) => ctx.uiState?.blockTitle ?? 'V/J Usage')
78
+ .title(() => 'V/J Usage')
79
+ .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
74
80
  .sections((_) => [
75
81
  { type: 'link', href: '/', label: 'V Gene Usage' },
76
82
  { type: 'link', href: '/jUsage', label: 'J Gene Usage' },
@@ -78,5 +84,5 @@ const model = BlockModel.create()
78
84
  ])
79
85
  .done(2);
80
86
 
81
- export { model };
87
+ export { getDefaultBlockLabel, model };
82
88
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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';\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 .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((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(2);\n\nexport type BlockOutputs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AAE;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;;;;"}
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,UA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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;;;;"}
@@ -0,0 +1,7 @@
1
+ export declare function getDefaultBlockLabel(data: {
2
+ datasetLabel?: string;
3
+ allele: boolean;
4
+ isSingleCell: boolean;
5
+ chainLabel?: string;
6
+ }): string;
7
+ //# sourceMappingURL=label.d.ts.map
@@ -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;;;;"}