@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.0.0 → 2.0.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-clonotyping-2.workflow@2.0.0 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
2
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.0.1 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
3
  > rm -rf dist && pl-tengo check && pl-tengo build
4
4
 
5
5
  Processing "src/aggregate-by-clonotype-key.tpl.tengo"...
@@ -1,20 +1,20 @@
1
1
 
2
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.0.0 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
2
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.0.1 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
3
  > vitest
4
4
 
5
5
 
6
6
   RUN  v2.1.8 /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
7
7
 
8
- ✓ src/test/columns.test.ts (6 tests) 48242ms
9
- ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 11740ms
10
- ✓ checking preset for '10x-sc-xcr-vdj' 7636ms
11
- ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 7348ms
12
- ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 7318ms
13
- ✓ checking preset for 'rna-seq' 7099ms
14
- ✓ checking preset for 'generic-single-cell-gex' 7100ms
8
+ ✓ src/test/columns.test.ts (6 tests) 47946ms
9
+ ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 11920ms
10
+ ✓ checking preset for '10x-sc-xcr-vdj' 7407ms
11
+ ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 7323ms
12
+ ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 7314ms
13
+ ✓ checking preset for 'rna-seq' 6897ms
14
+ ✓ checking preset for 'generic-single-cell-gex' 7083ms
15
15
 
16
16
   Test Files  1 passed (1)
17
17
   Tests  6 passed (6)
18
-  Start at  16:45:52
19
-  Duration  48.98s (transform 48ms, setup 0ms, collect 509ms, tests 48.24s, environment 0ms, prepare 63ms)
18
+  Start at  11:38:19
19
+  Duration  48.72s (transform 43ms, setup 0ms, collect 544ms, tests 47.95s, environment 0ms, prepare 72ms)
20
20
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6c45177: Chain is added to output columns domain
8
+ - Updated dependencies [6c45177]
9
+ - @platforma-open/milaboratories.mixcr-clonotyping-2.sc-clonotype-builder@1.0.1
10
+
3
11
  ## 2.0.0
4
12
 
5
13
  ### Major Changes
@@ -107,37 +107,37 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
107
107
 
108
108
 
109
109
  columnsSpecPerSample += [ {
110
- column: "readCount",
111
- id: "read-count",
112
- allowNA: false,
113
- spec: {
114
- name: "pl7.app/vdj/readCount",
115
- valueType: "Long",
116
- annotations: a(90000, !hasUmi, {
117
- "pl7.app/min": "1",
118
- "pl7.app/isAbundance": "true",
119
- "pl7.app/abundance/unit": "reads",
120
- "pl7.app/abundance/normalized": "false",
121
- "pl7.app/label": "Number Of Reads"
122
- })
123
- }
124
- }, {
125
- column: "readFraction",
126
- id: "read-fraction",
127
- allowNA: false,
128
- spec: {
129
- name: "pl7.app/vdj/readFraction",
130
- valueType: "Double",
131
- annotations: a(89000, !hasUmi, {
132
- "pl7.app/min": "0",
133
- "pl7.app/max": "1",
134
- "pl7.app/isAbundance": "true",
135
- "pl7.app/abundance/unit": "reads",
136
- "pl7.app/abundance/normalized": "true",
137
- "pl7.app/label": "Fraction of reads"
138
- })
139
- }
140
- } ]
110
+ column: "readCount",
111
+ id: "read-count",
112
+ allowNA: false,
113
+ spec: {
114
+ name: "pl7.app/vdj/readCount",
115
+ valueType: "Long",
116
+ annotations: a(90000, !hasUmi, {
117
+ "pl7.app/min": "1",
118
+ "pl7.app/isAbundance": "true",
119
+ "pl7.app/abundance/unit": "reads",
120
+ "pl7.app/abundance/normalized": "false",
121
+ "pl7.app/label": "Number Of Reads"
122
+ })
123
+ }
124
+ }, {
125
+ column: "readFraction",
126
+ id: "read-fraction",
127
+ allowNA: false,
128
+ spec: {
129
+ name: "pl7.app/vdj/readFraction",
130
+ valueType: "Double",
131
+ annotations: a(89000, !hasUmi, {
132
+ "pl7.app/min": "0",
133
+ "pl7.app/max": "1",
134
+ "pl7.app/isAbundance": "true",
135
+ "pl7.app/abundance/unit": "reads",
136
+ "pl7.app/abundance/normalized": "true",
137
+ "pl7.app/label": "Fraction of reads"
138
+ })
139
+ }
140
+ } ]
141
141
  exportArgs += [
142
142
  [ "-readCount" ],
143
143
  [ "-readFraction" ]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.mixcr-clonotyping-2.workflow",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Tengo-based template",
5
+ "dependencies": {
6
+ "@platforma-open/milaboratories.mixcr-clonotyping-2.sc-clonotype-builder": "1.0.1"
7
+ },
5
8
  "devDependencies": {
6
9
  "@platforma-sdk/tengo-builder": "^1.19.2",
7
- "@platforma-sdk/workflow-tengo": "^2.15.4",
10
+ "@platforma-sdk/workflow-tengo": "^2.15.6",
8
11
  "@milaboratories/software-pframes-conv": "2.1.16",
9
- "@platforma-open/milaboratories.software-small-binaries": "^1.15.11",
12
+ "@platforma-open/milaboratories.software-small-binaries": "^1.15.15",
10
13
  "@platforma-open/milaboratories.software-mixcr": "4.7.0-147-develop",
11
14
  "@platforma-open/milaboratories.software-ptransform": "^1.3.1",
12
- "@platforma-sdk/test": "^1.22.84",
15
+ "@platforma-sdk/test": "^1.22.87",
13
16
  "vitest": "^2.1.8",
14
17
  "typescript": "~5.5.4"
15
18
  },
@@ -107,37 +107,37 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
107
107
  // Abundance
108
108
 
109
109
  columnsSpecPerSample += [ {
110
- column: "readCount",
111
- id: "read-count",
112
- allowNA: false,
113
- spec: {
114
- name: "pl7.app/vdj/readCount",
115
- valueType: "Long",
116
- annotations: a(90000, !hasUmi, {
117
- "pl7.app/min": "1",
118
- "pl7.app/isAbundance": "true",
119
- "pl7.app/abundance/unit": "reads",
120
- "pl7.app/abundance/normalized": "false",
121
- "pl7.app/label": "Number Of Reads"
122
- })
123
- }
124
- }, {
125
- column: "readFraction",
126
- id: "read-fraction",
127
- allowNA: false,
128
- spec: {
129
- name: "pl7.app/vdj/readFraction",
130
- valueType: "Double",
131
- annotations: a(89000, !hasUmi, {
132
- "pl7.app/min": "0",
133
- "pl7.app/max": "1",
134
- "pl7.app/isAbundance": "true",
135
- "pl7.app/abundance/unit": "reads",
136
- "pl7.app/abundance/normalized": "true",
137
- "pl7.app/label": "Fraction of reads"
138
- })
139
- }
140
- } ]
110
+ column: "readCount",
111
+ id: "read-count",
112
+ allowNA: false,
113
+ spec: {
114
+ name: "pl7.app/vdj/readCount",
115
+ valueType: "Long",
116
+ annotations: a(90000, !hasUmi, {
117
+ "pl7.app/min": "1",
118
+ "pl7.app/isAbundance": "true",
119
+ "pl7.app/abundance/unit": "reads",
120
+ "pl7.app/abundance/normalized": "false",
121
+ "pl7.app/label": "Number Of Reads"
122
+ })
123
+ }
124
+ }, {
125
+ column: "readFraction",
126
+ id: "read-fraction",
127
+ allowNA: false,
128
+ spec: {
129
+ name: "pl7.app/vdj/readFraction",
130
+ valueType: "Double",
131
+ annotations: a(89000, !hasUmi, {
132
+ "pl7.app/min": "0",
133
+ "pl7.app/max": "1",
134
+ "pl7.app/isAbundance": "true",
135
+ "pl7.app/abundance/unit": "reads",
136
+ "pl7.app/abundance/normalized": "true",
137
+ "pl7.app/label": "Fraction of reads"
138
+ })
139
+ }
140
+ } ]
141
141
  exportArgs += [
142
142
  [ "-readCount" ],
143
143
  [ "-readFraction" ]
@@ -93,13 +93,7 @@ wf.body(func(args) {
93
93
  presetSpecForBack := presetInfoResult.output("presetSpecForBack", 24 * 60 * 60 * 1000)
94
94
 
95
95
  // calculating chains
96
- chains := [
97
- { name: "IGH", mixcrChain: "IGH" },
98
- { name: "IGKL", mixcrChain: "IGK,IGL" },
99
- { name: "TRA", mixcrChain: "TRA" },
100
- { name: "TRB", mixcrChain: "TRB" },
101
- { name: "TRD", mixcrChain: "TRD" },
102
- { name: "TRG", mixcrChain: "TRG" } ]
96
+ chains := ["IGHeavy", "IGLight", "TRA", "TRB", "TRD", "TRG"]
103
97
 
104
98
  runMixcr := render.createEphemeral(processTpl, {
105
99
  inputSpec: input.getFutureInputField("spec"),
@@ -7,6 +7,7 @@ assets := import("@platforma-sdk/workflow-tengo:assets")
7
7
  pframes := import("@platforma-sdk/workflow-tengo:pframes")
8
8
  smart := import("@platforma-sdk/workflow-tengo:smart")
9
9
  slices := import("@platforma-sdk/workflow-tengo:slices")
10
+ maps := import("@platforma-sdk/workflow-tengo:maps")
10
11
  file := import("@platforma-sdk/workflow-tengo:file")
11
12
  llPFrames := import("@platforma-sdk/workflow-tengo:pframes.ll")
12
13
  pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
@@ -28,6 +29,21 @@ self.awaitState("inputSpec", "ResourceReady")
28
29
  self.awaitState("presetSpecForBack", "ResourceReady")
29
30
  self.awaitState("presetContent", "ResourceReady")
30
31
 
32
+ chainInfos := {
33
+ "IGHeavy": { mixcrFilter: "IGH", name: "IG Heavy" },
34
+ "IGLight": { mixcrFilter: "IGK,IGL", name: "IG Light" },
35
+ "TRA": { mixcrFilter: "TRA", name: "TRA" },
36
+ "TRB": { mixcrFilter: "TRB", name: "TRB" },
37
+ "TRD": { mixcrFilter: "TRD", name: "TRD" },
38
+ "TRG": { mixcrFilter: "TRG", name: "TRG" }
39
+ }
40
+
41
+ receptorInfo := {
42
+ "IG": { chains: ["IGHeavy", "IGLight"], name: "IG" },
43
+ "TRAB": { chains: ["TRB", "TRA"], name: "TRAB" },
44
+ "TRGD": { chains: ["TRD", "TRG"], name: "TRGD" }
45
+ }
46
+
31
47
  self.body(func(inputs) {
32
48
 
33
49
  inputSpec := inputs.inputSpec
@@ -225,6 +241,22 @@ self.body(func(inputs) {
225
241
  clonotypes := pframes.pFrameBuilder()
226
242
 
227
243
  for chain in chains {
244
+ chainInfo := chainInfos[chain]
245
+ additionalSpec := {
246
+ spec: {
247
+ domain: {
248
+ "pl7.app/chain": chain
249
+ }
250
+ }
251
+ }
252
+ columnSpecsTransform := func(specs) {
253
+ return slices.map(specs, func(spec) {
254
+ return maps.deepMerge(spec, additionalSpec)
255
+ })
256
+ }
257
+
258
+ traceSteps := [{type: "milaboratories.mixcr-clonotyping.export", id: blockId + "." + chain, importance: 80, label: chainInfo.name}]
259
+
228
260
  exportOutputs := [ {
229
261
  type: "Resource",
230
262
  spec: {
@@ -237,17 +269,6 @@ self.body(func(inputs) {
237
269
  },
238
270
  name: "clonotypeTable",
239
271
  path: ["tsv"]
240
- // }, {
241
- // type: "Xsv",
242
- // xsvType: "tsv",
243
- // settings: {
244
- // axes: axesByClonotypeId,
245
- // columns: columnsSpec,
246
- // storageFormat: "Binary",
247
- // partitionKeyLength: 0
248
- // },
249
- // name: "byCloneId",
250
- // path: ["tsv"]
251
272
  } ]
252
273
 
253
274
  if !is_undefined(axesByClonotypeKey) {
@@ -256,7 +277,7 @@ self.body(func(inputs) {
256
277
  xsvType: "tsv",
257
278
  settings: {
258
279
  axes: axesByClonotypeKey,
259
- columns: columnsSpecPerSample,
280
+ columns: columnSpecsTransform(columnsSpecPerSample),
260
281
  storageFormat: "Binary",
261
282
  partitionKeyLength: 0
262
283
  },
@@ -271,11 +292,11 @@ self.body(func(inputs) {
271
292
  exportOutputs,
272
293
  {
273
294
  // will be automatically propagated to all output specs
274
- traceSteps: [{type: "milaboratories.mixcr-clonotyping.export", id: blockId + "." + chain.name, importance: 80, label: chain.name}],
295
+ traceSteps: traceSteps,
275
296
 
276
297
  extra: {
277
298
  params: {
278
- chains: chain.mixcrChain,
299
+ chains: chainInfo.mixcrFilter,
279
300
  clonotypeKeyColumns: clonotypeKeyColumns,
280
301
  exportArgs: exportArgs
281
302
  }
@@ -283,15 +304,14 @@ self.body(func(inputs) {
283
304
  }
284
305
  )
285
306
 
286
- // exportResults.addXsvOutputToBuilder(clonotypes, "byCloneId", "byCloneId/" + chain.name + "/")
287
- exportResults.addXsvOutputToBuilder(clonotypes, "byCloneKeyBySample", "byCloneKeyBySample/" + chain.name + "/")
307
+ exportResults.addXsvOutputToBuilder(clonotypes, "byCloneKeyBySample", "byCloneKeyBySample/" + chain + "/")
288
308
 
289
309
  aggregationOutputs := [ {
290
310
  type: "Xsv",
291
311
  xsvType: "tsv",
292
312
  settings: {
293
313
  axes: axesByClonotypeKey,
294
- columns: columnsSpecPerClonotype,
314
+ columns: columnSpecsTransform(columnsSpecPerClonotype),
295
315
  storageFormat: "Binary",
296
316
  partitionKeyLength: 0
297
317
  },
@@ -316,7 +336,7 @@ self.body(func(inputs) {
316
336
  }
317
337
  )
318
338
 
319
- aggregateByCloneKey.addXsvOutputToBuilder(clonotypes, "byCloneKey", "byCloneKey/" + chain.name + "/")
339
+ aggregateByCloneKey.addXsvOutputToBuilder(clonotypes, "byCloneKey", "byCloneKey/" + chain + "/")
320
340
  }
321
341
 
322
342
  return {