@platforma-open/milaboratories.top-antibodies.workflow 1.14.1 → 1.15.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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.top-antibodies.workflow@1.14.1 build /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow
3
+ > @platforma-open/milaboratories.top-antibodies.workflow@1.15.1 build /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow
4
4
  > rm -rf dist && pl-tengo check && pl-tengo build
5
5
 
6
6
  Processing "src/assembling-fasta.tpl.tengo"...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @platforma-open/milaboratories.top-antibodies.workflow
2
2
 
3
+ ## 1.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5619236: Fix missing input related error
8
+ - Updated dependencies [5619236]
9
+ - @platforma-open/milaboratories.top-antibodies.sample-clonotypes@1.7.2
10
+
11
+ ## 1.15.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 00143a9: multiple clustering blocks fix, columns names fix, dependencies updates
16
+
3
17
  ## 1.14.1
4
18
 
5
19
  ### Patch Changes
Binary file
Binary file
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.top-antibodies.workflow",
3
- "version": "1.14.1",
3
+ "version": "1.15.1",
4
4
  "type": "module",
5
5
  "description": "Block Workflow",
6
6
  "dependencies": {
7
- "@platforma-sdk/workflow-tengo": "^5.6.4",
7
+ "@platforma-sdk/workflow-tengo": "^5.6.6",
8
8
  "@platforma-open/milaboratories.software-anarci": "^0.0.3",
9
- "@platforma-open/milaboratories.top-antibodies.sample-clonotypes": "1.7.1",
9
+ "@platforma-open/milaboratories.top-antibodies.sample-clonotypes": "1.7.2",
10
+ "@platforma-open/milaboratories.top-antibodies.spectratype": "1.7.1",
10
11
  "@platforma-open/milaboratories.top-antibodies.umap": "1.2.1",
11
- "@platforma-open/milaboratories.top-antibodies.anarci-kabat": "1.2.1",
12
12
  "@platforma-open/milaboratories.top-antibodies.assembling-fasta": "1.2.1",
13
- "@platforma-open/milaboratories.top-antibodies.spectratype": "1.7.1"
13
+ "@platforma-open/milaboratories.top-antibodies.anarci-kabat": "1.2.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@platforma-sdk/tengo-builder": "^2.3.14",
17
- "@platforma-sdk/test": "^1.46.3",
16
+ "@platforma-sdk/tengo-builder": "^2.4.1",
17
+ "@platforma-sdk/test": "^1.47.6",
18
18
  "vitest": "^2.1.8"
19
19
  },
20
20
  "scripts": {
@@ -136,7 +136,8 @@ wf.body(func(args) {
136
136
  addedCols := false
137
137
  if len(args.filters) > 0 {
138
138
  for i, filter in args.filters {
139
- if filter.value != undefined {
139
+ // we check for value presence and for actual pcolumn (cases where upstream block is deleted)
140
+ if filter.value != undefined && columns.getColumn(filter.value.column).spec != undefined {
140
141
  // Columns added here might also be in ranking list, so we add default IDs
141
142
  cloneTable.add(columns.getColumn(filter.value.column),
142
143
  {header: "Filter_" + string(i), id: "filter_" + string(i)})
@@ -164,7 +165,8 @@ wf.body(func(args) {
164
165
  validRanks := false
165
166
  if len(args.rankingOrder) > 0 {
166
167
  for i, col in args.rankingOrder {
167
- if col.value != undefined {
168
+ // we check for value presence and for actual pcolumn (cases where upstream block is deleted)
169
+ if col.value != undefined && columns.getColumn(col.value.column).spec != undefined {
168
170
  validRanks = true
169
171
  cloneTable.add(columns.getColumn(col.value.column), {header: "Col" + string(i)})
170
172
  addedCols = true
@@ -210,31 +212,96 @@ wf.body(func(args) {
210
212
 
211
213
  // Get linker columns if needed
212
214
  linkerAxisSpec := {}
215
+ linkerClusterIdAxes := []
213
216
  if len(columns.getColumns("linkers")) > 0 {
214
217
  for i, col in columns.getColumns("linkers") {
218
+ clusterIdAxis := undefined
215
219
  if datasetSpec.axesSpec[1].name == col.spec.axesSpec[1].name {
216
220
  cloneTable.add(col, {header: "linker." + string(i)})
217
221
  cloneTable.setAxisHeader(col.spec.axesSpec[0], "cluster_" + string(i))
218
222
  linkerAxisSpec["cluster_" + string(i)] = col.spec.axesSpec[0]
223
+ clusterIdAxis = col.spec.axesSpec[0]
219
224
  } else if datasetSpec.axesSpec[1].name == col.spec.axesSpec[0].name {
220
225
  cloneTable.add(col, {header: "linker." + string(i)})
221
226
  cloneTable.setAxisHeader(col.spec.axesSpec[1], "cluster_" + string(i))
222
227
  linkerAxisSpec["cluster_" + string(i)] = col.spec.axesSpec[1]
228
+ clusterIdAxis = col.spec.axesSpec[1]
229
+ }
230
+ // Collect clusterId axes from linker columns to match cluster size columns
231
+ if !is_undefined(clusterIdAxis) && clusterIdAxis.name == "pl7.app/vdj/clusterId" {
232
+ linkerClusterIdAxes = append(linkerClusterIdAxes, clusterIdAxis)
223
233
  }
224
234
  addedCols = true
225
235
  }
226
236
  }
227
237
 
228
- // Add cluster size columns if available
238
+ // Add cluster size columns if available, but only those matching linker columns' clusterId axes
239
+ // This ensures we only join columns from the same clustering run
229
240
  if len(columns.getColumns("clusterSizes")) > 0 {
230
- for i, col in columns.getColumns("clusterSizes") {
231
- cloneTable.add(col, {header: "clusterSize." + string(i)})
232
- addedCols = true
233
- // Add the cluster axis header
234
- for axisIdx, axis in col.spec.axesSpec {
235
- if axis.name != datasetSpec.axesSpec[1].name {
236
- cloneTable.setAxisHeader(axis, "clusterAxis_" + string(i) + "_" + string(axisIdx))
241
+ clusterSizeIdx := 0
242
+ for col in columns.getColumns("clusterSizes") {
243
+ // Find the clusterId axis in this cluster size column
244
+ clusterSizeClusterIdAxis := undefined
245
+ for axis in col.spec.axesSpec {
246
+ if axis.name == "pl7.app/vdj/clusterId" {
247
+ clusterSizeClusterIdAxis = axis
248
+ break
249
+ }
250
+ }
251
+
252
+ // Only add if we have linker columns and this cluster size matches one of them
253
+ shouldAdd := false
254
+ if len(linkerClusterIdAxes) > 0 && !is_undefined(clusterSizeClusterIdAxis) {
255
+ // Check if this cluster size column matches any linker's clusterId axis
256
+ for linkerAxis in linkerClusterIdAxes {
257
+ // Compare domains - they must match exactly for same clustering run
258
+ if clusterSizeClusterIdAxis.name == linkerAxis.name &&
259
+ clusterSizeClusterIdAxis.type == linkerAxis.type {
260
+ // Check if domains match
261
+ domainsMatch := true
262
+ if is_undefined(clusterSizeClusterIdAxis.domain) != is_undefined(linkerAxis.domain) {
263
+ domainsMatch = false
264
+ } else if !is_undefined(clusterSizeClusterIdAxis.domain) && !is_undefined(linkerAxis.domain) {
265
+ // Compare domain keys and values
266
+ if len(clusterSizeClusterIdAxis.domain) != len(linkerAxis.domain) {
267
+ domainsMatch = false
268
+ } else {
269
+ for k, v in clusterSizeClusterIdAxis.domain {
270
+ if is_undefined(linkerAxis.domain[k]) || linkerAxis.domain[k] != v {
271
+ domainsMatch = false
272
+ break
273
+ }
274
+ }
275
+ }
276
+ }
277
+ if domainsMatch {
278
+ shouldAdd = true
279
+ break
280
+ }
281
+ }
282
+ }
283
+ }
284
+
285
+ // Only add cluster size columns that match a linker column's clustering run
286
+ if shouldAdd {
287
+ // Trace elements are already present in col.spec from the clustering block.
288
+ // deriveLabels (in label.ts) will use these existing trace elements to construct
289
+ // distinguishing labels when multiple clustering blocks are joined, similar to
290
+ // how LabelTypeFull ('__LABEL__@1') works. The trace includes:
291
+ // - Original dataset trace
292
+ // - "milaboratories.clonotype-clustering.sequences" trace element
293
+ // - "milaboratories.clonotype-clustering.clustering" trace element
294
+ // No modification needed - just preserve the existing trace.
295
+
296
+ cloneTable.add(col, {header: "clusterSize." + string(clusterSizeIdx)})
297
+ addedCols = true
298
+ // Add the cluster axis header
299
+ for axisIdx, axis in col.spec.axesSpec {
300
+ if axis.name != datasetSpec.axesSpec[1].name {
301
+ cloneTable.setAxisHeader(axis, "clusterAxis_" + string(clusterSizeIdx) + "_" + string(axisIdx))
302
+ }
237
303
  }
304
+ clusterSizeIdx = clusterSizeIdx + 1
238
305
  }
239
306
  }
240
307
  }