@platforma-open/milaboratories.sequence-properties.model 1.2.2 → 1.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.sequence-properties.model",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -1,15 +1,9 @@
1
- import type {
2
- ColumnSource,
3
- InferOutputsType,
4
- PColumnIdAndSpec,
5
- PFrameHandle,
6
- } from "@platforma-sdk/model";
1
+ import type { InferOutputsType, PColumnIdAndSpec, PFrameHandle } from "@platforma-sdk/model";
7
2
  import {
8
3
  Annotation,
9
- ArrayColumnProvider,
10
4
  BlockModelV3,
11
5
  createPFrameForGraphs,
12
- createPlDataTableV3,
6
+ createPlDataTableV2,
13
7
  } from "@platforma-sdk/model";
14
8
  import { blockDataModel } from "./dataModel";
15
9
  import type { BlockArgs, WorkflowInfo } from "./types";
@@ -60,90 +54,14 @@ export const platforma = BlockModelV3.create(blockDataModel)
60
54
  if (ctx.data.inputAnchor === undefined) return undefined;
61
55
  const ownCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
62
56
  if (ownCols === undefined) return undefined;
63
- // `coverageTier` is set in workflow/main.tpl.tengo and surfaced via the
64
- // `info` JSON resource. Allowed values are defined in types.ts::WorkflowInfo.
65
- // Gate on `info` so the table renders consistently with the chosen aa
66
- // column rather than briefly without it while `info` is still resolving.
67
- const info = ctx.outputs?.resolve("info")?.getDataAsJson<WorkflowInfo>();
68
- if (info === undefined) return undefined;
69
- const tier = info.coverageTier;
70
-
71
- // Build sources explicitly: upstream cols from the result pool minus
72
- // anything traced back to this block, plus this block's own cols from
73
- // `propertiesPf`. The workflow also publishes `exports.properties` —
74
- // a blockId-stamped score-only variant for downstream consumers like
75
- // Lead Selection — into the result pool. Filtering by trace excludes
76
- // it here so score cols don't duplicate the propertiesPf variant.
77
- const upstreamCols = ctx.resultPool.selectColumns(
78
- (spec) =>
79
- !spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties"),
80
- );
81
- const sources: ColumnSource[] = [
82
- new ArrayColumnProvider(upstreamCols),
83
- new ArrayColumnProvider(ownCols),
84
- ];
85
-
86
- return createPlDataTableV3(ctx, {
87
- tableState: ctx.data.tableState,
88
- columns: {
89
- sources,
90
- anchors: { main: ctx.data.inputAnchor },
91
- selector: { mode: "enrichment" },
92
- },
93
- // Default-visible: this block's columns + a single source amino-acid
94
- // sequence column matching the analysed coverage tier. Reviewer asked
95
- // for one sequence next to the properties — full-chain VDJRegion when
96
- // available (it contains the CDR3); CDR3 alone when that is all the
97
- // input has; peptide for peptide mode. Chain A (heavy / alpha / gamma)
98
- // only — chain B stays available via the column picker. Other upstream
99
- // cols → optional. This block's cols fall through unmatched and keep
100
- // their workflow-time `pl7.app/table/visibility` annotation.
101
- displayOptions: {
102
- visibility: [
103
- {
104
- match: (spec) => {
105
- if (spec.domain?.["pl7.app/vdj/scClonotypeChain/index"] === "secondary") {
106
- return false;
107
- }
108
- if (spec.domain?.["pl7.app/alphabet"] !== "aminoacid") return false;
109
-
110
- const isVdj = spec.name === "pl7.app/vdj/sequence";
111
- const isUniversal = spec.name === "pl7.app/sequence";
112
- if (!isVdj && !isUniversal) return false;
113
-
114
- const feature = isVdj
115
- ? spec.domain?.["pl7.app/vdj/feature"]
116
- : spec.domain?.["pl7.app/feature"];
117
-
118
- if (tier === "peptide") {
119
- return isUniversal && feature === "peptide";
120
- }
121
-
122
- const chain = spec.domain?.["pl7.app/vdj/scClonotypeChain"];
123
- if (chain !== undefined && chain !== "A") return false;
124
-
125
- if (tier === "full_chain") {
126
- return feature === "VDJRegion" || feature === "VDJRegionInFrame";
127
- }
128
- if (tier === "cdr3_only" || tier === "partial") {
129
- return feature === "CDR3";
130
- }
131
- return false;
132
- },
133
- visibility: "default",
134
- },
135
- {
136
- match: (spec) =>
137
- !spec.annotations?.[Annotation.Trace]?.includes(
138
- "milaboratories.sequence-properties",
139
- ) &&
140
- spec.annotations?.["pl7.app/isLinkerColumn"] !== "true" &&
141
- spec.annotations?.["pl7.app/isOutput"] !== "true",
142
- visibility: "optional",
143
- },
144
- ],
145
- },
146
- });
57
+ // Temporary downgrade to V2 with a fixed, propertiesPf-only column list.
58
+ // V3 default-visibility rules and the column picker are not yet stable for
59
+ // the multi-source layout this block needs (upstream sequence column +
60
+ // own scalar properties). Once V3 supports it natively, rewire across
61
+ // blocks. aaFraction is 2-axis (variantKey × aminoAcid) — already filtered
62
+ // from the graph pFrame; filtered here too so it doesn't widen the table.
63
+ const tableCols = ownCols.filter((c) => c.spec.axesSpec.length === 1);
64
+ return createPlDataTableV2(ctx, tableCols, ctx.data.tableState);
147
65
  })
148
66
  .outputWithStatus("propertiesPfHandle", (ctx): PFrameHandle | undefined => {
149
67
  const allPCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();