@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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-check.log +4 -4
- package/CHANGELOG.md +14 -0
- package/dist/bundle.js +161 -1241
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +1 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -33
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +10 -92
package/package.json
CHANGED
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
|
-
|
|
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
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
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();
|