@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 3.17.1 → 3.19.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/tengo/lib/calculate-export-specs.lib.tengo +7 -2
- package/dist/tengo/lib/qc-report-columns.lib.tengo +70 -0
- package/dist/tengo/tpl/aggregate-by-clonotype-key.plj.gz +0 -0
- package/dist/tengo/tpl/calculate-preset-info.plj.gz +0 -0
- package/dist/tengo/tpl/export-report.plj.gz +0 -0
- package/dist/tengo/tpl/list-presets.plj.gz +0 -0
- package/dist/tengo/tpl/main.plj.gz +0 -0
- package/dist/tengo/tpl/mixcr-analyze.plj.gz +0 -0
- package/dist/tengo/tpl/mixcr-export.plj.gz +0 -0
- package/dist/tengo/tpl/prerun.plj.gz +0 -0
- package/dist/tengo/tpl/process-single-cell.plj.gz +0 -0
- package/dist/tengo/tpl/process.plj.gz +0 -0
- package/dist/tengo/tpl/test.columns-calculate.plj.gz +0 -0
- package/dist/tengo/tpl/test.columns.test.plj.gz +0 -0
- package/package.json +1 -1
- package/src/calculate-export-specs.lib.tengo +7 -2
- package/src/export-report.tpl.tengo +126 -1
- package/src/main.tpl.tengo +3 -2
- package/src/mixcr-analyze.tpl.tengo +8 -3
- package/src/process.tpl.tengo +2 -2
- package/src/qc-report-columns.lib.tengo +70 -0
- package/src/test/columns-calculate.tpl.tengo +1 -1
- package/src/test/columns.test.tpl.tengo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -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.
|
|
3
|
+
> @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@3.19.0 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,17 @@
|
|
|
1
1
|
# @platforma-open/milaboratories.mixcr-clonotyping.workflow
|
|
2
2
|
|
|
3
|
+
## 3.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4f376a4: Columns with number of clonotypes dropped due stop codon or oof added to qc table. Dependencies updates
|
|
8
|
+
|
|
9
|
+
## 3.18.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 070fc0b: Min quality checkbox, refactored error correction, dep updates
|
|
14
|
+
|
|
3
15
|
## 3.17.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -129,13 +129,18 @@ addSpec := func(columns, additionalSpec) {
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId) {
|
|
132
|
+
calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId, exportMinQuality) {
|
|
133
133
|
ops := exportSpecOpsFromPreset(presetSpecForBack)
|
|
134
134
|
|
|
135
135
|
assemblingFeature := ops.assemblingFeature
|
|
136
136
|
cellTags := ops.cellTags
|
|
137
137
|
hasUmi := ops.hasUmi
|
|
138
138
|
splitByC := ops.splitByC
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
if is_undefined(exportMinQuality) {
|
|
142
|
+
exportMinQuality = false
|
|
143
|
+
}
|
|
139
144
|
|
|
140
145
|
isSingleCell := !is_undefined(cellTags) && len(cellTags) > 0
|
|
141
146
|
hashCellKey := isSingleCell && len(cellTags) > 1
|
|
@@ -482,7 +487,7 @@ calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId) {
|
|
|
482
487
|
}
|
|
483
488
|
} ]
|
|
484
489
|
exportArgs += [ [ "-" + alphabetShortMixcr + "Feature" + imputedU, featureInFrameU ] ]
|
|
485
|
-
if !isImputed && !isAminoAcid {
|
|
490
|
+
if !isImputed && !isAminoAcid && exportMinQuality {
|
|
486
491
|
columnsSpecPerClonotypeNoAggregates += [ {
|
|
487
492
|
column: "minQual" + featureU,
|
|
488
493
|
id: "min-qual-" + featureL,
|
|
@@ -567,6 +567,38 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellT
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
|
+
{
|
|
571
|
+
column: "assemble.clonotypesDroppedByStopCodons",
|
|
572
|
+
id: "assemble-clonotypes-dropped-by-stop-codons",
|
|
573
|
+
allowNA: true,
|
|
574
|
+
naRegex: "NaN",
|
|
575
|
+
spec: {
|
|
576
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByStopCodons",
|
|
577
|
+
valueType: "Long",
|
|
578
|
+
annotations: {
|
|
579
|
+
"pl7.app/min": "0",
|
|
580
|
+
"pl7.app/table/orderPriority": "108200",
|
|
581
|
+
"pl7.app/table/visibility": "optional",
|
|
582
|
+
"pl7.app/label": "Clonotypes Dropped - Stop Codons"
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
column: "assemble.clonotypesDroppedByOutOfFrame",
|
|
588
|
+
id: "assemble-clonotypes-dropped-by-out-of-frame",
|
|
589
|
+
allowNA: true,
|
|
590
|
+
naRegex: "NaN",
|
|
591
|
+
spec: {
|
|
592
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByOutOfFrame",
|
|
593
|
+
valueType: "Long",
|
|
594
|
+
annotations: {
|
|
595
|
+
"pl7.app/min": "0",
|
|
596
|
+
"pl7.app/table/orderPriority": "108100",
|
|
597
|
+
"pl7.app/table/visibility": "optional",
|
|
598
|
+
"pl7.app/label": "Clonotypes Dropped - Out of Frame"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
570
602
|
{
|
|
571
603
|
column: "totalClonotypes",
|
|
572
604
|
id: "total-clonotypes",
|
|
@@ -1248,6 +1280,44 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellT
|
|
|
1248
1280
|
}
|
|
1249
1281
|
}]
|
|
1250
1282
|
|
|
1283
|
+
|
|
1284
|
+
scDropOrder := 107700
|
|
1285
|
+
for chain in chains {
|
|
1286
|
+
singleCellColumns += [{
|
|
1287
|
+
column: "assemble.clonotypesDroppedByOutOfFrameByChain." + chain,
|
|
1288
|
+
id: "assemble-clonotypes-dropped-by-out-of-frame-by-chain-" + chain,
|
|
1289
|
+
allowNA: true,
|
|
1290
|
+
naRegex: "NaN",
|
|
1291
|
+
spec: {
|
|
1292
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByOutOfFrameByChain/" + chain,
|
|
1293
|
+
valueType: "Long",
|
|
1294
|
+
annotations: {
|
|
1295
|
+
"pl7.app/min": "0",
|
|
1296
|
+
"pl7.app/table/orderPriority": string(scDropOrder),
|
|
1297
|
+
"pl7.app/table/visibility": "optional",
|
|
1298
|
+
"pl7.app/label": "Clonotypes Dropped - Out of Frame (" + chain + ")"
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
column: "assemble.clonotypesDroppedByStopCodonsByChain." + chain,
|
|
1304
|
+
id: "assemble-clonotypes-dropped-by-stop-codons-by-chain-" + chain,
|
|
1305
|
+
allowNA: true,
|
|
1306
|
+
naRegex: "NaN",
|
|
1307
|
+
spec: {
|
|
1308
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByStopCodonsByChain/" + chain,
|
|
1309
|
+
valueType: "Long",
|
|
1310
|
+
annotations: {
|
|
1311
|
+
"pl7.app/min": "0",
|
|
1312
|
+
"pl7.app/table/orderPriority": string(scDropOrder - 50),
|
|
1313
|
+
"pl7.app/table/visibility": "optional",
|
|
1314
|
+
"pl7.app/label": "Clonotypes Dropped - Stop Codons (" + chain + ")"
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}]
|
|
1318
|
+
scDropOrder -= 100
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1251
1321
|
for cellTag in cellTags {
|
|
1252
1322
|
singleCellColumns += [{
|
|
1253
1323
|
column: "refineTags." + cellTag + ".outputCount",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -129,13 +129,18 @@ addSpec := func(columns, additionalSpec) {
|
|
|
129
129
|
// Ordering rules
|
|
130
130
|
// AA Sequences
|
|
131
131
|
|
|
132
|
-
calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId) {
|
|
132
|
+
calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId, exportMinQuality) {
|
|
133
133
|
ops := exportSpecOpsFromPreset(presetSpecForBack)
|
|
134
134
|
|
|
135
135
|
assemblingFeature := ops.assemblingFeature
|
|
136
136
|
cellTags := ops.cellTags
|
|
137
137
|
hasUmi := ops.hasUmi
|
|
138
138
|
splitByC := ops.splitByC
|
|
139
|
+
|
|
140
|
+
// Default to false if not provided
|
|
141
|
+
if is_undefined(exportMinQuality) {
|
|
142
|
+
exportMinQuality = false
|
|
143
|
+
}
|
|
139
144
|
|
|
140
145
|
isSingleCell := !is_undefined(cellTags) && len(cellTags) > 0
|
|
141
146
|
hashCellKey := isSingleCell && len(cellTags) > 1
|
|
@@ -482,7 +487,7 @@ calculateExportSpecs := func(presetSpecForBack, sampleIdAxisSpec, blockId) {
|
|
|
482
487
|
}
|
|
483
488
|
} ]
|
|
484
489
|
exportArgs += [ [ "-" + alphabetShortMixcr + "Feature" + imputedU, featureInFrameU ] ]
|
|
485
|
-
if !isImputed && !isAminoAcid {
|
|
490
|
+
if !isImputed && !isAminoAcid && exportMinQuality {
|
|
486
491
|
columnsSpecPerClonotypeNoAggregates += [ {
|
|
487
492
|
column: "minQual" + featureU,
|
|
488
493
|
id: "min-qual-" + featureL,
|
|
@@ -21,7 +21,6 @@ self.defineOutputs("qcReportTable")
|
|
|
21
21
|
mixcrSw := assets.importSoftware("@platforma-open/milaboratories.software-mixcr:main")
|
|
22
22
|
ptablerSw := assets.importSoftware("@platforma-open/milaboratories.software-ptabler:main")
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
self.body(func(inputs) {
|
|
26
25
|
clnsData := inputs.clnsData
|
|
27
26
|
presetSpecForBack := inputs.presetSpecForBack
|
|
@@ -36,6 +35,10 @@ self.body(func(inputs) {
|
|
|
36
35
|
cellTags := presetSpecForBack.cellTags
|
|
37
36
|
singleCellChainTsvsData := inputs.singleCellChainTsvsData
|
|
38
37
|
|
|
38
|
+
featureForFlags := "CDR3"
|
|
39
|
+
isOOFColumn := "isOOF" + featureForFlags
|
|
40
|
+
hasStopsColumn := "hasStopsIn" + featureForFlags
|
|
41
|
+
|
|
39
42
|
chainInfos := {
|
|
40
43
|
"IGHeavy": { mixcrFilter: "IGH", name: "IG Heavy", shortName: "Heavy" },
|
|
41
44
|
"IGLight": { mixcrFilter: "IGK,IGL", name: "IG Light", shortName: "Light" },
|
|
@@ -127,6 +130,115 @@ self.body(func(inputs) {
|
|
|
127
130
|
// Join counts and overwrite totalClonotypes to reflect exported (productive) clones
|
|
128
131
|
joinedDf := processedDf.join(aggregatedCounts, { how: "left", on: ["sampleId"] })
|
|
129
132
|
|
|
133
|
+
// Count clonotypes filtered by stop codons and out-of-frame per sample
|
|
134
|
+
filterCountDfs := []
|
|
135
|
+
mixcrChainsArg := text.join(chainsForMixcr, ",")
|
|
136
|
+
for key, clnsFile in clnsFiles {
|
|
137
|
+
sampleId := json.decode(key)[0]
|
|
138
|
+
exportFiltersCmd := exec.builder().
|
|
139
|
+
inMediumQueue().
|
|
140
|
+
mem("16GiB").
|
|
141
|
+
cpu(2).
|
|
142
|
+
software(mixcrSw).
|
|
143
|
+
env("MI_USE_SYSTEM_CA", "true").
|
|
144
|
+
secret("MI_LICENSE", "MI_LICENSE").
|
|
145
|
+
arg("exportClones").
|
|
146
|
+
arg("--dont-split-files").
|
|
147
|
+
arg("--drop-default-fields").
|
|
148
|
+
arg("--reset-export-clone-table-splitting")
|
|
149
|
+
if mixcrChainsArg != "" {
|
|
150
|
+
exportFiltersCmd.arg("--chains").arg(mixcrChainsArg)
|
|
151
|
+
}
|
|
152
|
+
exportFiltersResult := exportFiltersCmd.
|
|
153
|
+
arg("-isOOF").arg(featureForFlags).
|
|
154
|
+
arg("-hasStops").arg(featureForFlags).
|
|
155
|
+
arg("clones.clns").
|
|
156
|
+
addFile("clones.clns", clnsFile).
|
|
157
|
+
arg("clones.tsv").
|
|
158
|
+
saveFile("clones.tsv").
|
|
159
|
+
cacheHours(3).
|
|
160
|
+
run()
|
|
161
|
+
filterTsv := exportFiltersResult.getFile("clones.tsv")
|
|
162
|
+
dfFilters := wf.frame(filterTsv, { xsvType: "tsv", inferSchema: false, schema: [ { column: isOOFColumn, type: "String" }, { column: hasStopsColumn, type: "String" } ] })
|
|
163
|
+
dfFilters = dfFilters.withColumns(
|
|
164
|
+
pt.when(pt.col(isOOFColumn).strToUpper().eq("TRUE")).then(pt.lit(1)).otherwise(pt.lit(0)).alias("__oof"),
|
|
165
|
+
pt.when(pt.col(hasStopsColumn).strToUpper().eq("TRUE")).then(pt.lit(1)).otherwise(pt.lit(0)).alias("__stop")
|
|
166
|
+
)
|
|
167
|
+
dfFilterCount := dfFilters.select(
|
|
168
|
+
pt.lit(sampleId).alias("sampleId"),
|
|
169
|
+
pt.col("__oof").sum().alias("assemble.clonotypesDroppedByOutOfFrame"),
|
|
170
|
+
pt.col("__stop").sum().alias("assemble.clonotypesDroppedByStopCodons")
|
|
171
|
+
)
|
|
172
|
+
filterCountDfs = append(filterCountDfs, dfFilterCount)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if len(filterCountDfs) > 0 {
|
|
176
|
+
filterCountsDf := len(filterCountDfs) > 1 ? pt.concat(filterCountDfs) : filterCountDfs[0]
|
|
177
|
+
joinedDf = joinedDf.join(filterCountsDf, { how: "left", on: ["sampleId"] })
|
|
178
|
+
} else {
|
|
179
|
+
joinedDf = joinedDf.withColumns(
|
|
180
|
+
pt.lit(0).alias("assemble.clonotypesDroppedByOutOfFrame"),
|
|
181
|
+
pt.lit(0).alias("assemble.clonotypesDroppedByStopCodons")
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Single-cell: per-chain counts of clonotypes dropped by stop codons / out-of-frame
|
|
186
|
+
if isSingleCell {
|
|
187
|
+
for chain in chains {
|
|
188
|
+
chainMixcr := chainInfos[chain].mixcrFilter
|
|
189
|
+
perChainFilterDfs := []
|
|
190
|
+
for key, clnsFile in clnsFiles {
|
|
191
|
+
sampleId := json.decode(key)[0]
|
|
192
|
+
exportChainFiltersCmd := exec.builder().
|
|
193
|
+
inMediumQueue().
|
|
194
|
+
mem("16GiB").
|
|
195
|
+
cpu(2).
|
|
196
|
+
software(mixcrSw).
|
|
197
|
+
env("MI_USE_SYSTEM_CA", "true").
|
|
198
|
+
secret("MI_LICENSE", "MI_LICENSE").
|
|
199
|
+
arg("exportClones").
|
|
200
|
+
arg("--dont-split-files").
|
|
201
|
+
arg("--drop-default-fields").
|
|
202
|
+
arg("--reset-export-clone-table-splitting").
|
|
203
|
+
arg("--chains").arg(chainMixcr)
|
|
204
|
+
exportChainFiltersResult := exportChainFiltersCmd.
|
|
205
|
+
arg("-isOOF").arg(featureForFlags).
|
|
206
|
+
arg("-hasStops").arg(featureForFlags).
|
|
207
|
+
arg("clones.clns").
|
|
208
|
+
addFile("clones.clns", clnsFile).
|
|
209
|
+
arg("clones.tsv").
|
|
210
|
+
saveFile("clones.tsv").
|
|
211
|
+
cacheHours(3).
|
|
212
|
+
run()
|
|
213
|
+
chainFilterTsv := exportChainFiltersResult.getFile("clones.tsv")
|
|
214
|
+
dfChainFilters := wf.frame(chainFilterTsv, { xsvType: "tsv", inferSchema: false, schema: [ { column: isOOFColumn, type: "String" }, { column: hasStopsColumn, type: "String" } ] })
|
|
215
|
+
dfChainFilters = dfChainFilters.withColumns(
|
|
216
|
+
pt.when(pt.col(isOOFColumn).strToUpper().eq("TRUE")).then(pt.lit(1)).otherwise(pt.lit(0)).alias("__oof"),
|
|
217
|
+
pt.when(pt.col(hasStopsColumn).strToUpper().eq("TRUE")).then(pt.lit(1)).otherwise(pt.lit(0)).alias("__stop")
|
|
218
|
+
)
|
|
219
|
+
dfChainCount := dfChainFilters.select(
|
|
220
|
+
pt.lit(sampleId).alias("sampleId"),
|
|
221
|
+
pt.col("__oof").sum().alias("assemble.clonotypesDroppedByOutOfFrameByChain." + chain),
|
|
222
|
+
pt.col("__stop").sum().alias("assemble.clonotypesDroppedByStopCodonsByChain." + chain)
|
|
223
|
+
)
|
|
224
|
+
perChainFilterDfs = append(perChainFilterDfs, dfChainCount)
|
|
225
|
+
}
|
|
226
|
+
if len(perChainFilterDfs) > 0 {
|
|
227
|
+
chainDf := len(perChainFilterDfs) > 1 ? pt.concat(perChainFilterDfs) : perChainFilterDfs[0]
|
|
228
|
+
chainAgg := chainDf.groupBy("sampleId").agg(
|
|
229
|
+
pt.col("assemble.clonotypesDroppedByOutOfFrameByChain." + chain).sum().alias("assemble.clonotypesDroppedByOutOfFrameByChain." + chain),
|
|
230
|
+
pt.col("assemble.clonotypesDroppedByStopCodonsByChain." + chain).sum().alias("assemble.clonotypesDroppedByStopCodonsByChain." + chain)
|
|
231
|
+
)
|
|
232
|
+
joinedDf = joinedDf.join(chainAgg, { how: "left", on: ["sampleId"] })
|
|
233
|
+
} else {
|
|
234
|
+
joinedDf = joinedDf.withColumns(
|
|
235
|
+
pt.lit(0).alias("assemble.clonotypesDroppedByOutOfFrameByChain." + chain),
|
|
236
|
+
pt.lit(0).alias("assemble.clonotypesDroppedByStopCodonsByChain." + chain)
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
130
242
|
// Per-chain clonotype counts
|
|
131
243
|
perChainJoined := joinedDf
|
|
132
244
|
for chain in chains {
|
|
@@ -254,6 +366,19 @@ self.body(func(inputs) {
|
|
|
254
366
|
}
|
|
255
367
|
}
|
|
256
368
|
|
|
369
|
+
finalDf = finalDf.withColumns(
|
|
370
|
+
pt.col("assemble.clonotypesDroppedByOutOfFrame").fillNull(0).cast("Long").alias("assemble.clonotypesDroppedByOutOfFrame"),
|
|
371
|
+
pt.col("assemble.clonotypesDroppedByStopCodons").fillNull(0).cast("Long").alias("assemble.clonotypesDroppedByStopCodons")
|
|
372
|
+
)
|
|
373
|
+
if isSingleCell {
|
|
374
|
+
for chain in chains {
|
|
375
|
+
finalDf = finalDf.withColumns(
|
|
376
|
+
pt.col("assemble.clonotypesDroppedByOutOfFrameByChain." + chain).fillNull(0).cast("Long").alias("assemble.clonotypesDroppedByOutOfFrameByChain." + chain),
|
|
377
|
+
pt.col("assemble.clonotypesDroppedByStopCodonsByChain." + chain).fillNull(0).cast("Long").alias("assemble.clonotypesDroppedByStopCodonsByChain." + chain)
|
|
378
|
+
)
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
257
382
|
for chain in chains {
|
|
258
383
|
col := "clonotypesByChain." + chain
|
|
259
384
|
finalDf = finalDf.withColumns(
|
package/src/main.tpl.tengo
CHANGED
|
@@ -122,7 +122,7 @@ wf.body(func(args) {
|
|
|
122
122
|
limitInput: limitInput,
|
|
123
123
|
perProcessMemGB: perProcessMemGB,
|
|
124
124
|
perProcessCPUs: perProcessCPUs,
|
|
125
|
-
|
|
125
|
+
cloneClusteringMode: args.cloneClusteringMode,
|
|
126
126
|
blockId: blockId,
|
|
127
127
|
libraryId: libraryId,
|
|
128
128
|
presetCommonName: args.presetCommonName,
|
|
@@ -131,7 +131,8 @@ wf.body(func(args) {
|
|
|
131
131
|
rightAlignmentMode: args.rightAlignmentMode,
|
|
132
132
|
materialType: args.materialType,
|
|
133
133
|
tagPattern: args.tagPattern,
|
|
134
|
-
assembleClonesBy: args.assembleClonesBy
|
|
134
|
+
assembleClonesBy: args.assembleClonesBy,
|
|
135
|
+
exportMinQuality: args.exportMinQuality
|
|
135
136
|
})
|
|
136
137
|
})
|
|
137
138
|
|
|
@@ -143,14 +143,19 @@ self.body(func(inputs) {
|
|
|
143
143
|
if !is_undefined(assembleClonesBy) {
|
|
144
144
|
mixcrCmdBuilder.arg("--assemble-clonotypes-by").arg(assembleClonesBy)
|
|
145
145
|
}
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
if
|
|
146
|
+
// Clone clustering tuning
|
|
147
|
+
cloneClusteringMode := params.cloneClusteringMode
|
|
148
|
+
if is_undefined(cloneClusteringMode) {
|
|
149
|
+
cloneClusteringMode = "default"
|
|
150
|
+
}
|
|
151
|
+
if cloneClusteringMode == "relaxed" {
|
|
149
152
|
mixcrCmdBuilder.
|
|
150
153
|
arg("-Massemble.cloneAssemblerParameters.minimalQuality=20").
|
|
151
154
|
arg("-Massemble.cloneAssemblerParameters.badQualityThreshold=10").
|
|
152
155
|
arg("-Massemble.cloneAssemblerParameters.cloneClusteringParameters.searchParameters=oneMismatchOrIndel").
|
|
153
156
|
arg("-Massemble.cloneAssemblerParameters.cloneClusteringParameters.searchDepth=1")
|
|
157
|
+
} else if cloneClusteringMode == "off" {
|
|
158
|
+
mixcrCmdBuilder.arg("-Massemble.cloneAssemblerParameters.cloneClusteringParameters=null")
|
|
154
159
|
}
|
|
155
160
|
|
|
156
161
|
inputMap := inputData.inputs()
|
package/src/process.tpl.tengo
CHANGED
|
@@ -203,7 +203,7 @@ self.body(func(inputs) {
|
|
|
203
203
|
}
|
|
204
204
|
} ]
|
|
205
205
|
|
|
206
|
-
exportSpecs := calculateExportSpecs(presetSpecForBack, sampleIdAxisSpec, blockId)
|
|
206
|
+
exportSpecs := calculateExportSpecs(presetSpecForBack, sampleIdAxisSpec, blockId, params.exportMinQuality)
|
|
207
207
|
|
|
208
208
|
columnsSpecPerSample := exportSpecs.columnsSpecPerSample
|
|
209
209
|
columnsSpecPerSampleSc := exportSpecs.columnsSpecPerSampleSc
|
|
@@ -273,7 +273,7 @@ self.body(func(inputs) {
|
|
|
273
273
|
materialType: params.materialType,
|
|
274
274
|
tagPattern: params.tagPattern,
|
|
275
275
|
assembleClonesBy: params.assembleClonesBy,
|
|
276
|
-
|
|
276
|
+
cloneClusteringMode: params.cloneClusteringMode
|
|
277
277
|
},
|
|
278
278
|
library: library,
|
|
279
279
|
presetContent: presetContent
|
|
@@ -567,6 +567,38 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellT
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
|
+
{
|
|
571
|
+
column: "assemble.clonotypesDroppedByStopCodons",
|
|
572
|
+
id: "assemble-clonotypes-dropped-by-stop-codons",
|
|
573
|
+
allowNA: true,
|
|
574
|
+
naRegex: "NaN",
|
|
575
|
+
spec: {
|
|
576
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByStopCodons",
|
|
577
|
+
valueType: "Long",
|
|
578
|
+
annotations: {
|
|
579
|
+
"pl7.app/min": "0",
|
|
580
|
+
"pl7.app/table/orderPriority": "108200",
|
|
581
|
+
"pl7.app/table/visibility": "optional",
|
|
582
|
+
"pl7.app/label": "Clonotypes Dropped - Stop Codons"
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
column: "assemble.clonotypesDroppedByOutOfFrame",
|
|
588
|
+
id: "assemble-clonotypes-dropped-by-out-of-frame",
|
|
589
|
+
allowNA: true,
|
|
590
|
+
naRegex: "NaN",
|
|
591
|
+
spec: {
|
|
592
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByOutOfFrame",
|
|
593
|
+
valueType: "Long",
|
|
594
|
+
annotations: {
|
|
595
|
+
"pl7.app/min": "0",
|
|
596
|
+
"pl7.app/table/orderPriority": "108100",
|
|
597
|
+
"pl7.app/table/visibility": "optional",
|
|
598
|
+
"pl7.app/label": "Clonotypes Dropped - Out of Frame"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
570
602
|
{
|
|
571
603
|
column: "totalClonotypes",
|
|
572
604
|
id: "total-clonotypes",
|
|
@@ -1248,6 +1280,44 @@ getQcReportColumns := func(hasUmi, isSingleCell, sampleIdAxisSpec, chains, cellT
|
|
|
1248
1280
|
}
|
|
1249
1281
|
}]
|
|
1250
1282
|
|
|
1283
|
+
// Single-cell per-chain dropped clonotypes by OOF / stop codons
|
|
1284
|
+
scDropOrder := 107700
|
|
1285
|
+
for chain in chains {
|
|
1286
|
+
singleCellColumns += [{
|
|
1287
|
+
column: "assemble.clonotypesDroppedByOutOfFrameByChain." + chain,
|
|
1288
|
+
id: "assemble-clonotypes-dropped-by-out-of-frame-by-chain-" + chain,
|
|
1289
|
+
allowNA: true,
|
|
1290
|
+
naRegex: "NaN",
|
|
1291
|
+
spec: {
|
|
1292
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByOutOfFrameByChain/" + chain,
|
|
1293
|
+
valueType: "Long",
|
|
1294
|
+
annotations: {
|
|
1295
|
+
"pl7.app/min": "0",
|
|
1296
|
+
"pl7.app/table/orderPriority": string(scDropOrder),
|
|
1297
|
+
"pl7.app/table/visibility": "optional",
|
|
1298
|
+
"pl7.app/label": "Clonotypes Dropped - Out of Frame (" + chain + ")"
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
column: "assemble.clonotypesDroppedByStopCodonsByChain." + chain,
|
|
1304
|
+
id: "assemble-clonotypes-dropped-by-stop-codons-by-chain-" + chain,
|
|
1305
|
+
allowNA: true,
|
|
1306
|
+
naRegex: "NaN",
|
|
1307
|
+
spec: {
|
|
1308
|
+
name: "mixcr.com/reports/assemble/clonotypesDroppedByStopCodonsByChain/" + chain,
|
|
1309
|
+
valueType: "Long",
|
|
1310
|
+
annotations: {
|
|
1311
|
+
"pl7.app/min": "0",
|
|
1312
|
+
"pl7.app/table/orderPriority": string(scDropOrder - 50),
|
|
1313
|
+
"pl7.app/table/visibility": "optional",
|
|
1314
|
+
"pl7.app/label": "Clonotypes Dropped - Stop Codons (" + chain + ")"
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}]
|
|
1318
|
+
scDropOrder -= 100
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1251
1321
|
for cellTag in cellTags {
|
|
1252
1322
|
singleCellColumns += [{
|
|
1253
1323
|
column: "refineTags." + cellTag + ".outputCount",
|
|
@@ -9,7 +9,7 @@ self.defineOutputs("exportSpecs")
|
|
|
9
9
|
self.body(func(inputs) {
|
|
10
10
|
presetSpecForBack := inputs.presetSpecForBack.getDataAsJson()
|
|
11
11
|
|
|
12
|
-
exportSpecs := calculateExportSpecs(presetSpecForBack, {}, "test")
|
|
12
|
+
exportSpecs := calculateExportSpecs(presetSpecForBack, {}, "test", false)
|
|
13
13
|
exportSpecs = maps.deepMerge(exportSpecs, {
|
|
14
14
|
axisByClonotypeKeyGen: undefined,
|
|
15
15
|
axisByScClonotypeKeyGen: undefined,
|
|
@@ -7,7 +7,7 @@ render := import("@platforma-sdk/workflow-tengo:render")
|
|
|
7
7
|
calculatePresetInfoTpl := assets.importTemplate(":calculate-preset-info")
|
|
8
8
|
columnsCalculateTpl := assets.importTemplate(":test.columns-calculate")
|
|
9
9
|
|
|
10
|
-
self.defineOutputs("
|
|
10
|
+
self.defineOutputs("exportSpecs")
|
|
11
11
|
|
|
12
12
|
self.body(func(inputs) {
|
|
13
13
|
preset := inputs.preset
|