@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.2.1 → 2.3.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,7 +1,8 @@
1
1
 
2
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.2.1 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
2
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.3.0 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
+ info: Skipping unknown file type: test/columns.test.ts
5
6
  Processing "src/aggregate-by-clonotype-key.tpl.tengo"...
6
7
  Processing "src/calculate-export-specs.lib.tengo"...
7
8
  Processing "src/calculate-preset-info.tpl.tengo"...
@@ -10,10 +11,12 @@ Processing "src/main.tpl.tengo"...
10
11
  Processing "src/mixcr-analyze.tpl.tengo"...
11
12
  Processing "src/mixcr-export.tpl.tengo"...
12
13
  Processing "src/prerun.tpl.tengo"...
14
+ Processing "src/process-single-cell.tpl.tengo"...
13
15
  Processing "src/process.tpl.tengo"...
14
16
  Processing "src/test/columns-calculate.tpl.tengo"...
15
17
  Processing "src/test/columns.test.tpl.tengo"...
16
18
  No syntax errors found.
19
+ info: Skipping unknown file type: test/columns.test.ts
17
20
  info: Compiling 'dist'...
18
21
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/lib/calculate-export-specs.lib.tengo
19
22
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/aggregate-by-clonotype-key.plj.gz
@@ -22,6 +25,7 @@ No syntax errors found.
22
25
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/mixcr-analyze.plj.gz
23
26
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/mixcr-export.plj.gz
24
27
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/prerun.plj.gz
28
+ info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/process-single-cell.plj.gz
25
29
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/process.plj.gz
26
30
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/test.columns-calculate.plj.gz
27
31
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/test.columns.test.plj.gz
@@ -1,20 +1,20 @@
1
1
 
2
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.2.1 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
2
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.3.0 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) 51634ms
9
- ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 15376ms
10
- ✓ checking preset for '10x-sc-xcr-vdj' 7604ms
11
- ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 7327ms
12
- ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 7321ms
13
- ✓ checking preset for 'rna-seq' 6911ms
14
- ✓ checking preset for 'generic-single-cell-gex' 7094ms
8
+ ✓ src/test/columns.test.ts (6 tests) 48797ms
9
+ ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 11601ms
10
+ ✓ checking preset for '10x-sc-xcr-vdj' 7631ms
11
+ ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 7583ms
12
+ ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 7661ms
13
+ ✓ checking preset for 'rna-seq' 6966ms
14
+ ✓ checking preset for 'generic-single-cell-gex' 7354ms
15
15
 
16
16
   Test Files  1 passed (1)
17
17
   Tests  6 passed (6)
18
-  Start at  10:25:13
19
-  Duration  52.51s (transform 50ms, setup 0ms, collect 640ms, tests 51.63s, environment 0ms, prepare 67ms)
18
+  Start at  08:07:13
19
+  Duration  49.76s (transform 62ms, setup 0ms, collect 691ms, tests 48.80s, environment 0ms, prepare 72ms)
20
20
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 71e5326: Full SC data suppport
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [71e5326]
12
+ - @platforma-open/milaboratories.mixcr-clonotyping-2.single-cell-scripts@1.0.2
13
+
14
+ ## 2.2.2
15
+
16
+ ### Patch Changes
17
+
18
+ - eeed3eb: Allow N/A in topChain
19
+
3
20
  ## 2.2.1
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  declare type TemplateFromFile = { readonly type: "from-file"; readonly path: string; };
2
- declare type TplName = "aggregate-by-clonotype-key" | "calculate-preset-info" | "list-presets" | "mixcr-analyze" | "mixcr-export" | "prerun" | "process" | "test.columns-calculate" | "test.columns.test" | "main";
2
+ declare type TplName = "aggregate-by-clonotype-key" | "calculate-preset-info" | "list-presets" | "mixcr-analyze" | "mixcr-export" | "prerun" | "process-single-cell" | "process" | "test.columns-calculate" | "test.columns.test" | "main";
3
3
  declare const Templates: Record<TplName, TemplateFromFile>;
4
4
  export { Templates };
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ module.exports = { Templates: {
5
5
  'mixcr-analyze': { type: 'from-file', path: require.resolve('./tengo/tpl/mixcr-analyze.plj.gz') },
6
6
  'mixcr-export': { type: 'from-file', path: require.resolve('./tengo/tpl/mixcr-export.plj.gz') },
7
7
  'prerun': { type: 'from-file', path: require.resolve('./tengo/tpl/prerun.plj.gz') },
8
+ 'process-single-cell': { type: 'from-file', path: require.resolve('./tengo/tpl/process-single-cell.plj.gz') },
8
9
  'process': { type: 'from-file', path: require.resolve('./tengo/tpl/process.plj.gz') },
9
10
  'test.columns-calculate': { type: 'from-file', path: require.resolve('./tengo/tpl/test.columns-calculate.plj.gz') },
10
11
  'test.columns.test': { type: 'from-file', path: require.resolve('./tengo/tpl/test.columns.test.plj.gz') },
package/dist/index.mjs CHANGED
@@ -6,6 +6,7 @@ export const Templates = {
6
6
  'mixcr-analyze': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/mixcr-analyze.plj.gz') },
7
7
  'mixcr-export': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/mixcr-export.plj.gz') },
8
8
  'prerun': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/prerun.plj.gz') },
9
+ 'process-single-cell': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/process-single-cell.plj.gz') },
9
10
  'process': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/process.plj.gz') },
10
11
  'test.columns-calculate': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/test.columns-calculate.plj.gz') },
11
12
  'test.columns.test': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/test.columns.test.plj.gz') },
@@ -79,6 +79,12 @@ exportSpecOpsFromPreset := func(presetSpecForBack) {
79
79
  }
80
80
  }
81
81
 
82
+ addSpec := func(columns, additionalSpec) {
83
+ return slices.map(columns, func(columnSpec) {
84
+ return maps.deepMerge(columnSpec, additionalSpec)
85
+ })
86
+ }
87
+
82
88
  calculateExportSpecs := func(presetSpecForBack, blockId) {
83
89
  ops := exportSpecOpsFromPreset(presetSpecForBack)
84
90
 
@@ -87,19 +93,30 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
87
93
  hasUmi := ops.hasUmi
88
94
  splitByC := ops.splitByC
89
95
 
96
+ isSingleCell := !is_undefined(cellTags) && len(cellTags) > 0
97
+
90
98
  assemblingFeatureInfo := assemblingFeatureInfo(assemblingFeature)
91
99
  productiveFeature := assemblingFeatureInfo.productiveFeature
92
100
  coreGeneFeatures := assemblingFeatureInfo.coreGeneFeatures
93
101
 
94
102
  clonotypeKeyColumns := undefined
95
- if !is_undefined(assemblingFeature) && (is_undefined(cellTags) || len(cellTags) == 0) {
103
+ clonotypeKeyArgs := undefined
104
+ if !is_undefined(assemblingFeature) {
96
105
  clonotypeKeyColumns = ["nSeq" + assemblingFeature, "bestVGene", "bestJGene"]
106
+ clonotypeKeyArgs = [
107
+ [ "-nFeature", assemblingFeature ],
108
+ [ "-vGene" ],
109
+ [ "-jGene" ]
110
+ ]
97
111
  if splitByC {
98
112
  clonotypeKeyColumns += ["bestCGene"]
113
+ clonotypeKeyArgs += [ [ "-cGene" ] ]
99
114
  }
115
+
100
116
  }
101
117
 
102
118
  columnsSpecPerSample := []
119
+ columnsSpecPerSampleSc := undefined
103
120
  columnsSpecPerClonotype := []
104
121
 
105
122
 
@@ -191,6 +208,52 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
191
208
  mainAbundanceColumn = "uniqueMoleculeFraction"
192
209
  }
193
210
 
211
+ if isSingleCell {
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ columnsSpecPerSampleSc = [ {
222
+ column: "uniqueCellCount",
223
+ id: "cell-count",
224
+ allowNA: false,
225
+ spec: {
226
+ name: "pl7.app/vdj/uniqueCellCount",
227
+ valueType: "Long",
228
+ annotations: a(88000, true, {
229
+ "pl7.app/min": "1",
230
+ "pl7.app/isAbundance": "true",
231
+ "pl7.app/abundance/unit": "cells",
232
+ "pl7.app/abundance/normalized": "false",
233
+ "pl7.app/abundance/isPrimary": "true",
234
+ "pl7.app/isAnchor": "true",
235
+ "pl7.app/label": "Number of Cells"
236
+ })
237
+ }
238
+ }, {
239
+ column: "uniqueCellFraction",
240
+ id: "cell-fraction",
241
+ allowNA: false,
242
+ spec: {
243
+ name: "pl7.app/vdj/uniqueCellFraction",
244
+ valueType: "Double",
245
+ annotations: a(88000, true, {
246
+ "pl7.app/min": "0",
247
+ "pl7.app/isAbundance": "true",
248
+ "pl7.app/abundance/unit": "cells",
249
+ "pl7.app/abundance/normalized": "true",
250
+ "pl7.app/abundance/isPrimary": "true",
251
+ "pl7.app/label": "Fraction of Cells"
252
+ })
253
+ }
254
+ } ]
255
+ }
256
+
194
257
 
195
258
 
196
259
  orderP := 80000
@@ -310,21 +373,21 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
310
373
  orderP = 10000
311
374
 
312
375
  mutationColumnVariants := [ {
313
- name: "Mutations",
314
- valueType: "String",
315
- labelPart: " mutations in ",
316
- idPart: "-mutations-"
317
- }, {
318
- name: "MutationsCount",
319
- valueType: "Int",
320
- labelPart: " mutations count in ",
321
- idPart: "-mutations-count-"
322
- }, {
323
- name: "MutationsRate",
324
- valueType: "Double",
325
- labelPart: " mutations rate in ",
326
- idPart: "-mutations-rate-"
327
- } ]
376
+ name: "Mutations",
377
+ valueType: "String",
378
+ labelPart: " mutations in ",
379
+ idPart: "-mutations-"
380
+ }, {
381
+ name: "MutationsCount",
382
+ valueType: "Int",
383
+ labelPart: " mutations count in ",
384
+ idPart: "-mutations-count-"
385
+ }, {
386
+ name: "MutationsRate",
387
+ valueType: "Double",
388
+ labelPart: " mutations rate in ",
389
+ idPart: "-mutations-rate-"
390
+ } ]
328
391
 
329
392
  for isAminoAcid in [false, true] {
330
393
  alphabetShort := isAminoAcid ? "AA" : "Nt"
@@ -445,7 +508,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
445
508
  column: "topChains",
446
509
  id: "top-chains",
447
510
  naRegex: "",
448
- allowNA: false,
511
+ allowNA: true,
449
512
  spec: {
450
513
  valueType: "String",
451
514
  name: "pl7.app/vdj/chain",
@@ -465,12 +528,6 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
465
528
 
466
529
 
467
530
 
468
- addSpec := func(columns, additionalSpec) {
469
- return slices.map(columns, func(columnSpec) {
470
- return maps.deepMerge(columnSpec, additionalSpec)
471
- })
472
- }
473
-
474
531
  columnsSpecPerSample = addSpec(columnsSpecPerSample, { spec: { domain: {
475
532
  "pl7.app/vdj/clonotypingRunId": blockId
476
533
  } } })
@@ -500,10 +557,10 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
500
557
 
501
558
 
502
559
  axesByClonotypeKey := undefined
560
+ axesByScClonotypeKey := undefined
561
+ cellTagColumns := undefined
503
562
 
504
563
  if !is_undefined(clonotypeKeyColumns) {
505
- ll.assert(is_undefined(cellTags) || len(cellTags) == 0, "cellTags and clonotypeKeyAxes cannot both be defined")
506
-
507
564
 
508
565
  keyStrincture := []
509
566
  for keyColumn in clonotypeKeyColumns {
@@ -515,93 +572,70 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
515
572
  }
516
573
 
517
574
  axesByClonotypeKey = [ {
518
- column: "clonotypeKey",
575
+ column: "clonotypeKey",
576
+ naRegex: "",
577
+ spec: {
578
+ name: "pl7.app/vdj/clonotypeKey",
579
+ type: "String",
580
+ domain: {
581
+ "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture))
582
+ },
583
+ annotations: {
584
+ "pl7.app/label": "Clonotype key",
585
+ "pl7.app/table/visibility": "optional",
586
+ "pl7.app/table/orderPriority": "110000"
587
+ }
588
+ }
589
+ } ]
590
+
591
+ if isSingleCell {
592
+ cellTagColumns = slices.map(cellTags, func(cellTag) {
593
+ return "tagValue" + cellTag
594
+ })
595
+
596
+ axesByScClonotypeKey = [ {
597
+ column: "scClonotypeKey",
519
598
  naRegex: "",
520
599
  spec: {
521
- name: "pl7.app/vdj/clonotypeKey",
600
+ name: "pl7.app/vdj/scClonotypeKey",
522
601
  type: "String",
523
602
  domain: {
524
- "pl7.app/vdj/clonotypeKey/structure": string(json.encode(keyStrincture))
603
+ "pl7.app/vdj/scClonotypeKey/structure": string(json.encode(keyStrincture))
525
604
  },
526
605
  annotations: {
527
- "pl7.app/label": "Clonotype key",
606
+ "pl7.app/label": "SC Clonotype key",
528
607
  "pl7.app/table/visibility": "optional",
529
608
  "pl7.app/table/orderPriority": "110000"
530
609
  }
531
610
  }
532
611
  } ]
533
- }
534
612
 
535
- axesByClonotypeId := [ {
536
- column: "cloneId",
537
- spec: {
538
- name: "pl7.app/vdj/cloneId",
539
- type: "Long",
540
- domain: {
541
- "pl7.app/blockId": blockId
542
- },
543
- annotations: {
544
- "pl7.app/min": "0",
545
- "pl7.app/label": "Clone id",
546
- "pl7.app/table/visibility": "optional",
547
- "pl7.app/table/orderPriority": "90000"
548
- }
549
- }
550
- } ]
551
- exportArgs += [ [ "-cloneId" ] ]
552
-
553
- orderP = 100000
554
- if !is_undefined(cellTags) && len(cellTags) > 0 {
555
- for tag in cellTags {
556
- label := undefined
557
- if tag == "CELL" {
558
- label = "Cell tag"
559
- } else {
560
- label = text.to_title(tag[:4]) + " " + text.to_lower(tag[4:])
561
- }
562
- axesByClonotypeId += [ {
563
- column: "tagValue" + tag,
564
- naRegex: "",
565
- spec: {
566
- name: "pl7.app/vdj/cellTag",
567
- type: "String",
568
- domain: {
569
- "pl7.app/vdj/cellTagId": tag,
570
- "pl7.app/vdj/clonotypingRunId": blockId
571
- },
572
- annotations: a(orderP, true, {
573
- "pl7.app/label": label
574
- })
575
- }
576
- } ]
577
- orderP -= 1
578
- }
579
- exportArgs += [ [ "-tags", "Cell" ] ]
580
613
 
581
- columnsSpec += [ {
582
- column: "cellGroup",
583
- id: "cell-group",
584
- naRegex: "undefined|contamination",
585
- allowNA: true,
586
- spec: {
587
- name: "pl7.app/vdj/cellGroup",
588
- valueType: "Long",
589
- annotations: a(24000, true, {
590
- "pl7.app/min": "0",
591
- "pl7.app/label": "Cell group number"
592
- } )
593
- }
594
- } ]
595
- exportArgs += [ [ "-cellGroup" ] ]
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+ }
596
626
  }
597
627
 
598
628
  return {
599
629
  clonotypeKeyColumns: clonotypeKeyColumns,
630
+ clonotypeKeyArgs: clonotypeKeyArgs,
631
+
632
+ cellTagColumns: cellTagColumns,
600
633
 
601
- axesByClonotypeId: axesByClonotypeId,
602
634
  axesByClonotypeKey: axesByClonotypeKey,
635
+ axesByScClonotypeKey: axesByScClonotypeKey,
603
636
 
604
637
  columnsSpecPerSample: columnsSpecPerSample,
638
+ columnsSpecPerSampleSc: columnsSpecPerSampleSc,
605
639
  columnsSpecPerClonotype: columnsSpecPerClonotype,
606
640
 
607
641
  columnsSpec: columnsSpec,
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,18 +1,16 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.mixcr-clonotyping-2.workflow",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Tengo-based template",
5
5
  "dependencies": {
6
- "@platforma-open/milaboratories.mixcr-clonotyping-2.sc-clonotype-builder": "1.0.1"
6
+ "@platforma-sdk/workflow-tengo": "^3.0.0",
7
+ "@platforma-open/milaboratories.mixcr-clonotyping-2.single-cell-scripts": "1.0.2"
7
8
  },
8
9
  "devDependencies": {
9
- "@platforma-sdk/tengo-builder": "^1.19.2",
10
- "@platforma-sdk/workflow-tengo": "^2.15.6",
11
- "@milaboratories/software-pframes-conv": "2.1.16",
12
- "@platforma-open/milaboratories.software-small-binaries": "^1.15.16",
10
+ "@platforma-sdk/tengo-builder": "^2.0.0",
13
11
  "@platforma-open/milaboratories.software-mixcr": "4.7.0-148-develop",
14
12
  "@platforma-open/milaboratories.software-ptransform": "^1.3.1",
15
- "@platforma-sdk/test": "^1.22.100",
13
+ "@platforma-sdk/test": "^1.24.0",
16
14
  "vitest": "^2.1.8",
17
15
  "typescript": "~5.5.4"
18
16
  },