@platforma-open/milaboratories.sequence-properties.model 1.1.2 → 1.2.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/.turbo/turbo-build.log +17 -17
- package/.turbo/turbo-check.log +5 -3
- package/CHANGELOG.md +18 -0
- package/dist/bundle.js +377 -176
- package/dist/bundle.js.map +1 -1
- package/dist/dataModel.cjs +20 -1
- package/dist/dataModel.cjs.map +1 -1
- package/dist/dataModel.d.ts.map +1 -1
- package/dist/dataModel.js +20 -1
- package/dist/dataModel.js.map +1 -1
- package/dist/index.cjs +38 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +41 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -6
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/dataModel.ts +29 -4
- package/src/index.ts +57 -6
- package/src/types.ts +9 -1
package/dist/dataModel.cjs
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
let _platforma_sdk_model = require("@platforma-sdk/model");
|
|
2
2
|
//#region src/dataModel.ts
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_SCATTER_STATE = {
|
|
4
|
+
title: "Property Relationships",
|
|
5
|
+
template: "dots",
|
|
6
|
+
currentTab: null
|
|
7
|
+
};
|
|
8
|
+
const DEFAULT_HISTOGRAM_STATE = {
|
|
9
|
+
title: "Property Distribution",
|
|
10
|
+
template: "bins",
|
|
11
|
+
currentTab: null,
|
|
12
|
+
layersSettings: { bins: { fillColor: "#99e099" } }
|
|
13
|
+
};
|
|
14
|
+
const blockDataModel = new _platforma_sdk_model.DataModelBuilder().from("Ver_2026_04_28").migrate("Ver_2026_05_05", (v1) => ({
|
|
15
|
+
...v1,
|
|
16
|
+
graphStateScatter: { ...DEFAULT_SCATTER_STATE },
|
|
17
|
+
graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }
|
|
18
|
+
})).init(() => ({
|
|
19
|
+
tableState: (0, _platforma_sdk_model.createPlDataTableStateV2)(),
|
|
20
|
+
graphStateScatter: { ...DEFAULT_SCATTER_STATE },
|
|
21
|
+
graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }
|
|
22
|
+
}));
|
|
4
23
|
//#endregion
|
|
5
24
|
exports.blockDataModel = blockDataModel;
|
|
6
25
|
|
package/dist/dataModel.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.cjs","names":["DataModelBuilder"],"sources":["../src/dataModel.ts"],"sourcesContent":["import { createPlDataTableStateV2, DataModelBuilder } from \"@platforma-sdk/model\";\nimport type { BlockData } from \"./types\";\n\nexport const blockDataModel = new DataModelBuilder().from<
|
|
1
|
+
{"version":3,"file":"dataModel.cjs","names":["DataModelBuilder"],"sources":["../src/dataModel.ts"],"sourcesContent":["import type { GraphMakerState } from \"@milaboratories/graph-maker\";\nimport { createPlDataTableStateV2, DataModelBuilder } from \"@platforma-sdk/model\";\nimport type { BlockData, BlockDataV1 } from \"./types\";\n\nconst DEFAULT_SCATTER_STATE: GraphMakerState = {\n title: \"Property Relationships\",\n template: \"dots\",\n currentTab: null,\n};\n\nconst DEFAULT_HISTOGRAM_STATE: GraphMakerState = {\n title: \"Property Distribution\",\n template: \"bins\",\n currentTab: null,\n layersSettings: {\n bins: { fillColor: \"#99e099\" },\n },\n};\n\nexport const blockDataModel = new DataModelBuilder()\n .from<BlockDataV1>(\"Ver_2026_04_28\")\n .migrate<BlockData>(\"Ver_2026_05_05\", (v1) => ({\n ...v1,\n graphStateScatter: { ...DEFAULT_SCATTER_STATE },\n graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE },\n }))\n .init(() => ({\n tableState: createPlDataTableStateV2(),\n graphStateScatter: { ...DEFAULT_SCATTER_STATE },\n graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE },\n }));\n"],"mappings":";;AAIA,MAAM,wBAAyC;CAC7C,OAAO;CACP,UAAU;CACV,YAAY;CACb;AAED,MAAM,0BAA2C;CAC/C,OAAO;CACP,UAAU;CACV,YAAY;CACZ,gBAAgB,EACd,MAAM,EAAE,WAAW,WAAW,EAC/B;CACF;AAED,MAAa,iBAAiB,IAAIA,qBAAAA,kBAAkB,CACjD,KAAkB,iBAAiB,CACnC,QAAmB,mBAAmB,QAAQ;CAC7C,GAAG;CACH,mBAAmB,EAAE,GAAG,uBAAuB;CAC/C,qBAAqB,EAAE,GAAG,yBAAyB;CACpD,EAAE,CACF,YAAY;CACX,aAAA,GAAA,qBAAA,2BAAsC;CACtC,mBAAmB,EAAE,GAAG,uBAAuB;CAC/C,qBAAqB,EAAE,GAAG,yBAAyB;CACpD,EAAE"}
|
package/dist/dataModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.d.ts","names":[],"sources":["../src/dataModel.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"dataModel.d.ts","names":[],"sources":["../src/dataModel.ts"],"mappings":";;;;cAmBa,cAAA,EAAc,uBAAA,CAAA,SAAA,CAAA,SAAA"}
|
package/dist/dataModel.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import { DataModelBuilder, createPlDataTableStateV2 } from "@platforma-sdk/model";
|
|
2
2
|
//#region src/dataModel.ts
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_SCATTER_STATE = {
|
|
4
|
+
title: "Property Relationships",
|
|
5
|
+
template: "dots",
|
|
6
|
+
currentTab: null
|
|
7
|
+
};
|
|
8
|
+
const DEFAULT_HISTOGRAM_STATE = {
|
|
9
|
+
title: "Property Distribution",
|
|
10
|
+
template: "bins",
|
|
11
|
+
currentTab: null,
|
|
12
|
+
layersSettings: { bins: { fillColor: "#99e099" } }
|
|
13
|
+
};
|
|
14
|
+
const blockDataModel = new DataModelBuilder().from("Ver_2026_04_28").migrate("Ver_2026_05_05", (v1) => ({
|
|
15
|
+
...v1,
|
|
16
|
+
graphStateScatter: { ...DEFAULT_SCATTER_STATE },
|
|
17
|
+
graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }
|
|
18
|
+
})).init(() => ({
|
|
19
|
+
tableState: createPlDataTableStateV2(),
|
|
20
|
+
graphStateScatter: { ...DEFAULT_SCATTER_STATE },
|
|
21
|
+
graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE }
|
|
22
|
+
}));
|
|
4
23
|
//#endregion
|
|
5
24
|
export { blockDataModel };
|
|
6
25
|
|
package/dist/dataModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.js","names":[],"sources":["../src/dataModel.ts"],"sourcesContent":["import { createPlDataTableStateV2, DataModelBuilder } from \"@platforma-sdk/model\";\nimport type { BlockData } from \"./types\";\n\nexport const blockDataModel = new DataModelBuilder().from<
|
|
1
|
+
{"version":3,"file":"dataModel.js","names":[],"sources":["../src/dataModel.ts"],"sourcesContent":["import type { GraphMakerState } from \"@milaboratories/graph-maker\";\nimport { createPlDataTableStateV2, DataModelBuilder } from \"@platforma-sdk/model\";\nimport type { BlockData, BlockDataV1 } from \"./types\";\n\nconst DEFAULT_SCATTER_STATE: GraphMakerState = {\n title: \"Property Relationships\",\n template: \"dots\",\n currentTab: null,\n};\n\nconst DEFAULT_HISTOGRAM_STATE: GraphMakerState = {\n title: \"Property Distribution\",\n template: \"bins\",\n currentTab: null,\n layersSettings: {\n bins: { fillColor: \"#99e099\" },\n },\n};\n\nexport const blockDataModel = new DataModelBuilder()\n .from<BlockDataV1>(\"Ver_2026_04_28\")\n .migrate<BlockData>(\"Ver_2026_05_05\", (v1) => ({\n ...v1,\n graphStateScatter: { ...DEFAULT_SCATTER_STATE },\n graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE },\n }))\n .init(() => ({\n tableState: createPlDataTableStateV2(),\n graphStateScatter: { ...DEFAULT_SCATTER_STATE },\n graphStateHistogram: { ...DEFAULT_HISTOGRAM_STATE },\n }));\n"],"mappings":";;AAIA,MAAM,wBAAyC;CAC7C,OAAO;CACP,UAAU;CACV,YAAY;CACb;AAED,MAAM,0BAA2C;CAC/C,OAAO;CACP,UAAU;CACV,YAAY;CACZ,gBAAgB,EACd,MAAM,EAAE,WAAW,WAAW,EAC/B;CACF;AAED,MAAa,iBAAiB,IAAI,kBAAkB,CACjD,KAAkB,iBAAiB,CACnC,QAAmB,mBAAmB,QAAQ;CAC7C,GAAG;CACH,mBAAmB,EAAE,GAAG,uBAAuB;CAC/C,qBAAqB,EAAE,GAAG,yBAAyB;CACpD,EAAE,CACF,YAAY;CACX,YAAY,0BAA0B;CACtC,mBAAmB,EAAE,GAAG,uBAAuB;CAC/C,qBAAqB,EAAE,GAAG,yBAAyB;CACpD,EAAE"}
|
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ const inputAnchorSpecs = [
|
|
|
23
23
|
const platforma = _platforma_sdk_model.BlockModelV3.create(require_dataModel.blockDataModel).args((data) => {
|
|
24
24
|
if (data.inputAnchor === void 0) throw new Error("Select an input dataset");
|
|
25
25
|
return { inputAnchor: data.inputAnchor };
|
|
26
|
-
}).output("inputOptions", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs
|
|
26
|
+
}).output("inputOptions", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs)).output("inputSpec", (ctx) => ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : void 0).output("info", (ctx) => ctx.outputs?.resolve("info")?.getDataAsJson()).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).output("processingLog", (ctx) => ctx.outputs?.resolve("processingLog")?.getLogHandle()).outputWithStatus("propertiesTable", (ctx) => {
|
|
27
27
|
if (ctx.data.inputAnchor === void 0) return void 0;
|
|
28
28
|
const ownCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
29
29
|
if (ownCols === void 0) return void 0;
|
|
@@ -59,11 +59,43 @@ const platforma = _platforma_sdk_model.BlockModelV3.create(require_dataModel.blo
|
|
|
59
59
|
visibility: "optional"
|
|
60
60
|
}] }
|
|
61
61
|
});
|
|
62
|
-
}).
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
}).outputWithStatus("propertiesPfHandle", (ctx) => {
|
|
63
|
+
const allPCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
64
|
+
if (allPCols === void 0) return void 0;
|
|
65
|
+
const pCols = allPCols.filter((c) => c.spec.name !== "pl7.app/aaFraction");
|
|
66
|
+
const inputAnchor = ctx.data.inputAnchor;
|
|
67
|
+
const upstreamMeta = inputAnchor !== void 0 ? (ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [{ axes: [{
|
|
68
|
+
anchor: "main",
|
|
69
|
+
idx: 0
|
|
70
|
+
}] }, { axes: [{
|
|
71
|
+
anchor: "main",
|
|
72
|
+
idx: 1
|
|
73
|
+
}] }]) ?? []).filter((c) => !c.spec.annotations?.[_platforma_sdk_model.Annotation.Trace]?.includes("milaboratories.sequence-properties")) : [];
|
|
74
|
+
return ctx.createPFrame([...pCols, ...upstreamMeta]);
|
|
75
|
+
}).output("propertiesPfCols", (ctx) => {
|
|
76
|
+
const pCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
77
|
+
if (pCols === void 0) return void 0;
|
|
78
|
+
return pCols.map((c) => ({
|
|
79
|
+
columnId: c.id,
|
|
80
|
+
spec: c.spec
|
|
81
|
+
}));
|
|
82
|
+
}).title(() => "Sequence Properties").subtitle((ctx) => ctx.data.defaultBlockLabel ?? "").sections(() => [
|
|
83
|
+
{
|
|
84
|
+
type: "link",
|
|
85
|
+
href: "/",
|
|
86
|
+
label: "Main"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "link",
|
|
90
|
+
href: "/scatter",
|
|
91
|
+
label: "Property Relationships"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "link",
|
|
95
|
+
href: "/histogram",
|
|
96
|
+
label: "Property Distribution"
|
|
97
|
+
}
|
|
98
|
+
]).done();
|
|
67
99
|
//#endregion
|
|
68
100
|
exports.blockDataModel = require_dataModel.blockDataModel;
|
|
69
101
|
exports.platforma = platforma;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["BlockModelV3","blockDataModel","ArrayColumnProvider","Annotation"],"sources":["../src/index.ts"],"sourcesContent":["import type { ColumnSource, InferOutputsType } from \"@platforma-sdk/model\";\nimport {\n Annotation,\n ArrayColumnProvider,\n BlockModelV3,\n createPlDataTableV3,\n} from \"@platforma-sdk/model\";\nimport { blockDataModel } from \"./dataModel\";\nimport type { BlockArgs, WorkflowInfo } from \"./types\";\n\nexport type { BlockArgs, BlockData, WorkflowInfo, WorkflowMode, WorkflowReceptor } from \"./types\";\nexport { blockDataModel } from \"./dataModel\";\n\nconst inputAnchorSpecs = [\n // Peptide mode — universal naming\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR bulk (cloneId per spec; clonotypeKey per current MiXCR output)\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR single-cell\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n];\n\nexport const platforma = BlockModelV3.create(blockDataModel)\n .args<BlockArgs>((data) => {\n if (data.inputAnchor === undefined) {\n throw new Error(\"Select an input dataset\");\n }\n return {\n inputAnchor: data.inputAnchor,\n };\n })\n .output(\"inputOptions\", (ctx) =>\n ctx.resultPool.getOptions(inputAnchorSpecs, { refsWithEnrichments: true }),\n )\n .output(\"inputSpec\", (ctx) =>\n ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : undefined,\n )\n .output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>())\n .output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n .output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle())\n .outputWithStatus(\"propertiesTable\", (ctx) => {\n if (ctx.data.inputAnchor === undefined) return undefined;\n const ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (ownCols === undefined) return undefined;\n // `coverageTier` is set in workflow/main.tpl.tengo and surfaced via the\n // `info` JSON resource. Allowed values are defined in types.ts::WorkflowInfo.\n // Gate on `info` so the table renders consistently with the chosen aa\n // column rather than briefly without it while `info` is still resolving.\n const info = ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>();\n if (info === undefined) return undefined;\n const tier = info.coverageTier;\n\n // Build sources explicitly: upstream cols from the result pool minus\n // anything traced back to this block, plus this block's own cols from\n // `propertiesPf`. The workflow also publishes `exports.properties` —\n // a blockId-stamped score-only variant for downstream consumers like\n // Lead Selection — into the result pool. Filtering by trace excludes\n // it here so score cols don't duplicate the propertiesPf variant.\n const upstreamCols = ctx.resultPool.selectColumns(\n (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\"),\n );\n const sources: ColumnSource[] = [\n new ArrayColumnProvider(upstreamCols),\n new ArrayColumnProvider(ownCols),\n ];\n\n return createPlDataTableV3(ctx, {\n tableState: ctx.data.tableState,\n columns: {\n sources,\n anchors: { main: ctx.data.inputAnchor },\n selector: { mode: \"enrichment\" },\n },\n // Default-visible: this block's columns + a single source amino-acid\n // sequence column matching the analysed coverage tier. Reviewer asked\n // for one sequence next to the properties — full-chain VDJRegion when\n // available (it contains the CDR3); CDR3 alone when that is all the\n // input has; peptide for peptide mode. Chain A (heavy / alpha / gamma)\n // only — chain B stays available via the column picker. Other upstream\n // cols → optional. This block's cols fall through unmatched and keep\n // their workflow-time `pl7.app/table/visibility` annotation.\n displayOptions: {\n visibility: [\n {\n match: (spec) => {\n if (spec.domain?.[\"pl7.app/vdj/scClonotypeChain/index\"] === \"secondary\") {\n return false;\n }\n if (spec.domain?.[\"pl7.app/alphabet\"] !== \"aminoacid\") return false;\n\n const isVdj = spec.name === \"pl7.app/vdj/sequence\";\n const isUniversal = spec.name === \"pl7.app/sequence\";\n if (!isVdj && !isUniversal) return false;\n\n const feature = isVdj\n ? spec.domain?.[\"pl7.app/vdj/feature\"]\n : spec.domain?.[\"pl7.app/feature\"];\n\n if (tier === \"peptide\") {\n return isUniversal && feature === \"peptide\";\n }\n\n const chain = spec.domain?.[\"pl7.app/vdj/scClonotypeChain\"];\n if (chain !== undefined && chain !== \"A\") return false;\n\n if (tier === \"full_chain\") {\n return feature === \"VDJRegion\" || feature === \"VDJRegionInFrame\";\n }\n if (tier === \"cdr3_only\" || tier === \"partial\") {\n return feature === \"CDR3\";\n }\n return false;\n },\n visibility: \"default\",\n },\n {\n match: (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ) && spec.annotations?.[\"pl7.app/isLinkerColumn\"] !== \"true\",\n visibility: \"optional\",\n },\n ],\n },\n });\n })\n .title(() => \"Sequence Properties\")\n .subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\")\n .sections(() => [{ type: \"link\" as const, href: \"/\" as const, label: \"Main\" }])\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\n"],"mappings":";;;;AAaA,MAAM,mBAAmB;CAEvB;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,sBAAsB,CAAC;EACpE,aAAa,EA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cjs","names":["BlockModelV3","blockDataModel","ArrayColumnProvider","Annotation"],"sources":["../src/index.ts"],"sourcesContent":["import type {\n ColumnSource,\n InferOutputsType,\n PColumnIdAndSpec,\n PFrameHandle,\n} from \"@platforma-sdk/model\";\nimport {\n Annotation,\n ArrayColumnProvider,\n BlockModelV3,\n createPlDataTableV3,\n} from \"@platforma-sdk/model\";\nimport { blockDataModel } from \"./dataModel\";\nimport type { BlockArgs, WorkflowInfo } from \"./types\";\n\nexport type * from \"@milaboratories/helpers\";\nexport { blockDataModel } from \"./dataModel\";\nexport type { BlockArgs, BlockData, WorkflowInfo, WorkflowMode, WorkflowReceptor } from \"./types\";\n\nconst inputAnchorSpecs = [\n // Peptide mode — universal naming\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR bulk (cloneId per spec; clonotypeKey per current MiXCR output)\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR single-cell\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n];\n\nexport const platforma = BlockModelV3.create(blockDataModel)\n .args<BlockArgs>((data) => {\n if (data.inputAnchor === undefined) {\n throw new Error(\"Select an input dataset\");\n }\n return {\n inputAnchor: data.inputAnchor,\n };\n })\n .output(\"inputOptions\", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs))\n .output(\"inputSpec\", (ctx) =>\n ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : undefined,\n )\n .output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>())\n .output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n .output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle())\n .outputWithStatus(\"propertiesTable\", (ctx) => {\n if (ctx.data.inputAnchor === undefined) return undefined;\n const ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (ownCols === undefined) return undefined;\n // `coverageTier` is set in workflow/main.tpl.tengo and surfaced via the\n // `info` JSON resource. Allowed values are defined in types.ts::WorkflowInfo.\n // Gate on `info` so the table renders consistently with the chosen aa\n // column rather than briefly without it while `info` is still resolving.\n const info = ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>();\n if (info === undefined) return undefined;\n const tier = info.coverageTier;\n\n // Build sources explicitly: upstream cols from the result pool minus\n // anything traced back to this block, plus this block's own cols from\n // `propertiesPf`. The workflow also publishes `exports.properties` —\n // a blockId-stamped score-only variant for downstream consumers like\n // Lead Selection — into the result pool. Filtering by trace excludes\n // it here so score cols don't duplicate the propertiesPf variant.\n const upstreamCols = ctx.resultPool.selectColumns(\n (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\"),\n );\n const sources: ColumnSource[] = [\n new ArrayColumnProvider(upstreamCols),\n new ArrayColumnProvider(ownCols),\n ];\n\n return createPlDataTableV3(ctx, {\n tableState: ctx.data.tableState,\n columns: {\n sources,\n anchors: { main: ctx.data.inputAnchor },\n selector: { mode: \"enrichment\" },\n },\n // Default-visible: this block's columns + a single source amino-acid\n // sequence column matching the analysed coverage tier. Reviewer asked\n // for one sequence next to the properties — full-chain VDJRegion when\n // available (it contains the CDR3); CDR3 alone when that is all the\n // input has; peptide for peptide mode. Chain A (heavy / alpha / gamma)\n // only — chain B stays available via the column picker. Other upstream\n // cols → optional. This block's cols fall through unmatched and keep\n // their workflow-time `pl7.app/table/visibility` annotation.\n displayOptions: {\n visibility: [\n {\n match: (spec) => {\n if (spec.domain?.[\"pl7.app/vdj/scClonotypeChain/index\"] === \"secondary\") {\n return false;\n }\n if (spec.domain?.[\"pl7.app/alphabet\"] !== \"aminoacid\") return false;\n\n const isVdj = spec.name === \"pl7.app/vdj/sequence\";\n const isUniversal = spec.name === \"pl7.app/sequence\";\n if (!isVdj && !isUniversal) return false;\n\n const feature = isVdj\n ? spec.domain?.[\"pl7.app/vdj/feature\"]\n : spec.domain?.[\"pl7.app/feature\"];\n\n if (tier === \"peptide\") {\n return isUniversal && feature === \"peptide\";\n }\n\n const chain = spec.domain?.[\"pl7.app/vdj/scClonotypeChain\"];\n if (chain !== undefined && chain !== \"A\") return false;\n\n if (tier === \"full_chain\") {\n return feature === \"VDJRegion\" || feature === \"VDJRegionInFrame\";\n }\n if (tier === \"cdr3_only\" || tier === \"partial\") {\n return feature === \"CDR3\";\n }\n return false;\n },\n visibility: \"default\",\n },\n {\n match: (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ) && spec.annotations?.[\"pl7.app/isLinkerColumn\"] !== \"true\",\n visibility: \"optional\",\n },\n ],\n },\n });\n })\n .outputWithStatus(\"propertiesPfHandle\", (ctx): PFrameHandle | undefined => {\n const allPCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (allPCols === undefined) return undefined;\n // Drop the AA fraction column from the pframe entirely. Two-axis\n // (variantKey × aminoAcid), at 50k peptides ~1M cells — enough to trip\n // graph-maker's cell-count guard on its own. The picker already excludes\n // it via `isNumericScalar` (axesSpec.length === 1), so the data was\n // pure overhead.\n const pCols = allPCols.filter((c) => c.spec.name !== \"pl7.app/aaFraction\");\n // Use `ctx.createPFrame` instead of `createPFrameForGraphs`. The latter\n // walks the result pool and pulls in this block's `exports.properties`\n // — a `trace.inject`-stamped re-emission of every column already in\n // `propertiesPf`, published for Lead Selection — so axis dropdowns\n // show e.g. \"Net Charge (pH7) / IG\" twice. Same workaround chosen by\n // cdr3-spectratype, batch-correction, cell-type-annotation, and\n // dimensionality-reduction.\n //\n // Pull single-axis metadata anchored to the input dataset's two axes\n // (idx 0 = sample, idx 1 = entity key) so sample groups / patient IDs /\n // peptide abundance and similar cols remain available for grouping and\n // filtering. Drop self-trace to keep our own exports out.\n const inputAnchor = ctx.data.inputAnchor;\n const upstreamMeta =\n inputAnchor !== undefined\n ? (\n ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [\n { axes: [{ anchor: \"main\", idx: 0 }] },\n { axes: [{ anchor: \"main\", idx: 1 }] },\n ]) ?? []\n ).filter(\n (c) =>\n !c.spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ),\n )\n : [];\n return ctx.createPFrame([...pCols, ...upstreamMeta]);\n })\n .output(\"propertiesPfCols\", (ctx): PColumnIdAndSpec[] | undefined => {\n const pCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (pCols === undefined) return undefined;\n return pCols.map((c) => ({ columnId: c.id, spec: c.spec }) satisfies PColumnIdAndSpec);\n })\n .title(() => \"Sequence Properties\")\n .subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\")\n .sections(() => [\n { type: \"link\", href: \"/\", label: \"Main\" },\n { type: \"link\", href: \"/scatter\", label: \"Property Relationships\" },\n { type: \"link\", href: \"/histogram\", label: \"Property Distribution\" },\n ])\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\n"],"mappings":";;;;AAmBA,MAAM,mBAAmB;CAEvB;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,sBAAsB,CAAC;EACpE,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CAED;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,uBAAuB,CAAC;EACrE,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CACD;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAA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,QAAQ;EAAQ,KAAK;EAAG,CAAC,EAAE,CACvC,CAAC,IAAI,EAAE,EACR,QACC,MACC,CAAC,EAAE,KAAK,cAAcA,qBAAAA,WAAW,QAAQ,SACvC,qCACD,CACJ,GACD,EAAE;AACR,QAAO,IAAI,aAAa,CAAC,GAAG,OAAO,GAAG,aAAa,CAAC;EACpD,CACD,OAAO,qBAAqB,QAAwC;CACnE,MAAM,QAAQ,IAAI,SAAS,QAAQ,eAAe,EAAE,aAAa;AACjE,KAAI,UAAU,KAAA,EAAW,QAAO,KAAA;AAChC,QAAO,MAAM,KAAK,OAAO;EAAE,UAAU,EAAE;EAAI,MAAM,EAAE;EAAM,EAA6B;EACtF,CACD,YAAY,sBAAsB,CAClC,UAAU,QAAQ,IAAI,KAAK,qBAAqB,GAAG,CACnD,eAAe;CACd;EAAE,MAAM;EAAQ,MAAM;EAAK,OAAO;EAAQ;CAC1C;EAAE,MAAM;EAAQ,MAAM;EAAY,OAAO;EAA0B;CACnE;EAAE,MAAM;EAAQ,MAAM;EAAc,OAAO;EAAyB;CACrE,CAAC,CACD,MAAM"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BlockArgs, BlockData, WorkflowInfo, WorkflowMode, WorkflowReceptor } from "./types.js";
|
|
2
2
|
import { blockDataModel } from "./dataModel.js";
|
|
3
3
|
import * as _$_platforma_sdk_model0 from "@platforma-sdk/model";
|
|
4
|
-
import { InferOutputsType } from "@platforma-sdk/model";
|
|
4
|
+
import { InferOutputsType, PFrameHandle } from "@platforma-sdk/model";
|
|
5
5
|
import * as _$_milaboratories_helpers0 from "@milaboratories/helpers";
|
|
6
|
+
export * from "@milaboratories/helpers";
|
|
6
7
|
|
|
7
8
|
//#region src/index.d.ts
|
|
8
9
|
declare const platforma: _$_platforma_sdk_model0.PlatformaExtended<_$_platforma_sdk_model0.PlatformaV3<BlockData, BlockArgs, _$_platforma_sdk_model0.InferOutputsFromLambdas<{
|
|
@@ -60,7 +61,7 @@ declare const platforma: _$_platforma_sdk_model0.PlatformaExtended<_$_platforma_
|
|
|
60
61
|
propertiesTable: _$_platforma_sdk_model0.ConfigRenderLambda<{
|
|
61
62
|
sourceId: null | string;
|
|
62
63
|
fullTableHandle?: _$_platforma_sdk_model0.PTableHandle | undefined;
|
|
63
|
-
fullPframeHandle?:
|
|
64
|
+
fullPframeHandle?: PFrameHandle | undefined;
|
|
64
65
|
visibleTableHandle?: _$_platforma_sdk_model0.PTableHandle | undefined;
|
|
65
66
|
defaultFilters?: _$_milaboratories_helpers0.Nil | {
|
|
66
67
|
type: "or";
|
|
@@ -1706,7 +1707,44 @@ declare const platforma: _$_platforma_sdk_model0.PlatformaExtended<_$_platforma_
|
|
|
1706
1707
|
} | undefined> & {
|
|
1707
1708
|
withStatus: true;
|
|
1708
1709
|
};
|
|
1709
|
-
}
|
|
1710
|
+
} & {
|
|
1711
|
+
propertiesPfHandle: _$_platforma_sdk_model0.ConfigRenderLambda<PFrameHandle | undefined> & {
|
|
1712
|
+
withStatus: true;
|
|
1713
|
+
};
|
|
1714
|
+
} & {
|
|
1715
|
+
propertiesPfCols: _$_platforma_sdk_model0.ConfigRenderLambda<{
|
|
1716
|
+
readonly columnId: _$_platforma_sdk_model0.PObjectId;
|
|
1717
|
+
readonly spec: {
|
|
1718
|
+
readonly kind: "PColumn";
|
|
1719
|
+
readonly name: string;
|
|
1720
|
+
readonly domain?: {
|
|
1721
|
+
[x: string]: string;
|
|
1722
|
+
} | undefined;
|
|
1723
|
+
readonly contextDomain?: {
|
|
1724
|
+
[x: string]: string;
|
|
1725
|
+
} | undefined;
|
|
1726
|
+
readonly annotations?: {
|
|
1727
|
+
[x: string]: string;
|
|
1728
|
+
} | undefined;
|
|
1729
|
+
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
1730
|
+
readonly parentAxes?: number[] | undefined;
|
|
1731
|
+
readonly axesSpec: {
|
|
1732
|
+
readonly type: _$_platforma_sdk_model0.AxisValueType;
|
|
1733
|
+
readonly name: string;
|
|
1734
|
+
readonly domain?: {
|
|
1735
|
+
[x: string]: string;
|
|
1736
|
+
} | undefined;
|
|
1737
|
+
readonly contextDomain?: {
|
|
1738
|
+
[x: string]: string;
|
|
1739
|
+
} | undefined;
|
|
1740
|
+
readonly annotations?: {
|
|
1741
|
+
[x: string]: string;
|
|
1742
|
+
} | undefined;
|
|
1743
|
+
readonly parentAxes?: number[] | undefined;
|
|
1744
|
+
}[];
|
|
1745
|
+
};
|
|
1746
|
+
}[] | undefined>;
|
|
1747
|
+
}>, "/" | "/scatter" | "/histogram", {}, _$_platforma_sdk_model0.BlockDefaultUiServices>>;
|
|
1710
1748
|
type BlockOutputs = InferOutputsType<typeof platforma>;
|
|
1711
1749
|
//#endregion
|
|
1712
1750
|
export { type BlockArgs, type BlockData, BlockOutputs, type WorkflowInfo, type WorkflowMode, type WorkflowReceptor, blockDataModel, platforma };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;cAyCa,SAAA,EAAS,uBAAA,CAAA,iBAAA,yBAAA,WAAA,CAyJb,SAAA,EAzJa,SAAA,0BAAA,uBAAA;gBAAA,uBAAA,CAAA,kBAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAAA,uBAAA,CAAA,sBAAA;AAAA,KA2JV,YAAA,GAAe,gBAAA,QAAwB,SAAA"}
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const inputAnchorSpecs = [
|
|
|
22
22
|
const platforma = BlockModelV3.create(blockDataModel).args((data) => {
|
|
23
23
|
if (data.inputAnchor === void 0) throw new Error("Select an input dataset");
|
|
24
24
|
return { inputAnchor: data.inputAnchor };
|
|
25
|
-
}).output("inputOptions", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs
|
|
25
|
+
}).output("inputOptions", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs)).output("inputSpec", (ctx) => ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : void 0).output("info", (ctx) => ctx.outputs?.resolve("info")?.getDataAsJson()).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).output("processingLog", (ctx) => ctx.outputs?.resolve("processingLog")?.getLogHandle()).outputWithStatus("propertiesTable", (ctx) => {
|
|
26
26
|
if (ctx.data.inputAnchor === void 0) return void 0;
|
|
27
27
|
const ownCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
28
28
|
if (ownCols === void 0) return void 0;
|
|
@@ -58,11 +58,43 @@ const platforma = BlockModelV3.create(blockDataModel).args((data) => {
|
|
|
58
58
|
visibility: "optional"
|
|
59
59
|
}] }
|
|
60
60
|
});
|
|
61
|
-
}).
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
}).outputWithStatus("propertiesPfHandle", (ctx) => {
|
|
62
|
+
const allPCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
63
|
+
if (allPCols === void 0) return void 0;
|
|
64
|
+
const pCols = allPCols.filter((c) => c.spec.name !== "pl7.app/aaFraction");
|
|
65
|
+
const inputAnchor = ctx.data.inputAnchor;
|
|
66
|
+
const upstreamMeta = inputAnchor !== void 0 ? (ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [{ axes: [{
|
|
67
|
+
anchor: "main",
|
|
68
|
+
idx: 0
|
|
69
|
+
}] }, { axes: [{
|
|
70
|
+
anchor: "main",
|
|
71
|
+
idx: 1
|
|
72
|
+
}] }]) ?? []).filter((c) => !c.spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties")) : [];
|
|
73
|
+
return ctx.createPFrame([...pCols, ...upstreamMeta]);
|
|
74
|
+
}).output("propertiesPfCols", (ctx) => {
|
|
75
|
+
const pCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
76
|
+
if (pCols === void 0) return void 0;
|
|
77
|
+
return pCols.map((c) => ({
|
|
78
|
+
columnId: c.id,
|
|
79
|
+
spec: c.spec
|
|
80
|
+
}));
|
|
81
|
+
}).title(() => "Sequence Properties").subtitle((ctx) => ctx.data.defaultBlockLabel ?? "").sections(() => [
|
|
82
|
+
{
|
|
83
|
+
type: "link",
|
|
84
|
+
href: "/",
|
|
85
|
+
label: "Main"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "link",
|
|
89
|
+
href: "/scatter",
|
|
90
|
+
label: "Property Relationships"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "link",
|
|
94
|
+
href: "/histogram",
|
|
95
|
+
label: "Property Distribution"
|
|
96
|
+
}
|
|
97
|
+
]).done();
|
|
66
98
|
//#endregion
|
|
67
99
|
export { blockDataModel, platforma };
|
|
68
100
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { ColumnSource, InferOutputsType } from \"@platforma-sdk/model\";\nimport {\n Annotation,\n ArrayColumnProvider,\n BlockModelV3,\n createPlDataTableV3,\n} from \"@platforma-sdk/model\";\nimport { blockDataModel } from \"./dataModel\";\nimport type { BlockArgs, WorkflowInfo } from \"./types\";\n\nexport type { BlockArgs, BlockData, WorkflowInfo, WorkflowMode, WorkflowReceptor } from \"./types\";\nexport { blockDataModel } from \"./dataModel\";\n\nconst inputAnchorSpecs = [\n // Peptide mode — universal naming\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR bulk (cloneId per spec; clonotypeKey per current MiXCR output)\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR single-cell\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n];\n\nexport const platforma = BlockModelV3.create(blockDataModel)\n .args<BlockArgs>((data) => {\n if (data.inputAnchor === undefined) {\n throw new Error(\"Select an input dataset\");\n }\n return {\n inputAnchor: data.inputAnchor,\n };\n })\n .output(\"inputOptions\", (ctx) =>\n ctx.resultPool.getOptions(inputAnchorSpecs, { refsWithEnrichments: true }),\n )\n .output(\"inputSpec\", (ctx) =>\n ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : undefined,\n )\n .output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>())\n .output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n .output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle())\n .outputWithStatus(\"propertiesTable\", (ctx) => {\n if (ctx.data.inputAnchor === undefined) return undefined;\n const ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (ownCols === undefined) return undefined;\n // `coverageTier` is set in workflow/main.tpl.tengo and surfaced via the\n // `info` JSON resource. Allowed values are defined in types.ts::WorkflowInfo.\n // Gate on `info` so the table renders consistently with the chosen aa\n // column rather than briefly without it while `info` is still resolving.\n const info = ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>();\n if (info === undefined) return undefined;\n const tier = info.coverageTier;\n\n // Build sources explicitly: upstream cols from the result pool minus\n // anything traced back to this block, plus this block's own cols from\n // `propertiesPf`. The workflow also publishes `exports.properties` —\n // a blockId-stamped score-only variant for downstream consumers like\n // Lead Selection — into the result pool. Filtering by trace excludes\n // it here so score cols don't duplicate the propertiesPf variant.\n const upstreamCols = ctx.resultPool.selectColumns(\n (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\"),\n );\n const sources: ColumnSource[] = [\n new ArrayColumnProvider(upstreamCols),\n new ArrayColumnProvider(ownCols),\n ];\n\n return createPlDataTableV3(ctx, {\n tableState: ctx.data.tableState,\n columns: {\n sources,\n anchors: { main: ctx.data.inputAnchor },\n selector: { mode: \"enrichment\" },\n },\n // Default-visible: this block's columns + a single source amino-acid\n // sequence column matching the analysed coverage tier. Reviewer asked\n // for one sequence next to the properties — full-chain VDJRegion when\n // available (it contains the CDR3); CDR3 alone when that is all the\n // input has; peptide for peptide mode. Chain A (heavy / alpha / gamma)\n // only — chain B stays available via the column picker. Other upstream\n // cols → optional. This block's cols fall through unmatched and keep\n // their workflow-time `pl7.app/table/visibility` annotation.\n displayOptions: {\n visibility: [\n {\n match: (spec) => {\n if (spec.domain?.[\"pl7.app/vdj/scClonotypeChain/index\"] === \"secondary\") {\n return false;\n }\n if (spec.domain?.[\"pl7.app/alphabet\"] !== \"aminoacid\") return false;\n\n const isVdj = spec.name === \"pl7.app/vdj/sequence\";\n const isUniversal = spec.name === \"pl7.app/sequence\";\n if (!isVdj && !isUniversal) return false;\n\n const feature = isVdj\n ? spec.domain?.[\"pl7.app/vdj/feature\"]\n : spec.domain?.[\"pl7.app/feature\"];\n\n if (tier === \"peptide\") {\n return isUniversal && feature === \"peptide\";\n }\n\n const chain = spec.domain?.[\"pl7.app/vdj/scClonotypeChain\"];\n if (chain !== undefined && chain !== \"A\") return false;\n\n if (tier === \"full_chain\") {\n return feature === \"VDJRegion\" || feature === \"VDJRegionInFrame\";\n }\n if (tier === \"cdr3_only\" || tier === \"partial\") {\n return feature === \"CDR3\";\n }\n return false;\n },\n visibility: \"default\",\n },\n {\n match: (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ) && spec.annotations?.[\"pl7.app/isLinkerColumn\"] !== \"true\",\n visibility: \"optional\",\n },\n ],\n },\n });\n })\n .title(() => \"Sequence Properties\")\n .subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\")\n .sections(() => [{ type: \"link\" as const, href: \"/\" as const, label: \"Main\" }])\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\n"],"mappings":";;;AAaA,MAAM,mBAAmB;CAEvB;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,sBAAsB,CAAC;EACpE,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CAED;EACE,M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BALe,IAAI,WAAW,eACjC,SACC,CAAC,KAAK,cAAc,WAAW,QAAQ,SAAS,qCAAqC,CACxF,CAEsC,EACrC,IAAI,oBAAoB,QAAQ,CACjC;AAED,QAAO,oBAAoB,KAAK;EAC9B,YAAY,IAAI,KAAK;EACrB,SAAS;GACP;GACA,SAAS,EAAE,MAAM,IAAI,KAAK,aAAa;GACvC,UAAU,EAAE,MAAM,cAAc;GACjC;EASD,gBAAgB,EACd,YAAY,CACV;GACE,QAAQ,SAAS;AACf,QAAI,KAAK,SAAS,0CAA0C,YAC1D,QAAO;AAET,QAAI,KAAK,SAAS,wBAAwB,YAAa,QAAO;IAE9D,MAAM,QAAQ,KAAK,SAAS;IAC5B,MAAM,cAAc,KAAK,SAAS;AAClC,QAAI,CAAC,SAAS,CAAC,YAAa,QAAO;IAEnC,MAAM,UAAU,QACZ,KAAK,SAAS,yBACd,KAAK,SAAS;AAElB,QAAI,SAAS,UACX,QAAO,eAAe,YAAY;IAGpC,MAAM,QAAQ,KAAK,SAAS;AAC5B,QAAI,UAAU,KAAA,KAAa,UAAU,IAAK,QAAO;AAEjD,QAAI,SAAS,aACX,QAAO,YAAY,eAAe,YAAY;AAEhD,QAAI,SAAS,eAAe,SAAS,UACnC,QAAO,YAAY;AAErB,WAAO;;GAET,YAAY;GACb,EACD;GACE,QAAQ,SACN,CAAC,KAAK,cAAc,WAAW,QAAQ,SACrC,qCACD,IAAI,KAAK,cAAc,8BAA8B;GACxD,YAAY;GACb,CACF,EACF;EACF,CAAC;EACF,CACD,YAAY,sBAAsB,CAClC,UAAU,QAAQ,IAAI,KAAK,qBAAqB,GAAG,CACnD,eAAe,CAAC;CAAE,MAAM;CAAiB,MAAM;CAAc,OAAO;CAAQ,CAAC,CAAC,CAC9E,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\n ColumnSource,\n InferOutputsType,\n PColumnIdAndSpec,\n PFrameHandle,\n} from \"@platforma-sdk/model\";\nimport {\n Annotation,\n ArrayColumnProvider,\n BlockModelV3,\n createPlDataTableV3,\n} from \"@platforma-sdk/model\";\nimport { blockDataModel } from \"./dataModel\";\nimport type { BlockArgs, WorkflowInfo } from \"./types\";\n\nexport type * from \"@milaboratories/helpers\";\nexport { blockDataModel } from \"./dataModel\";\nexport type { BlockArgs, BlockData, WorkflowInfo, WorkflowMode, WorkflowReceptor } from \"./types\";\n\nconst inputAnchorSpecs = [\n // Peptide mode — universal naming\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/variantKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR bulk (cloneId per spec; clonotypeKey per current MiXCR output)\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/cloneId\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/clonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n // Antibody/TCR — legacy MiXCR single-cell\n {\n axes: [{ name: \"pl7.app/sampleId\" }, { name: \"pl7.app/vdj/scClonotypeKey\" }],\n annotations: { \"pl7.app/isAnchor\": \"true\" },\n },\n];\n\nexport const platforma = BlockModelV3.create(blockDataModel)\n .args<BlockArgs>((data) => {\n if (data.inputAnchor === undefined) {\n throw new Error(\"Select an input dataset\");\n }\n return {\n inputAnchor: data.inputAnchor,\n };\n })\n .output(\"inputOptions\", (ctx) => ctx.resultPool.getOptions(inputAnchorSpecs))\n .output(\"inputSpec\", (ctx) =>\n ctx.data.inputAnchor ? ctx.resultPool.getPColumnSpecByRef(ctx.data.inputAnchor) : undefined,\n )\n .output(\"info\", (ctx) => ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>())\n .output(\"isRunning\", (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n .output(\"processingLog\", (ctx) => ctx.outputs?.resolve(\"processingLog\")?.getLogHandle())\n .outputWithStatus(\"propertiesTable\", (ctx) => {\n if (ctx.data.inputAnchor === undefined) return undefined;\n const ownCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (ownCols === undefined) return undefined;\n // `coverageTier` is set in workflow/main.tpl.tengo and surfaced via the\n // `info` JSON resource. Allowed values are defined in types.ts::WorkflowInfo.\n // Gate on `info` so the table renders consistently with the chosen aa\n // column rather than briefly without it while `info` is still resolving.\n const info = ctx.outputs?.resolve(\"info\")?.getDataAsJson<WorkflowInfo>();\n if (info === undefined) return undefined;\n const tier = info.coverageTier;\n\n // Build sources explicitly: upstream cols from the result pool minus\n // anything traced back to this block, plus this block's own cols from\n // `propertiesPf`. The workflow also publishes `exports.properties` —\n // a blockId-stamped score-only variant for downstream consumers like\n // Lead Selection — into the result pool. Filtering by trace excludes\n // it here so score cols don't duplicate the propertiesPf variant.\n const upstreamCols = ctx.resultPool.selectColumns(\n (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\"milaboratories.sequence-properties\"),\n );\n const sources: ColumnSource[] = [\n new ArrayColumnProvider(upstreamCols),\n new ArrayColumnProvider(ownCols),\n ];\n\n return createPlDataTableV3(ctx, {\n tableState: ctx.data.tableState,\n columns: {\n sources,\n anchors: { main: ctx.data.inputAnchor },\n selector: { mode: \"enrichment\" },\n },\n // Default-visible: this block's columns + a single source amino-acid\n // sequence column matching the analysed coverage tier. Reviewer asked\n // for one sequence next to the properties — full-chain VDJRegion when\n // available (it contains the CDR3); CDR3 alone when that is all the\n // input has; peptide for peptide mode. Chain A (heavy / alpha / gamma)\n // only — chain B stays available via the column picker. Other upstream\n // cols → optional. This block's cols fall through unmatched and keep\n // their workflow-time `pl7.app/table/visibility` annotation.\n displayOptions: {\n visibility: [\n {\n match: (spec) => {\n if (spec.domain?.[\"pl7.app/vdj/scClonotypeChain/index\"] === \"secondary\") {\n return false;\n }\n if (spec.domain?.[\"pl7.app/alphabet\"] !== \"aminoacid\") return false;\n\n const isVdj = spec.name === \"pl7.app/vdj/sequence\";\n const isUniversal = spec.name === \"pl7.app/sequence\";\n if (!isVdj && !isUniversal) return false;\n\n const feature = isVdj\n ? spec.domain?.[\"pl7.app/vdj/feature\"]\n : spec.domain?.[\"pl7.app/feature\"];\n\n if (tier === \"peptide\") {\n return isUniversal && feature === \"peptide\";\n }\n\n const chain = spec.domain?.[\"pl7.app/vdj/scClonotypeChain\"];\n if (chain !== undefined && chain !== \"A\") return false;\n\n if (tier === \"full_chain\") {\n return feature === \"VDJRegion\" || feature === \"VDJRegionInFrame\";\n }\n if (tier === \"cdr3_only\" || tier === \"partial\") {\n return feature === \"CDR3\";\n }\n return false;\n },\n visibility: \"default\",\n },\n {\n match: (spec) =>\n !spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ) && spec.annotations?.[\"pl7.app/isLinkerColumn\"] !== \"true\",\n visibility: \"optional\",\n },\n ],\n },\n });\n })\n .outputWithStatus(\"propertiesPfHandle\", (ctx): PFrameHandle | undefined => {\n const allPCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (allPCols === undefined) return undefined;\n // Drop the AA fraction column from the pframe entirely. Two-axis\n // (variantKey × aminoAcid), at 50k peptides ~1M cells — enough to trip\n // graph-maker's cell-count guard on its own. The picker already excludes\n // it via `isNumericScalar` (axesSpec.length === 1), so the data was\n // pure overhead.\n const pCols = allPCols.filter((c) => c.spec.name !== \"pl7.app/aaFraction\");\n // Use `ctx.createPFrame` instead of `createPFrameForGraphs`. The latter\n // walks the result pool and pulls in this block's `exports.properties`\n // — a `trace.inject`-stamped re-emission of every column already in\n // `propertiesPf`, published for Lead Selection — so axis dropdowns\n // show e.g. \"Net Charge (pH7) / IG\" twice. Same workaround chosen by\n // cdr3-spectratype, batch-correction, cell-type-annotation, and\n // dimensionality-reduction.\n //\n // Pull single-axis metadata anchored to the input dataset's two axes\n // (idx 0 = sample, idx 1 = entity key) so sample groups / patient IDs /\n // peptide abundance and similar cols remain available for grouping and\n // filtering. Drop self-trace to keep our own exports out.\n const inputAnchor = ctx.data.inputAnchor;\n const upstreamMeta =\n inputAnchor !== undefined\n ? (\n ctx.resultPool.getAnchoredPColumns({ main: inputAnchor }, [\n { axes: [{ anchor: \"main\", idx: 0 }] },\n { axes: [{ anchor: \"main\", idx: 1 }] },\n ]) ?? []\n ).filter(\n (c) =>\n !c.spec.annotations?.[Annotation.Trace]?.includes(\n \"milaboratories.sequence-properties\",\n ),\n )\n : [];\n return ctx.createPFrame([...pCols, ...upstreamMeta]);\n })\n .output(\"propertiesPfCols\", (ctx): PColumnIdAndSpec[] | undefined => {\n const pCols = ctx.outputs?.resolve(\"propertiesPf\")?.getPColumns();\n if (pCols === undefined) return undefined;\n return pCols.map((c) => ({ columnId: c.id, spec: c.spec }) satisfies PColumnIdAndSpec);\n })\n .title(() => \"Sequence Properties\")\n .subtitle((ctx) => ctx.data.defaultBlockLabel ?? \"\")\n .sections(() => [\n { type: \"link\", href: \"/\", label: \"Main\" },\n { type: \"link\", href: \"/scatter\", label: \"Property Relationships\" },\n { type: \"link\", href: \"/histogram\", label: \"Property Distribution\" },\n ])\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof platforma>;\n"],"mappings":";;;AAmBA,MAAM,mBAAmB;CAEvB;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,sBAAsB,CAAC;EACpE,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CAED;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,uBAAuB,CAAC;EACrE,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CACD;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,4BAA4B,CAAC;EAC1E,aAAa,EAAE,oBAAoB,QAAQ;EAC5C;CAED;EACE,MAAM,CAAC,EAAE,MAAM,oBAAoB,EAAE,EAAE,MAAM,8BAA8B,CAAC;EAC5E,aAAa,E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