@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.2.2 → 2.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,7 +1,9 @@
1
+  WARN  Issue while reading "/home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
1
2
 
2
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.2.2 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.3.1 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
4
  > rm -rf dist && pl-tengo check && pl-tengo build
4
5
 
6
+ info: Skipping unknown file type: test/columns.test.ts
5
7
  Processing "src/aggregate-by-clonotype-key.tpl.tengo"...
6
8
  Processing "src/calculate-export-specs.lib.tengo"...
7
9
  Processing "src/calculate-preset-info.tpl.tengo"...
@@ -10,10 +12,12 @@ Processing "src/main.tpl.tengo"...
10
12
  Processing "src/mixcr-analyze.tpl.tengo"...
11
13
  Processing "src/mixcr-export.tpl.tengo"...
12
14
  Processing "src/prerun.tpl.tengo"...
15
+ Processing "src/process-single-cell.tpl.tengo"...
13
16
  Processing "src/process.tpl.tengo"...
14
17
  Processing "src/test/columns-calculate.tpl.tengo"...
15
18
  Processing "src/test/columns.test.tpl.tengo"...
16
19
  No syntax errors found.
20
+ info: Skipping unknown file type: test/columns.test.ts
17
21
  info: Compiling 'dist'...
18
22
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/lib/calculate-export-specs.lib.tengo
19
23
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/aggregate-by-clonotype-key.plj.gz
@@ -22,6 +26,7 @@ No syntax errors found.
22
26
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/mixcr-analyze.plj.gz
23
27
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/mixcr-export.plj.gz
24
28
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/prerun.plj.gz
29
+ info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/process-single-cell.plj.gz
25
30
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/process.plj.gz
26
31
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/test.columns-calculate.plj.gz
27
32
  info: - writing /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow/dist/tengo/tpl/test.columns.test.plj.gz
@@ -1,20 +1,36 @@
1
+  WARN  Issue while reading "/home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
1
2
 
2
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.2.2 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.3.1 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
4
  > vitest
4
5
 
5
6
 
6
7
   RUN  v2.1.8 /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
7
8
 
8
- ✓ src/test/columns.test.ts (6 tests) 46738ms
9
- ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 11338ms
10
- ✓ checking preset for '10x-sc-xcr-vdj' 7608ms
11
- ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 7124ms
12
- ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 7116ms
13
- ✓ checking preset for 'rna-seq' 6691ms
14
- ✓ checking preset for 'generic-single-cell-gex' 6860ms
9
+ stdout | src/test/columns.test.ts > checking preset for 'milab-human-dna-xcr-7genes-multiplex'
10
+ {
11
+ type: 'ok',
12
+ value: undefined,
13
+ stable: false,
14
+ uTag: '6c11bfb3-e54c-4d9e-93d9-04ecc8a6e3c8',
15
+ unstableMarker: 'field_not_resolved:exportSpecs'
16
+ }
17
+
18
+ stdout | src/test/columns.test.ts > checking preset for 'milab-human-dna-xcr-7genes-multiplex'
19
+ TEST FAILED SO ALTERNATIVE ROOT IS PRESETVED IN PL: test_1743445608218_96df81f8-dd85-4a6f-9cf9-a38dbe8ceb56 (NG:0x7e)
20
+
21
+ stdout | src/test/columns.test.ts > checking preset for 'milab-human-dna-xcr-7genes-multiplex'
22
+ TEST FAILED SO ALTERNATIVE ROOT IS PRESETVED IN PL: test_1743445629470_e3d0e207-7f5d-412a-92dd-ea4d171cbb48 (NG:0x188)
23
+
24
+ ✓ src/test/columns.test.ts (6 tests) 64043ms
25
+ ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 23412ms
26
+ ✓ checking preset for '10x-sc-xcr-vdj' 8462ms
27
+ ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 8304ms
28
+ ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 8239ms
29
+ ✓ checking preset for 'rna-seq' 7620ms
30
+ ✓ checking preset for 'generic-single-cell-gex' 8004ms
15
31
 
16
32
   Test Files  1 passed (1)
17
33
   Tests  6 passed (6)
18
-  Start at  11:23:07
19
-  Duration  47.64s (transform 53ms, setup 0ms, collect 631ms, tests 46.74s, environment 0ms, prepare 85ms)
34
+  Start at  18:26:47
35
+  Duration  64.84s (transform 40ms, setup 0ms, collect 562ms, tests 64.04s, environment 0ms, prepare 66ms)
20
36
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e108f59: Dependency upgrade
8
+ - Updated dependencies [e108f59]
9
+ - @platforma-open/milaboratories.mixcr-clonotyping-2.single-cell-scripts@1.1.0
10
+
11
+ ## 2.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 71e5326: Full SC data suppport
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [71e5326]
20
+ - @platforma-open/milaboratories.mixcr-clonotyping-2.single-cell-scripts@1.0.2
21
+
3
22
  ## 2.2.2
4
23
 
5
24
  ### 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"
@@ -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.2",
3
+ "version": "2.3.1",
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.1.0",
7
+ "@platforma-open/milaboratories.mixcr-clonotyping-2.single-cell-scripts": "1.1.0"
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.2",
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.25.0",
16
14
  "vitest": "^2.1.8",
17
15
  "typescript": "~5.5.4"
18
16
  },