@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.3.2 → 2.4.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.3.2 build /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.4.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.3.2 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.4.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) 54369ms
10
- ✓ checking preset for 'milab-human-dna-xcr-7genes-multiplex' 14157ms
11
- ✓ checking preset for '10x-sc-xcr-vdj' 8552ms
12
- ✓ checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' 8021ms
13
- ✓ checking preset for 'takara-human-rna-bcr-umi-smartseq' 8026ms
14
- ✓ checking preset for 'rna-seq' 7808ms
15
- ✓ checking preset for 'generic-single-cell-gex' 7805ms
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
16
16
 
17
17
   Test Files  1 passed (1)
18
18
   Tests  6 passed (6)
19
-  Start at  10:42:09
20
-  Duration  55.30s (transform 51ms, setup 0ms, collect 584ms, tests 54.37s, environment 0ms, prepare 94ms)
19
+  Start at  07:35:16
20
+  Duration  54.39s (transform 48ms, setup 0ms, collect 581ms, tests 53.56s, environment 0ms, prepare 65ms)
21
21
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 46dd332: Update value options in Productive column
8
+
9
+ ## 2.3.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 675cd29: Fix for output column domains, ordering and visibility
14
+
3
15
  ## 2.3.2
4
16
 
5
17
  ### Patch Changes
@@ -85,6 +85,9 @@ addSpec := func(columns, additionalSpec) {
85
85
  })
86
86
  }
87
87
 
88
+
89
+
90
+
88
91
  calculateExportSpecs := func(presetSpecForBack, blockId) {
89
92
  ops := exportSpecOpsFromPreset(presetSpecForBack)
90
93
 
@@ -210,14 +213,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
210
213
 
211
214
  if isSingleCell {
212
215
 
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
216
+ columnsSpecPerSample = addSpec(columnsSpecPerSample, {
217
+ spec: {
218
+ annotations: {
219
+ "pl7.app/abundance/isPrimary": undefined,
220
+ "pl7.app/isAnchor": undefined
221
+ }
222
+ }
223
+ })
221
224
  columnsSpecPerSampleSc = [ {
222
225
  column: "uniqueCellCount",
223
226
  id: "cell-count",
@@ -225,7 +228,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
225
228
  spec: {
226
229
  name: "pl7.app/vdj/uniqueCellCount",
227
230
  valueType: "Long",
228
- annotations: a(88000, true, {
231
+ annotations: a(20100, true, {
229
232
  "pl7.app/min": "1",
230
233
  "pl7.app/isAbundance": "true",
231
234
  "pl7.app/abundance/unit": "cells",
@@ -242,7 +245,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
242
245
  spec: {
243
246
  name: "pl7.app/vdj/uniqueCellFraction",
244
247
  valueType: "Double",
245
- annotations: a(88000, true, {
248
+ annotations: a(20000, false, {
246
249
  "pl7.app/min": "0",
247
250
  "pl7.app/isAbundance": "true",
248
251
  "pl7.app/abundance/unit": "cells",
@@ -254,48 +257,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
254
257
  } ]
255
258
  }
256
259
 
257
-
258
-
259
260
  orderP := 80000
260
- geneHitColumnVariants := [ {
261
- name: "pl7.app/vdj/geneHitWithAllele",
262
- columnNameSuffix: "Hit",
263
- idSuffix: "-hit-with-allele",
264
- labelSuffix: " hit with allele",
265
- argSuffix: "Hit",
266
- visible: false
267
- }, {
268
- name: "pl7.app/vdj/geneHit",
269
- columnNameSuffix: "Gene",
270
- idSuffix: "-gene",
271
- labelSuffix: " gene",
272
- argSuffix: "Gene",
273
- visible: true
274
- } ]
275
- for vdjcU in ["V", "D", "J", "C"] {
276
- vdjcL := text.to_lower(vdjcU)
277
- for variant in geneHitColumnVariants {
278
- columnsSpecPerClonotype += [ {
279
- column: "best" + vdjcU + variant.columnNameSuffix,
280
- id: "best-" + vdjcL + variant.idSuffix,
281
- naRegex: "",
282
- allowNA: vdjcU == "C" || vdjcU == "D",
283
- spec: {
284
- name: variant.name,
285
- valueType: "String",
286
- domain: {
287
- "pl7.app/vdj/reference": vdjcU + "Gene"
288
- },
289
- annotations: a(orderP, variant.visible, {
290
- "pl7.app/label": "Best " + vdjcU + variant.labelSuffix,
291
- "pl7.app/isDiscreteFilter": "true"
292
- })
293
- }
294
- } ]
295
- exportArgs += [ [ "-" + vdjcL + variant.argSuffix ] ]
296
- orderP -= 100
297
- }
298
- }
299
261
 
300
262
 
301
263
 
@@ -323,7 +285,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
323
285
  alphabet := isAminoAcid ? "aminoacid" : "nucleotide"
324
286
  alphabetShort := isAminoAcid ? "aa" : "nt"
325
287
  alphabetShortMixcr := isAminoAcid ? "aa" : "n"
326
- visibility := (featureU == "CDR3") || (featureU == assemblingFeature)
288
+ visibility := isSingleCell ? (featureU == "CDR3") && isAminoAcid : (featureU == "CDR3") || (featureU == assemblingFeature)
327
289
  columnsSpecPerClonotype += [ {
328
290
  column: alphabetShortMixcr + "Seq" + imputedU + featureU,
329
291
  id: alphabetShortMixcr + "-seq-" + featureL + (isImputed ? "-imputed" : ""),
@@ -370,6 +332,48 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
370
332
 
371
333
 
372
334
 
335
+ geneHitColumnVariants := [ {
336
+ name: "pl7.app/vdj/geneHitWithAllele",
337
+ columnNameSuffix: "Hit",
338
+ idSuffix: "-hit-with-allele",
339
+ labelSuffix: " hit with allele",
340
+ argSuffix: "Hit",
341
+ visible: false
342
+ }, {
343
+ name: "pl7.app/vdj/geneHit",
344
+ columnNameSuffix: "Gene",
345
+ idSuffix: "-gene",
346
+ labelSuffix: " gene",
347
+ argSuffix: "Gene",
348
+ visible: true
349
+ } ]
350
+ for vdjcU in ["V", "D", "J", "C"] {
351
+ vdjcL := text.to_lower(vdjcU)
352
+ for variant in geneHitColumnVariants {
353
+ columnsSpecPerClonotype += [ {
354
+ column: "best" + vdjcU + variant.columnNameSuffix,
355
+ id: "best-" + vdjcL + variant.idSuffix,
356
+ naRegex: "",
357
+ allowNA: vdjcU == "C" || vdjcU == "D",
358
+ spec: {
359
+ name: variant.name,
360
+ valueType: "String",
361
+ domain: {
362
+ "pl7.app/vdj/reference": vdjcU + "Gene"
363
+ },
364
+ annotations: a(orderP, variant.visible, {
365
+ "pl7.app/label": "Best " + vdjcU + variant.labelSuffix,
366
+ "pl7.app/isDiscreteFilter": "true"
367
+ })
368
+ }
369
+ } ]
370
+ exportArgs += [ [ "-" + vdjcL + variant.argSuffix ] ]
371
+ orderP -= 100
372
+ }
373
+ }
374
+
375
+
376
+
373
377
  orderP = 10000
374
378
 
375
379
  mutationColumnVariants := [ {
@@ -430,7 +434,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
430
434
  specName: "pl7.app/vdj/sequence/productive",
431
435
  label: "Productive",
432
436
  id: "is-productive",
433
- visibility: true
437
+ visibility: false
434
438
  }, {
435
439
  columnPrefix: "isOOF",
436
440
  arg: "-isOOF",
@@ -457,7 +461,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
457
461
  annotations: a(orderP, variant.visibility, {
458
462
  "pl7.app/label": variant.label,
459
463
  "pl7.app/isDiscreteFilter": "true",
460
- "pl7.app/discreteValues": "['true','false']" } )
464
+ "pl7.app/discreteValues": string(json.encode(["True", "False"])) } )
461
465
  }
462
466
  } ]
463
467
  exportArgs += [ [ variant.arg, productiveFeature ] ]
@@ -532,6 +536,10 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
532
536
  "pl7.app/vdj/clonotypingRunId": blockId
533
537
  } } })
534
538
 
539
+ columnsSpecPerSampleSc = addSpec(columnsSpecPerSampleSc, { spec: { domain: {
540
+ "pl7.app/vdj/clonotypingRunId": blockId
541
+ } } })
542
+
535
543
 
536
544
 
537
545
 
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.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "Tengo-based template",
5
5
  "dependencies": {
6
6
  "@platforma-sdk/workflow-tengo": "^3.1.0",
@@ -85,6 +85,9 @@ addSpec := func(columns, additionalSpec) {
85
85
  })
86
86
  }
87
87
 
88
+ // Ordering rules
89
+ // AA Sequences
90
+
88
91
  calculateExportSpecs := func(presetSpecForBack, blockId) {
89
92
  ops := exportSpecOpsFromPreset(presetSpecForBack)
90
93
 
@@ -210,14 +213,14 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
210
213
 
211
214
  if isSingleCell {
212
215
  // copying reads and umi counts and fraction removing isPrimary and isAnchor
213
- // addSpec(columnsSpecPerSample, {
214
- // spec: {
215
- // annotations: {
216
- // "pl7.app/abundance/isPrimary": undefined,
217
- // "pl7.app/isAnchor": undefined
218
- // }
219
- // }
220
- // }) +
216
+ columnsSpecPerSample = addSpec(columnsSpecPerSample, {
217
+ spec: {
218
+ annotations: {
219
+ "pl7.app/abundance/isPrimary": undefined,
220
+ "pl7.app/isAnchor": undefined
221
+ }
222
+ }
223
+ })
221
224
  columnsSpecPerSampleSc = [ {
222
225
  column: "uniqueCellCount",
223
226
  id: "cell-count",
@@ -225,7 +228,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
225
228
  spec: {
226
229
  name: "pl7.app/vdj/uniqueCellCount",
227
230
  valueType: "Long",
228
- annotations: a(88000, true, {
231
+ annotations: a(20100, true, {
229
232
  "pl7.app/min": "1",
230
233
  "pl7.app/isAbundance": "true",
231
234
  "pl7.app/abundance/unit": "cells",
@@ -242,7 +245,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
242
245
  spec: {
243
246
  name: "pl7.app/vdj/uniqueCellFraction",
244
247
  valueType: "Double",
245
- annotations: a(88000, true, {
248
+ annotations: a(20000, false, {
246
249
  "pl7.app/min": "0",
247
250
  "pl7.app/isAbundance": "true",
248
251
  "pl7.app/abundance/unit": "cells",
@@ -254,48 +257,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
254
257
  } ]
255
258
  }
256
259
 
257
- // VDJC Hits
258
-
259
260
  orderP := 80000
260
- geneHitColumnVariants := [ {
261
- name: "pl7.app/vdj/geneHitWithAllele",
262
- columnNameSuffix: "Hit",
263
- idSuffix: "-hit-with-allele",
264
- labelSuffix: " hit with allele",
265
- argSuffix: "Hit",
266
- visible: false
267
- }, {
268
- name: "pl7.app/vdj/geneHit",
269
- columnNameSuffix: "Gene",
270
- idSuffix: "-gene",
271
- labelSuffix: " gene",
272
- argSuffix: "Gene",
273
- visible: true
274
- } ]
275
- for vdjcU in ["V", "D", "J", "C"] {
276
- vdjcL := text.to_lower(vdjcU)
277
- for variant in geneHitColumnVariants {
278
- columnsSpecPerClonotype += [ {
279
- column: "best" + vdjcU + variant.columnNameSuffix,
280
- id: "best-" + vdjcL + variant.idSuffix,
281
- naRegex: "",
282
- allowNA: vdjcU == "C" || vdjcU == "D",
283
- spec: {
284
- name: variant.name,
285
- valueType: "String",
286
- domain: {
287
- "pl7.app/vdj/reference": vdjcU + "Gene"
288
- },
289
- annotations: a(orderP, variant.visible, {
290
- "pl7.app/label": "Best " + vdjcU + variant.labelSuffix,
291
- "pl7.app/isDiscreteFilter": "true"
292
- })
293
- }
294
- } ]
295
- exportArgs += [ [ "-" + vdjcL + variant.argSuffix ] ]
296
- orderP -= 100
297
- }
298
- }
299
261
 
300
262
  // Sequences
301
263
 
@@ -323,7 +285,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
323
285
  alphabet := isAminoAcid ? "aminoacid" : "nucleotide"
324
286
  alphabetShort := isAminoAcid ? "aa" : "nt"
325
287
  alphabetShortMixcr := isAminoAcid ? "aa" : "n"
326
- visibility := (featureU == "CDR3") || (featureU == assemblingFeature)
288
+ visibility := isSingleCell ? (featureU == "CDR3") && isAminoAcid : (featureU == "CDR3") || (featureU == assemblingFeature)
327
289
  columnsSpecPerClonotype += [ {
328
290
  column: alphabetShortMixcr + "Seq" + imputedU + featureU,
329
291
  id: alphabetShortMixcr + "-seq-" + featureL + (isImputed ? "-imputed" : ""),
@@ -368,6 +330,48 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
368
330
  }
369
331
  }
370
332
 
333
+ // VDJC Hits
334
+
335
+ geneHitColumnVariants := [ {
336
+ name: "pl7.app/vdj/geneHitWithAllele",
337
+ columnNameSuffix: "Hit",
338
+ idSuffix: "-hit-with-allele",
339
+ labelSuffix: " hit with allele",
340
+ argSuffix: "Hit",
341
+ visible: false
342
+ }, {
343
+ name: "pl7.app/vdj/geneHit",
344
+ columnNameSuffix: "Gene",
345
+ idSuffix: "-gene",
346
+ labelSuffix: " gene",
347
+ argSuffix: "Gene",
348
+ visible: true
349
+ } ]
350
+ for vdjcU in ["V", "D", "J", "C"] {
351
+ vdjcL := text.to_lower(vdjcU)
352
+ for variant in geneHitColumnVariants {
353
+ columnsSpecPerClonotype += [ {
354
+ column: "best" + vdjcU + variant.columnNameSuffix,
355
+ id: "best-" + vdjcL + variant.idSuffix,
356
+ naRegex: "",
357
+ allowNA: vdjcU == "C" || vdjcU == "D",
358
+ spec: {
359
+ name: variant.name,
360
+ valueType: "String",
361
+ domain: {
362
+ "pl7.app/vdj/reference": vdjcU + "Gene"
363
+ },
364
+ annotations: a(orderP, variant.visible, {
365
+ "pl7.app/label": "Best " + vdjcU + variant.labelSuffix,
366
+ "pl7.app/isDiscreteFilter": "true"
367
+ })
368
+ }
369
+ } ]
370
+ exportArgs += [ [ "-" + vdjcL + variant.argSuffix ] ]
371
+ orderP -= 100
372
+ }
373
+ }
374
+
371
375
  // Mutations
372
376
 
373
377
  orderP = 10000
@@ -430,7 +434,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
430
434
  specName: "pl7.app/vdj/sequence/productive",
431
435
  label: "Productive",
432
436
  id: "is-productive",
433
- visibility: true
437
+ visibility: false
434
438
  }, {
435
439
  columnPrefix: "isOOF",
436
440
  arg: "-isOOF",
@@ -457,7 +461,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
457
461
  annotations: a(orderP, variant.visibility, {
458
462
  "pl7.app/label": variant.label,
459
463
  "pl7.app/isDiscreteFilter": "true",
460
- "pl7.app/discreteValues": "['true','false']" } )
464
+ "pl7.app/discreteValues": string(json.encode(["True", "False"])) } )
461
465
  }
462
466
  } ]
463
467
  exportArgs += [ [ variant.arg, productiveFeature ] ]
@@ -532,6 +536,10 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
532
536
  "pl7.app/vdj/clonotypingRunId": blockId
533
537
  } } })
534
538
 
539
+ columnsSpecPerSampleSc = addSpec(columnsSpecPerSampleSc, { spec: { domain: {
540
+ "pl7.app/vdj/clonotypingRunId": blockId
541
+ } } })
542
+
535
543
  // "pl7.app/segmentedBy" annotation indicates columns that can be meaningfully merged across
536
544
  // different runs (given they have the same name and axes signature).
537
545
  // Its absence indicates that merging would be semantically meaningless (e.g., abundance
@@ -451,7 +451,7 @@ self.body(func(inputs) {
451
451
  for chainIdx in [0, 1] {
452
452
  // "A" chain is always the one that is more diverse
453
453
  chainLetterU := ["A", "B"][chainIdx]
454
- chainNameU := chainInfos[receptorInfo.chains[chainIdx]].name
454
+ chainNameU := chainInfos[receptorInfo.chains[chainIdx]].shortName
455
455
  chainNameL := text.to_lower(chainNameU)
456
456
 
457
457
  for isPrimary in [true, false] {
@@ -463,12 +463,25 @@ self.body(func(inputs) {
463
463
  // i.e. propertiesAPrimaryTsv
464
464
  propertiesTsvOutputName := propertiesTableName + "Tsv"
465
465
 
466
+ annotationsTransformation := {
467
+ "pl7.app/label": func(label) {
468
+ return chainNameU + " " + label + " " + pPrefixU
469
+ }
470
+ }
471
+
472
+ if !isPrimary {
473
+ annotationsTransformation["pl7.app/table/visibility"] = "optional"
474
+ }
475
+
466
476
  singleCellOutputs += [ {
467
477
  type: "Resource",
468
478
  spec: {
469
479
  kind: "PColumn",
470
480
  name: "mixcr.com/scClonotypeTable/" + chainNameL + pPrefixU,
471
481
  domain: {
482
+ "pl7.app/vdj/receptor": receptor,
483
+ "pl7.app/vdj/scClonotypeChain": chainLetterU,
484
+ "pl7.app/vdj/scClonotypeChain/index": pPrefixL,
472
485
  "pl7.app/vdj/clonotypingRunId": blockId
473
486
  },
474
487
  valueType: "File"
@@ -484,13 +497,10 @@ self.body(func(inputs) {
484
497
  spec: {
485
498
  domain: {
486
499
  "pl7.app/vdj/receptor": receptor,
487
- "pl7.app/vdj/scClonotypeChain": chainLetterU
500
+ "pl7.app/vdj/scClonotypeChain": chainLetterU,
501
+ "pl7.app/vdj/scClonotypeChain/index": pPrefixL
488
502
  },
489
- annotations: {
490
- "pl7.app/label": func(label) {
491
- return pPrefixU + " " + chainNameU + " " + label
492
- }
493
- }
503
+ annotations: annotationsTransformation
494
504
  }
495
505
  }),
496
506
  storageFormat: "Binary",