@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.4.0 → 2.5.0

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/mixcr-clonotyping-2/mixcr-clonotyping-2/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.4.0 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.5.0 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
4
4
  > rm -rf dist && pl-tengo check && pl-tengo build
5
5
 
6
6
  info: Skipping unknown file type: test/columns.test.ts
@@ -1,21 +1,21 @@
1
1
   WARN  Issue while reading "/home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.4.0 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.5.0 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
4
4
  > vitest
5
5
 
6
6
 
7
7
   RUN  v2.1.8 /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
8
8
 
9
- ✓ src/test/columns.test.ts (6 tests) 53559ms
10
- ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 12593ms
11
- ✓ checking preset for '10x-sc-xcr-vdj' 8579ms
12
- ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 8248ms
13
- ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 8275ms
14
- ✓ checking preset for 'rna-seq' 7833ms
15
- ✓ checking preset for 'generic-single-cell-gex' 8029ms
9
+ ✓ src/test/columns.test.ts (6 tests) 53188ms
10
+ ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 12934ms
11
+ ✓ checking preset for '10x-sc-xcr-vdj' 8323ms
12
+ ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 8051ms
13
+ ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 8026ms
14
+ ✓ checking preset for 'rna-seq' 7829ms
15
+ ✓ checking preset for 'generic-single-cell-gex' 8023ms
16
16
 
17
17
   Test Files  1 passed (1)
18
18
   Tests  6 passed (6)
19
-  Start at  07:35:16
20
-  Duration  54.39s (transform 48ms, setup 0ms, collect 581ms, tests 53.56s, environment 0ms, prepare 65ms)
19
+  Start at  09:32:55
20
+  Duration  53.99s (transform 41ms, setup 0ms, collect 564ms, tests 53.19s, environment 0ms, prepare 60ms)
21
21
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8643dbf: Output column signeture refactoring:
8
+ - chain and receptor information moved to clonotype key axis
9
+ - clonotypingRunId domain also moved to clonotype key axis
10
+
11
+ ## 2.4.1
12
+
13
+ ### Patch Changes
14
+
15
+ - cd6367a: Added UI control to select receptor or chain
16
+
3
17
  ## 2.4.0
4
18
 
5
19
  ### Minor Changes
@@ -530,30 +530,6 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
530
530
 
531
531
 
532
532
 
533
-
534
-
535
- columnsSpecPerSample = addSpec(columnsSpecPerSample, { spec: { domain: {
536
- "pl7.app/vdj/clonotypingRunId": blockId
537
- } } })
538
-
539
- columnsSpecPerSampleSc = addSpec(columnsSpecPerSampleSc, { spec: { domain: {
540
- "pl7.app/vdj/clonotypingRunId": blockId
541
- } } })
542
-
543
-
544
-
545
-
546
-
547
-
548
- columnsSpecPerClonotype = addSpec(columnsSpecPerClonotype, { spec: {
549
- domain: {
550
- "pl7.app/vdj/clonotypingRunId": blockId
551
- },
552
- annotations: {
553
- "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
554
- }
555
- } })
556
-
557
533
  columnsSpec := columnsSpecPerSample + columnsSpecPerClonotype
558
534
 
559
535
 
@@ -579,6 +555,11 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
579
555
  keyStrincture += [ toCombinedDomainValue(columnSpec.spec) ]
580
556
  }
581
557
 
558
+
559
+
560
+
561
+
562
+
582
563
  axesByClonotypeKey = [ {
583
564
  column: "clonotypeKey",
584
565
  naRegex: "",
@@ -586,12 +567,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
586
567
  name: "pl7.app/vdj/clonotypeKey",
587
568
  type: "String",
588
569
  domain: {
589
- "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture))
570
+ "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture)),
571
+ "pl7.app/vdj/clonotypingRunId": blockId
590
572
  },
591
573
  annotations: {
592
574
  "pl7.app/label": "Clonotype key",
593
575
  "pl7.app/table/visibility": "optional",
594
- "pl7.app/table/orderPriority": "110000"
576
+ "pl7.app/table/orderPriority": "110000",
577
+ "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
595
578
  }
596
579
  }
597
580
  } ]
@@ -608,12 +591,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
608
591
  name: "pl7.app/vdj/scClonotypeKey",
609
592
  type: "String",
610
593
  domain: {
611
- "pl7.app/vdj/scClonotypeKey/structure": string(json.encode(keyStrincture))
594
+ "pl7.app/vdj/scClonotypeKey/structure": string(json.encode(keyStrincture)),
595
+ "pl7.app/vdj/clonotypingRunId": blockId
612
596
  },
613
597
  annotations: {
614
598
  "pl7.app/label": "SC Clonotype key",
615
599
  "pl7.app/table/visibility": "optional",
616
- "pl7.app/table/orderPriority": "110000"
600
+ "pl7.app/table/orderPriority": "110000",
601
+ "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
617
602
  }
618
603
  }
619
604
  } ]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.mixcr-clonotyping-2.workflow",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Tengo-based template",
5
5
  "dependencies": {
6
6
  "@platforma-sdk/workflow-tengo": "^3.1.0",
@@ -530,30 +530,6 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
530
530
 
531
531
  // All columns are added
532
532
 
533
- // Adding block and segment annotations
534
-
535
- columnsSpecPerSample = addSpec(columnsSpecPerSample, { spec: { domain: {
536
- "pl7.app/vdj/clonotypingRunId": blockId
537
- } } })
538
-
539
- columnsSpecPerSampleSc = addSpec(columnsSpecPerSampleSc, { spec: { domain: {
540
- "pl7.app/vdj/clonotypingRunId": blockId
541
- } } })
542
-
543
- // "pl7.app/segmentedBy" annotation indicates columns that can be meaningfully merged across
544
- // different runs (given they have the same name and axes signature).
545
- // Its absence indicates that merging would be semantically meaningless (e.g., abundance
546
- // measurements specific to each analysis)
547
-
548
- columnsSpecPerClonotype = addSpec(columnsSpecPerClonotype, { spec: {
549
- domain: {
550
- "pl7.app/vdj/clonotypingRunId": blockId
551
- },
552
- annotations: {
553
- "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
554
- }
555
- } })
556
-
557
533
  columnsSpec := columnsSpecPerSample + columnsSpecPerClonotype
558
534
 
559
535
  // Creating a column map for fast search
@@ -579,6 +555,11 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
579
555
  keyStrincture += [ toCombinedDomainValue(columnSpec.spec) ]
580
556
  }
581
557
 
558
+ // "pl7.app/segmentedBy" annotation indicates columns that can be meaningfully merged across
559
+ // different runs (given they have the same name and axes signature).
560
+ // Its absence indicates that merging would be semantically meaningless (e.g., abundance
561
+ // measurements specific to each analysis)
562
+
582
563
  axesByClonotypeKey = [ {
583
564
  column: "clonotypeKey",
584
565
  naRegex: "",
@@ -586,12 +567,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
586
567
  name: "pl7.app/vdj/clonotypeKey",
587
568
  type: "String",
588
569
  domain: {
589
- "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture))
570
+ "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture)),
571
+ "pl7.app/vdj/clonotypingRunId": blockId
590
572
  },
591
573
  annotations: {
592
574
  "pl7.app/label": "Clonotype key",
593
575
  "pl7.app/table/visibility": "optional",
594
- "pl7.app/table/orderPriority": "110000"
576
+ "pl7.app/table/orderPriority": "110000",
577
+ "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
595
578
  }
596
579
  }
597
580
  } ]
@@ -608,12 +591,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
608
591
  name: "pl7.app/vdj/scClonotypeKey",
609
592
  type: "String",
610
593
  domain: {
611
- "pl7.app/vdj/scClonotypeKey/structure": string(json.encode(keyStrincture))
594
+ "pl7.app/vdj/scClonotypeKey/structure": string(json.encode(keyStrincture)),
595
+ "pl7.app/vdj/clonotypingRunId": blockId
612
596
  },
613
597
  annotations: {
614
598
  "pl7.app/label": "SC Clonotype key",
615
599
  "pl7.app/table/visibility": "optional",
616
- "pl7.app/table/orderPriority": "110000"
600
+ "pl7.app/table/orderPriority": "110000",
601
+ "pl7.app/segmentedBy": string(json.encode(["pl7.app/vdj/clonotypingRunId"]))
617
602
  }
618
603
  }
619
604
  } ]
@@ -88,9 +88,9 @@ wf.body(func(args) {
88
88
  presetSpecForBack := presetInfoResult.output("presetSpecForBack", 24 * 60 * 60 * 1000)
89
89
 
90
90
  // calculating chains
91
- // chains := ["IGHeavy", "IGLight", "TRAlpha", "TRBeta", "TRGamma", "TRDelta"]
91
+ // chains := ["IGHeavy", "IGLight", "TCRAlpha", "TCRBeta", "TCRGamma", "TCRDelta"]
92
92
  //receptorsOrChains := ["IG", "TCRAB", "TCRGD"]
93
- receptorsOrChains := ["IG"]
93
+ receptorsOrChains := ["IG", "TCRAB", "TCRGD"]
94
94
  if !is_undefined(args.chains) {
95
95
  receptorsOrChains = args.chains
96
96
  }
@@ -211,6 +211,14 @@ self.body(func(inputs) {
211
211
 
212
212
  mainAbundanceColumn := exportSpecs.mainAbundanceColumn
213
213
 
214
+ if is_undefined(axesByClonotypeKey) {
215
+ ll.panic("Absent clonotype key not supported")
216
+ }
217
+
218
+ if len(axesByClonotypeKey) != 1 || (!is_undefined(axesByScClonotypeKey) && len(axesByScClonotypeKey) != 1) {
219
+ ll.panic("Assertion error: expected exactly one clonotype key axis")
220
+ }
221
+
214
222
  mixcrResults := pframes.processColumn(
215
223
  { spec: inputSpec, data: inputs.inputData },
216
224
  mixcrAnalyzeTpl,
@@ -274,6 +282,10 @@ self.body(func(inputs) {
274
282
  chainInfo := chainInfos[chain]
275
283
  ll.assert(!is_undefined(chainInfo), "chainInfo not found for chain %v", chain)
276
284
 
285
+ axesByClonotypeKeyWithChain := [ maps.deepTransform(axesByClonotypeKey[0], {
286
+ spec: { domain: { "pl7.app/vdj/chain": chain } }
287
+ }) ]
288
+
277
289
  //
278
290
  // Exporting CLNS -> TSV
279
291
  //
@@ -292,16 +304,14 @@ self.body(func(inputs) {
292
304
  path: ["tsv"]
293
305
  } ]
294
306
 
295
- if !is_undefined(axesByClonotypeKey) && !isSingleCell {
307
+ if !isSingleCell {
296
308
  // only adding data outputs if we are in bulk mode
297
309
  exportOutputs += [ {
298
310
  type: "Xsv",
299
311
  xsvType: "tsv",
300
312
  settings: {
301
- axes: axesByClonotypeKey,
302
- columns: transformSpecs(columnsSpecPerSample, {
303
- spec: { domain: { "pl7.app/vdj/chain": chain } }
304
- }),
313
+ axes: axesByClonotypeKeyWithChain,
314
+ columns: columnsSpecPerSample,
305
315
  storageFormat: "Binary",
306
316
  partitionKeyLength: 0
307
317
  },
@@ -317,7 +327,8 @@ self.body(func(inputs) {
317
327
  kind: "PColumn",
318
328
  name: "mixcr.com/clonotypeTableForSingleCell",
319
329
  domain: {
320
- "pl7.app/vdj/clonotypingRunId": blockId
330
+ "pl7.app/vdj/clonotypingRunId": blockId,
331
+ "pl7.app/vdj/chain": chain
321
332
  },
322
333
  valueType: "File"
323
334
  },
@@ -372,10 +383,8 @@ self.body(func(inputs) {
372
383
  type: "Xsv",
373
384
  xsvType: "tsv",
374
385
  settings: {
375
- axes: axesByClonotypeKey,
376
- columns: transformSpecs(columnsSpecPerClonotype, {
377
- spec: { domain: { "pl7.app/vdj/chain": chain } }
378
- }),
386
+ axes: axesByClonotypeKeyWithChain,
387
+ columns: columnsSpecPerClonotype,
379
388
  storageFormat: "Binary",
380
389
  partitionKeyLength: 0
381
390
  },
@@ -418,6 +427,10 @@ self.body(func(inputs) {
418
427
  for receptor in receptors {
419
428
  receptorInfo := receptorInfos[receptor]
420
429
 
430
+ axesByScClonotypeKeyWithReceptor := [ maps.deepTransform(axesByScClonotypeKey[0], {
431
+ spec: { domain: { "pl7.app/vdj/receptor": receptor } }
432
+ }) ]
433
+
421
434
  singleCellOutputs := [ {
422
435
  type: "Resource",
423
436
  spec: {
@@ -437,10 +450,8 @@ self.body(func(inputs) {
437
450
  axes: [ {
438
451
  column: "sampleId",
439
452
  spec: inputSpec.axesSpec[0]
440
- } ] + axesByScClonotypeKey,
441
- columns: transformSpecs(columnsSpecPerSampleSc, {
442
- spec: { domain: { "pl7.app/vdj/receptor": receptor } }
443
- }),
453
+ } ] + axesByScClonotypeKeyWithReceptor,
454
+ columns: columnsSpecPerSampleSc,
444
455
  storageFormat: "Binary",
445
456
  partitionKeyLength: 1
446
457
  },
@@ -492,11 +503,10 @@ self.body(func(inputs) {
492
503
  type: "Xsv",
493
504
  xsvType: "tsv",
494
505
  settings: {
495
- axes: axesByScClonotypeKey,
506
+ axes: axesByScClonotypeKeyWithReceptor,
496
507
  columns: transformSpecs(columnsSpecPerClonotype, {
497
508
  spec: {
498
509
  domain: {
499
- "pl7.app/vdj/receptor": receptor,
500
510
  "pl7.app/vdj/scClonotypeChain": chainLetterU,
501
511
  "pl7.app/vdj/scClonotypeChain/index": pPrefixL
502
512
  },