@platforma-open/milaboratories.mixcr-shm-trees.workflow 3.3.0 → 3.3.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,5 +1,5 @@
1
1
 
2
- > @platforma-open/milaboratories.mixcr-shm-trees.workflow@3.3.0 build /home/runner/work/mixcr-shm-trees/mixcr-shm-trees/workflow
2
+ > @platforma-open/milaboratories.mixcr-shm-trees.workflow@3.3.1 build /home/runner/work/mixcr-shm-trees/mixcr-shm-trees/workflow
3
3
  > rm -rf dist && pl-tengo check && pl-tengo build
4
4
 
5
5
  Processing "src/export-settings.lib.tengo"...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-open/milaboratories.mixcr-shm-trees.workflow
2
2
 
3
+ ## 3.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d8d8f49: Additional ensure uniqueness step in trees reconstruction workflow
8
+
3
9
  ## 3.3.0
4
10
 
5
11
  ### Minor Changes
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.mixcr-shm-trees.workflow",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "type": "module",
5
5
  "description": "Tengo-based template",
6
6
  "//": {
@@ -122,6 +122,7 @@ self.body(func(inputs) {
122
122
  {
123
123
  shmTreeTableArgs: shmTreeTableOptions.cmdArgs,
124
124
  shmTreeNodesTableOptions: shmTreeNodesTableOptions,
125
+ shmTreeNodesWithClonesTableOptions: shmTreeNodesWithClonesTableOptions,
125
126
  shmTreeNodesWithClonesTableArgs: shmTreeNodesWithClonesTableOptions.cmdArgs,
126
127
  globalParams: maps.merge(
127
128
  inputs.params,
@@ -194,37 +194,40 @@ self.body(func(inputs) {
194
194
 
195
195
  // aggregating by-nodes output to make it uniquely addressable by it's native key
196
196
 
197
- aggregations := []
198
- for col in inputs.shmTreeNodesTableOptions.pfconvParams.columns {
199
- aggregations = append(aggregations, {
200
- type: "first",
201
- src: col.column,
202
- dst: col.column
203
- })
204
- }
205
-
206
- keyColumns := []
207
- for axis in inputs.shmTreeNodesTableOptions.pfconvParams.axes {
208
- keyColumns = append(keyColumns, axis.column)
209
- }
210
-
211
- aggregationWorkflow := { steps: [ {
212
- type: "aggregate",
213
- groupBy: keyColumns,
214
- aggregations: aggregations
215
- } ] }
216
-
217
- aggregateCmd := exec.builder().
218
- printErrStreamToStdout().
219
- software(paggregateSw).
220
- arg("--workflow").arg("wf.json").
221
- writeFile("wf.json", json.encode(aggregationWorkflow)).
222
- arg("input.tsv").addFile("input.tsv", shmTreeNodesTsvRaw).
223
- arg("output.tsv").saveFile("output.tsv").
224
- run()
197
+ ensureUniqueness := func(inputTsv, pfConvParams) {
198
+ aggregations := []
199
+ for col in pfConvParams.columns {
200
+ aggregations = append(aggregations, {
201
+ type: "first",
202
+ src: col.column,
203
+ dst: col.column
204
+ })
205
+ }
206
+
207
+ keyColumns := []
208
+ for axis in pfConvParams.axes {
209
+ keyColumns = append(keyColumns, axis.column)
210
+ }
225
211
 
226
- shmTreeNodesTsv := aggregateCmd.getFile("output.tsv")
212
+ aggregationWorkflow := { steps: [ {
213
+ type: "aggregate",
214
+ groupBy: keyColumns,
215
+ aggregations: aggregations
216
+ } ] }
217
+
218
+ aggregateCmd := exec.builder().
219
+ printErrStreamToStdout().
220
+ software(paggregateSw).
221
+ arg("--workflow").arg("wf.json").
222
+ writeFile("wf.json", json.encode(aggregationWorkflow)).
223
+ arg("input.tsv").addFile("input.tsv", inputTsv).
224
+ arg("output.tsv").saveFile("output.tsv").
225
+ run()
226
+
227
+ return aggregateCmd.getFile("output.tsv")
228
+ }
227
229
 
230
+ shmTreeNodesTsv := ensureUniqueness(shmTreeNodesTsvRaw, inputs.shmTreeNodesTableOptions.pfconvParams)
228
231
 
229
232
  // export nodes with clones. For each node could be several clones
230
233
  shmTreeNodesWithClonesExportsCmdBuilder := exec.builder().
@@ -248,7 +251,9 @@ self.body(func(inputs) {
248
251
  saveFile("output.tsv")
249
252
 
250
253
  shmTreeNodesWithClonesExports := shmTreeNodesWithClonesExportsCmdBuilder.run()
251
- shmTreeNodesWithClonesTsv := shmTreeNodesWithClonesExports.getFile("output.tsv")
254
+ shmTreeNodesWithClonesTsvRaw := shmTreeNodesWithClonesExports.getFile("output.tsv")
255
+
256
+ shmTreeNodesWithClonesTsv := ensureUniqueness(shmTreeNodesWithClonesTsvRaw, inputs.shmTreeNodesWithClonesTableOptions.pfconvParams)
252
257
 
253
258
  return {
254
259
  trees: shmTreeTsv,