@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 3.2.0 → 3.2.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,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/mixcr-clonotyping/mixcr-clonotyping/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@3.2.0 build /home/runner/work/mixcr-clonotyping/mixcr-clonotyping/workflow
3
+ > @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@3.2.1 build /home/runner/work/mixcr-clonotyping/mixcr-clonotyping/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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-open/milaboratories.mixcr-clonotyping.workflow
2
2
 
3
+ ## 3.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ebad6c6: Fixes export error on SC presets without UMI
8
+
3
9
  ## 3.2.0
4
10
 
5
11
  ### Minor Changes
@@ -5,7 +5,7 @@ ll := import("@platforma-sdk/workflow-tengo:ll")
5
5
  pConstants := import("@platforma-sdk/workflow-tengo:pframes.constants")
6
6
 
7
7
 
8
- getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
8
+ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellTags) {
9
9
 
10
10
  baseColumns := [
11
11
  {
@@ -489,7 +489,7 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
489
489
  column: "assemble.preCloneAssembler.unassignedAlignments",
490
490
  id: "assemble-pre-clone-assembler-unassigned-alignments",
491
491
  allowNA: true,
492
- naRegex: "",
492
+ naRegex: "^[a-zA-Z_]*$",
493
493
  spec: {
494
494
  name: "mixcr.com/reports/assemble/preCloneAssembler/unassignedAlignments",
495
495
  valueType: "Long",
@@ -505,7 +505,7 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
505
505
  column: "assemble.preCloneAssembler.unassignedAlignmentsPercents",
506
506
  id: "assemble-pre-clone-assembler-unassigned-alignments-percents",
507
507
  allowNA: true,
508
- naRegex: "",
508
+ naRegex: "^[a-zA-Z_]*$",
509
509
  spec: {
510
510
  name: "mixcr.com/reports/assemble/preCloneAssembler/unassignedAlignmentsPercents",
511
511
  valueType: "Double",
@@ -1180,73 +1180,76 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
1180
1180
  "pl7.app/label": "Unassigned Clonotypes (%)"
1181
1181
  }
1182
1182
  }
1183
- },
1184
- {
1185
- column: "refineTags.CELL.outputCount",
1186
- id: "refine-tags-cell-output-count",
1187
- allowNA: true,
1188
- naRegex: "NaN",
1189
- spec: {
1190
- name: "mixcr.com/reports/refineTags/CELL/outputCount",
1191
- valueType: "Long",
1192
- annotations: {
1193
- "pl7.app/min": "0",
1194
- "pl7.app/table/orderPriority": "85800",
1195
- "pl7.app/table/visibility": "optional",
1196
- "pl7.app/label": "Refine Tags CELL - Output Count"
1183
+ }]
1184
+
1185
+ for cellTag in cellTags {
1186
+ singleCellColumns += [{
1187
+ column: "refineTags." + cellTag + ".outputCount",
1188
+ id: "refine-tags-" + cellTag + "-output-count",
1189
+ allowNA: true,
1190
+ naRegex: "NaN",
1191
+ spec: {
1192
+ name: "mixcr.com/reports/refineTags/CELL/outputCount",
1193
+ valueType: "Long",
1194
+ annotations: {
1195
+ "pl7.app/min": "0",
1196
+ "pl7.app/table/orderPriority": "85800",
1197
+ "pl7.app/table/visibility": "optional",
1198
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Count"
1199
+ }
1197
1200
  }
1198
- }
1199
- },
1200
- {
1201
- column: "refineTags.CELL.outputCountPercents",
1202
- id: "refine-tags-cell-output-count-percents",
1203
- allowNA: true,
1204
- naRegex: "NaN",
1205
- spec: {
1206
- name: "mixcr.com/reports/refineTags/CELL/outputCountPercents",
1207
- valueType: "Double",
1208
- annotations: {
1209
- "pl7.app/min": "0",
1210
- "pl7.app/max": "100",
1211
- "pl7.app/table/orderPriority": "85900",
1212
- "pl7.app/table/visibility": "default",
1213
- "pl7.app/label": "Refine Tags CELL - Output Count (%)"
1201
+ },
1202
+ {
1203
+ column: "refineTags." + cellTag + ".outputCountPercents",
1204
+ id: "refine-tags-" + cellTag + "-output-count-percents",
1205
+ allowNA: true,
1206
+ naRegex: "NaN",
1207
+ spec: {
1208
+ name: "mixcr.com/reports/refineTags/CELL/outputCountPercents",
1209
+ valueType: "Double",
1210
+ annotations: {
1211
+ "pl7.app/min": "0",
1212
+ "pl7.app/max": "100",
1213
+ "pl7.app/table/orderPriority": "85900",
1214
+ "pl7.app/table/visibility": "default",
1215
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Count (%)"
1216
+ }
1214
1217
  }
1215
- }
1216
- },
1217
- {
1218
- column: "refineTags.CELL.outputDiversity",
1219
- id: "refine-tags-cell-output-diversity",
1220
- allowNA: true,
1221
- naRegex: "NaN",
1222
- spec: {
1223
- name: "mixcr.com/reports/refineTags/CELL/outputDiversity",
1224
- valueType: "Long",
1225
- annotations: {
1226
- "pl7.app/min": "0",
1227
- "pl7.app/table/orderPriority": "86000",
1228
- "pl7.app/table/visibility": "optional",
1229
- "pl7.app/label": "Refine Tags CELL - Output Diversity"
1218
+ },
1219
+ {
1220
+ column: "refineTags." + cellTag + ".outputDiversity",
1221
+ id: "refine-tags-" + cellTag + "-output-diversity",
1222
+ allowNA: true,
1223
+ naRegex: "NaN",
1224
+ spec: {
1225
+ name: "mixcr.com/reports/refineTags/CELL/outputDiversity",
1226
+ valueType: "Long",
1227
+ annotations: {
1228
+ "pl7.app/min": "0",
1229
+ "pl7.app/table/orderPriority": "86000",
1230
+ "pl7.app/table/visibility": "optional",
1231
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Diversity"
1232
+ }
1230
1233
  }
1231
- }
1232
- },
1233
- {
1234
- column: "refineTags.CELL.outputDiversityPercents",
1235
- id: "refine-tags-cell-output-diversity-percents",
1236
- allowNA: true,
1237
- naRegex: "NaN",
1238
- spec: {
1239
- name: "mixcr.com/reports/refineTags/CELL/outputDiversityPercents",
1240
- valueType: "Double",
1241
- annotations: {
1242
- "pl7.app/min": "0",
1243
- "pl7.app/max": "100",
1244
- "pl7.app/table/orderPriority": "86100",
1245
- "pl7.app/table/visibility": "default",
1246
- "pl7.app/label": "Refine Tags CELL - Output Diversity (%)"
1234
+ },
1235
+ {
1236
+ column: "refineTags." + cellTag + ".outputDiversityPercents",
1237
+ id: "refine-tags-" + cellTag + "-output-diversity-percents",
1238
+ allowNA: true,
1239
+ naRegex: "NaN",
1240
+ spec: {
1241
+ name: "mixcr.com/reports/refineTags/CELL/outputDiversityPercents",
1242
+ valueType: "Double",
1243
+ annotations: {
1244
+ "pl7.app/min": "0",
1245
+ "pl7.app/max": "100",
1246
+ "pl7.app/table/orderPriority": "86100",
1247
+ "pl7.app/table/visibility": "default",
1248
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Diversity (%)"
1249
+ }
1247
1250
  }
1248
- }
1249
- }]
1251
+ }]
1252
+ }
1250
1253
 
1251
1254
 
1252
1255
 
Binary file
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": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Tengo-based template",
5
5
  "dependencies": {
6
6
  "@platforma-sdk/workflow-tengo": "^5.0.3",
@@ -41,7 +41,7 @@ self.body(func(inputs) {
41
41
 
42
42
  baseSchemaForRead := schemaPerSample + [ { column: "clonotypeKey", type: "String" } ]
43
43
 
44
- ll.print("__THE_LOG__ AGGREGATE BY CLONOTYPE KEY: " + json.encode(maps.getKeys(inputMap)))
44
+ // ll.print("__THE_LOG__ AGGREGATE BY CLONOTYPE KEY: " + json.encode(maps.getKeys(inputMap)))
45
45
 
46
46
  for sKey in maps.getKeys(inputMap) {
47
47
  inputFile := inputMap[sKey]
@@ -24,11 +24,14 @@ ptablerSw := assets.importSoftware("@platforma-open/milaboratories.software-ptab
24
24
 
25
25
  self.body(func(inputs) {
26
26
  clnsData := inputs.clnsData
27
- isSingleCell := inputs.isSingleCell
28
- hasUmi := inputs.hasUmi
27
+ presetSpecForBack := inputs.presetSpecForBack
29
28
  sampleIdAxisSpec := inputs.sampleIdAxisSpec
30
29
  chains := inputs.chains
31
30
 
31
+ isSingleCell := len(presetSpecForBack.cellTags) > 0
32
+ hasUmi := !is_undefined(presetSpecForBack.umiTags) && len(presetSpecForBack.umiTags) > 0
33
+ cellTags := presetSpecForBack.cellTags
34
+
32
35
  chainInfos := {
33
36
  "IGHeavy": { mixcrFilter: "IGH", name: "IG Heavy", shortName: "Heavy" },
34
37
  "IGLight": { mixcrFilter: "IGK,IGL", name: "IG Light", shortName: "Light" },
@@ -98,7 +101,7 @@ self.body(func(inputs) {
98
101
 
99
102
  tsvFile := wfResult.getFile("qc-report-processed.tsv")
100
103
 
101
- qcReportColumns := qcReportColumns(hasUmi, isSingleCell, sampleIdAxisSpec, chainsForMixcr)
104
+ qcReportColumns := qcReportColumns(hasUmi, isSingleCell, sampleIdAxisSpec, chainsForMixcr, cellTags)
102
105
  reportColumnsSpec := qcReportColumns.reportColumnsSpec
103
106
 
104
107
  qcReportTable := xsv.importFile(
@@ -35,6 +35,7 @@ self.body(func(inputs) {
35
35
  }
36
36
 
37
37
  mainAbundanceColumnUnnormalizedArgs := params.mainAbundanceColumnUnnormalizedArgs
38
+ mainAbundanceColumnIsReadCount := params.mainAbundanceColumnIsReadCount == true
38
39
  mainIsProductiveArgs := params.mainIsProductiveArgs
39
40
 
40
41
  hashKeyDerivationExpressionPt := func(sourceColumns) {
@@ -145,7 +146,22 @@ self.body(func(inputs) {
145
146
  mem("4GiB").
146
147
  cpu(2)
147
148
 
148
- dfSingleCell := wfSingleCell.frame(unprocessedTsvForSingleCell, { xsvType: "tsv", inferSchema: false })
149
+ frameLoadOps := {
150
+ xsvType: "tsv",
151
+ inferSchema: false
152
+ }
153
+
154
+ if mainAbundanceColumnIsReadCount {
155
+ frameLoadOps.schema = [ { column: "readCount", type: "Double" } ]
156
+ }
157
+
158
+ dfSingleCell := wfSingleCell.frame(unprocessedTsvForSingleCell, frameLoadOps)
159
+
160
+ if mainAbundanceColumnIsReadCount {
161
+ dfSingleCell.addColumns(
162
+ pt.col("readCount").round().cast("Long").alias("readCount")
163
+ )
164
+ }
149
165
 
150
166
  dfSingleCell.addColumns(
151
167
  hashKeyDerivationExpressionPt(clonotypeKeyColumns).alias("clonotypeKey"),
@@ -22,7 +22,7 @@ self.defineOutputs("abundanceTsv", "clonotypeTsv",
22
22
  ptablerSw := assets.importSoftware("@platforma-open/milaboratories.software-ptabler:main")
23
23
 
24
24
  self.body(func(inputs) {
25
- ll.print("__THE_LOG__ PROCESS SINGLE CELL")
25
+ // ll.print("__THE_LOG__ PROCESS SINGLE CELL")
26
26
 
27
27
  byCellTagA := inputs[pConstants.VALUE_FIELD_NAME]
28
28
  inputDataMeta := byCellTagA.getDataAsJson()
@@ -391,7 +391,7 @@ self.body(func(inputs) {
391
391
  stepCache: 30 * times.minute,
392
392
 
393
393
  extra: {
394
- params: {
394
+ params: maps.clone({
395
395
  chains: chainInfo.mixcrFilter,
396
396
  clonotypeKeyColumns: clonotypeKeyColumns,
397
397
  clonotypeKeyArgs: clonotypeKeyArgs,
@@ -406,9 +406,11 @@ self.body(func(inputs) {
406
406
  cellTagColumns: cellTagColumns,
407
407
  hashCellKey: hashCellKey,
408
408
 
409
+ mainAbundanceColumnIsReadCount: (!is_undefined(cellTagColumns) && len(cellTagColumns) > 0 && mainAbundanceColumnUnnormalized == "readCount") ? true : undefined,
410
+
409
411
  exportArgs: exportArgs,
410
412
  isLibraryFileGzipped: isLibraryFileGzipped
411
- },
413
+ }, { removeUndefs: true }),
412
414
  library: library
413
415
  }
414
416
  }
@@ -683,14 +685,13 @@ self.body(func(inputs) {
683
685
  anonymize.deanonymizePKeys(anonymizedData, 0, [0], anonymizationResult.mapping)
684
686
  )
685
687
  resultsToCache["clonotypeProperties/" + receptor + "/cellsLinkerTable/" + columnName] = anonymizedData
686
- }
688
+ }
687
689
  }
688
690
  }
689
691
 
690
692
  qcReportTable := render.create(exportReportTpl, {
691
693
  clnsData: mixcrResults.outputData("clns"),
692
- isSingleCell: isSingleCell,
693
- hasUmi: hasUmi,
694
+ presetSpecForBack: presetSpecForBack,
694
695
  sampleIdAxisSpec: sampleIdAxisSpec,
695
696
  chains: chains
696
697
  })
@@ -5,7 +5,7 @@ ll := import("@platforma-sdk/workflow-tengo:ll")
5
5
  pConstants := import("@platforma-sdk/workflow-tengo:pframes.constants")
6
6
 
7
7
  // QC Report column specifications function
8
- getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
8
+ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellTags) {
9
9
  // Bulk sequencing columns
10
10
  baseColumns := [
11
11
  {
@@ -489,7 +489,7 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
489
489
  column: "assemble.preCloneAssembler.unassignedAlignments",
490
490
  id: "assemble-pre-clone-assembler-unassigned-alignments",
491
491
  allowNA: true,
492
- naRegex: "",
492
+ naRegex: "^[a-zA-Z_]*$",
493
493
  spec: {
494
494
  name: "mixcr.com/reports/assemble/preCloneAssembler/unassignedAlignments",
495
495
  valueType: "Long",
@@ -505,7 +505,7 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
505
505
  column: "assemble.preCloneAssembler.unassignedAlignmentsPercents",
506
506
  id: "assemble-pre-clone-assembler-unassigned-alignments-percents",
507
507
  allowNA: true,
508
- naRegex: "",
508
+ naRegex: "^[a-zA-Z_]*$",
509
509
  spec: {
510
510
  name: "mixcr.com/reports/assemble/preCloneAssembler/unassignedAlignmentsPercents",
511
511
  valueType: "Double",
@@ -1180,73 +1180,76 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains) {
1180
1180
  "pl7.app/label": "Unassigned Clonotypes (%)"
1181
1181
  }
1182
1182
  }
1183
- },
1184
- {
1185
- column: "refineTags.CELL.outputCount",
1186
- id: "refine-tags-cell-output-count",
1187
- allowNA: true,
1188
- naRegex: "NaN",
1189
- spec: {
1190
- name: "mixcr.com/reports/refineTags/CELL/outputCount",
1191
- valueType: "Long",
1192
- annotations: {
1193
- "pl7.app/min": "0",
1194
- "pl7.app/table/orderPriority": "85800",
1195
- "pl7.app/table/visibility": "optional",
1196
- "pl7.app/label": "Refine Tags CELL - Output Count"
1183
+ }]
1184
+
1185
+ for cellTag in cellTags {
1186
+ singleCellColumns += [{
1187
+ column: "refineTags." + cellTag + ".outputCount",
1188
+ id: "refine-tags-" + cellTag + "-output-count",
1189
+ allowNA: true,
1190
+ naRegex: "NaN",
1191
+ spec: {
1192
+ name: "mixcr.com/reports/refineTags/CELL/outputCount",
1193
+ valueType: "Long",
1194
+ annotations: {
1195
+ "pl7.app/min": "0",
1196
+ "pl7.app/table/orderPriority": "85800",
1197
+ "pl7.app/table/visibility": "optional",
1198
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Count"
1199
+ }
1197
1200
  }
1198
- }
1199
- },
1200
- {
1201
- column: "refineTags.CELL.outputCountPercents",
1202
- id: "refine-tags-cell-output-count-percents",
1203
- allowNA: true,
1204
- naRegex: "NaN",
1205
- spec: {
1206
- name: "mixcr.com/reports/refineTags/CELL/outputCountPercents",
1207
- valueType: "Double",
1208
- annotations: {
1209
- "pl7.app/min": "0",
1210
- "pl7.app/max": "100",
1211
- "pl7.app/table/orderPriority": "85900",
1212
- "pl7.app/table/visibility": "default",
1213
- "pl7.app/label": "Refine Tags CELL - Output Count (%)"
1201
+ },
1202
+ {
1203
+ column: "refineTags." + cellTag + ".outputCountPercents",
1204
+ id: "refine-tags-" + cellTag + "-output-count-percents",
1205
+ allowNA: true,
1206
+ naRegex: "NaN",
1207
+ spec: {
1208
+ name: "mixcr.com/reports/refineTags/CELL/outputCountPercents",
1209
+ valueType: "Double",
1210
+ annotations: {
1211
+ "pl7.app/min": "0",
1212
+ "pl7.app/max": "100",
1213
+ "pl7.app/table/orderPriority": "85900",
1214
+ "pl7.app/table/visibility": "default",
1215
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Count (%)"
1216
+ }
1214
1217
  }
1215
- }
1216
- },
1217
- {
1218
- column: "refineTags.CELL.outputDiversity",
1219
- id: "refine-tags-cell-output-diversity",
1220
- allowNA: true,
1221
- naRegex: "NaN",
1222
- spec: {
1223
- name: "mixcr.com/reports/refineTags/CELL/outputDiversity",
1224
- valueType: "Long",
1225
- annotations: {
1226
- "pl7.app/min": "0",
1227
- "pl7.app/table/orderPriority": "86000",
1228
- "pl7.app/table/visibility": "optional",
1229
- "pl7.app/label": "Refine Tags CELL - Output Diversity"
1218
+ },
1219
+ {
1220
+ column: "refineTags." + cellTag + ".outputDiversity",
1221
+ id: "refine-tags-" + cellTag + "-output-diversity",
1222
+ allowNA: true,
1223
+ naRegex: "NaN",
1224
+ spec: {
1225
+ name: "mixcr.com/reports/refineTags/CELL/outputDiversity",
1226
+ valueType: "Long",
1227
+ annotations: {
1228
+ "pl7.app/min": "0",
1229
+ "pl7.app/table/orderPriority": "86000",
1230
+ "pl7.app/table/visibility": "optional",
1231
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Diversity"
1232
+ }
1230
1233
  }
1231
- }
1232
- },
1233
- {
1234
- column: "refineTags.CELL.outputDiversityPercents",
1235
- id: "refine-tags-cell-output-diversity-percents",
1236
- allowNA: true,
1237
- naRegex: "NaN",
1238
- spec: {
1239
- name: "mixcr.com/reports/refineTags/CELL/outputDiversityPercents",
1240
- valueType: "Double",
1241
- annotations: {
1242
- "pl7.app/min": "0",
1243
- "pl7.app/max": "100",
1244
- "pl7.app/table/orderPriority": "86100",
1245
- "pl7.app/table/visibility": "default",
1246
- "pl7.app/label": "Refine Tags CELL - Output Diversity (%)"
1234
+ },
1235
+ {
1236
+ column: "refineTags." + cellTag + ".outputDiversityPercents",
1237
+ id: "refine-tags-" + cellTag + "-output-diversity-percents",
1238
+ allowNA: true,
1239
+ naRegex: "NaN",
1240
+ spec: {
1241
+ name: "mixcr.com/reports/refineTags/CELL/outputDiversityPercents",
1242
+ valueType: "Double",
1243
+ annotations: {
1244
+ "pl7.app/min": "0",
1245
+ "pl7.app/max": "100",
1246
+ "pl7.app/table/orderPriority": "86100",
1247
+ "pl7.app/table/visibility": "default",
1248
+ "pl7.app/label": "Refine Tags " + cellTag + " - Output Diversity (%)"
1249
+ }
1247
1250
  }
1248
- }
1249
- }]
1251
+ }]
1252
+ }
1250
1253
 
1251
1254
  // for chain in chains {
1252
1255
  // singleCellColumns += [{