@platforma-open/milaboratories.mixcr-clonotyping-2.workflow 2.0.0 → 2.1.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/.turbo/turbo-test.log +10 -10
- package/CHANGELOG.md +14 -0
- package/dist/tengo/lib/calculate-export-specs.lib.tengo +49 -35
- 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/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.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 +7 -4
- package/src/calculate-export-specs.lib.tengo +49 -35
- package/src/main.tpl.tengo +5 -8
- package/src/mixcr-export.tpl.tengo +1 -0
- package/src/process.tpl.tengo +39 -18
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.
|
|
2
|
+
> @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.1.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
5
|
Processing "src/aggregate-by-clonotype-key.tpl.tengo"...
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
> @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.
|
|
2
|
+
> @platforma-open/milaboratories.mixcr-clonotyping-2.workflow@2.1.0 test /home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow
|
|
3
3
|
> vitest
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.8 [39m[90m/home/runner/work/mixcr-clonotyping-2/mixcr-clonotyping-2/workflow[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m src/test/columns.test.ts [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
9
|
-
[33m[2m✓[22m[39m checking preset for 'milab-human-dna-xcr-7genes-multiplex' [
|
|
10
|
-
[33m[2m✓[22m[39m checking preset for '10x-sc-xcr-vdj' [
|
|
11
|
-
[33m[2m✓[22m[39m checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' [
|
|
12
|
-
[33m[2m✓[22m[39m checking preset for 'takara-human-rna-bcr-umi-smartseq' [
|
|
13
|
-
[33m[2m✓[22m[39m checking preset for 'rna-seq' [
|
|
14
|
-
[33m[2m✓[22m[39m checking preset for 'generic-single-cell-gex' [
|
|
8
|
+
[32m✓[39m src/test/columns.test.ts [2m([22m[2m6 tests[22m[2m)[22m[33m 48155[2mms[22m[39m
|
|
9
|
+
[33m[2m✓[22m[39m checking preset for 'milab-human-dna-xcr-7genes-multiplex' [33m11939[2mms[22m[39m
|
|
10
|
+
[33m[2m✓[22m[39m checking preset for '10x-sc-xcr-vdj' [33m7604[2mms[22m[39m
|
|
11
|
+
[33m[2m✓[22m[39m checking preset for 'cellecta-human-rna-xcr-umi-drivermap-…' [33m7330[2mms[22m[39m
|
|
12
|
+
[33m[2m✓[22m[39m checking preset for 'takara-human-rna-bcr-umi-smartseq' [33m7316[2mms[22m[39m
|
|
13
|
+
[33m[2m✓[22m[39m checking preset for 'rna-seq' [33m6894[2mms[22m[39m
|
|
14
|
+
[33m[2m✓[22m[39m checking preset for 'generic-single-cell-gex' [33m7071[2mms[22m[39m
|
|
15
15
|
|
|
16
16
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
17
17
|
[2m Tests [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
18
|
-
[2m Start at [22m
|
|
19
|
-
[2m Duration [22m 48.
|
|
18
|
+
[2m Start at [22m 20:11:15
|
|
19
|
+
[2m Duration [22m 48.92s[2m (transform 45ms, setup 0ms, collect 537ms, tests 48.16s, environment 0ms, prepare 61ms)[22m
|
|
20
20
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @platforma-open/milaboratories.mixcr-clonotyping.workflow
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a168fe3: pl7.app/abundance/isPrimary and pl7.app/isAnchor annotations added to the output columns
|
|
8
|
+
|
|
9
|
+
## 2.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6c45177: Chain is added to output columns domain
|
|
14
|
+
- Updated dependencies [6c45177]
|
|
15
|
+
- @platforma-open/milaboratories.mixcr-clonotyping-2.sc-clonotype-builder@1.0.1
|
|
16
|
+
|
|
3
17
|
## 2.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
|
@@ -107,37 +107,39 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
columnsSpecPerSample += [ {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
110
|
+
column: "readCount",
|
|
111
|
+
id: "read-count",
|
|
112
|
+
allowNA: false,
|
|
113
|
+
spec: {
|
|
114
|
+
name: "pl7.app/vdj/readCount",
|
|
115
|
+
valueType: "Long",
|
|
116
|
+
annotations: a(90000, !hasUmi, {
|
|
117
|
+
"pl7.app/min": "1",
|
|
118
|
+
"pl7.app/isAbundance": "true",
|
|
119
|
+
"pl7.app/abundance/unit": "reads",
|
|
120
|
+
"pl7.app/abundance/normalized": "false",
|
|
121
|
+
"pl7.app/abundance/isPrimary": string(!hasUmi),
|
|
122
|
+
"pl7.app/label": "Number Of Reads"
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
column: "readFraction",
|
|
127
|
+
id: "read-fraction",
|
|
128
|
+
allowNA: false,
|
|
129
|
+
spec: {
|
|
130
|
+
name: "pl7.app/vdj/readFraction",
|
|
131
|
+
valueType: "Double",
|
|
132
|
+
annotations: a(89000, !hasUmi, {
|
|
133
|
+
"pl7.app/min": "0",
|
|
134
|
+
"pl7.app/max": "1",
|
|
135
|
+
"pl7.app/isAbundance": "true",
|
|
136
|
+
"pl7.app/abundance/unit": "reads",
|
|
137
|
+
"pl7.app/abundance/normalized": "true",
|
|
138
|
+
"pl7.app/abundance/isPrimary": string(!hasUmi),
|
|
139
|
+
"pl7.app/label": "Fraction of reads"
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
} ]
|
|
141
143
|
exportArgs += [
|
|
142
144
|
[ "-readCount" ],
|
|
143
145
|
[ "-readFraction" ]
|
|
@@ -157,6 +159,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
157
159
|
"pl7.app/isAbundance": "true",
|
|
158
160
|
"pl7.app/abundance/unit": "molecules",
|
|
159
161
|
"pl7.app/abundance/normalized": "false",
|
|
162
|
+
"pl7.app/abundance/isPrimary": "true",
|
|
160
163
|
"pl7.app/label": "Number of UMI"
|
|
161
164
|
})
|
|
162
165
|
}
|
|
@@ -173,6 +176,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
173
176
|
"pl7.app/isAbundance": "true",
|
|
174
177
|
"pl7.app/abundance/unit": "molecules",
|
|
175
178
|
"pl7.app/abundance/normalized": "true",
|
|
179
|
+
"pl7.app/abundance/isPrimary": "true",
|
|
176
180
|
"pl7.app/label": "Fraction of UMI"
|
|
177
181
|
})
|
|
178
182
|
}
|
|
@@ -229,13 +233,19 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
229
233
|
|
|
230
234
|
|
|
231
235
|
|
|
236
|
+
|
|
237
|
+
anchorFeature := undefined;
|
|
238
|
+
|
|
232
239
|
features := undefined
|
|
233
240
|
if is_undefined(assemblingFeature) {
|
|
234
241
|
features = ["CDR1", "FR1", "FR2", "CDR2", "FR3", "CDR3", "FR4"]
|
|
242
|
+
anchorFeature = "CDR3"
|
|
235
243
|
} else if assemblingFeature != "CDR3" {
|
|
236
244
|
features = [assemblingFeature, "CDR1", "FR1", "FR2", "CDR2", "FR3", "CDR3", "FR4"]
|
|
245
|
+
anchorFeature = assemblingFeature
|
|
237
246
|
} else {
|
|
238
247
|
features = ["CDR3"]
|
|
248
|
+
anchorFeature = "CDR3"
|
|
239
249
|
}
|
|
240
250
|
|
|
241
251
|
for isImputed in ( is_undefined(assemblingFeature) ? [false, true] : [false] ) {
|
|
@@ -248,6 +258,13 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
248
258
|
alphabetShort := isAminoAcid ? "aa" : "nt"
|
|
249
259
|
alphabetShortMixcr := isAminoAcid ? "aa" : "n"
|
|
250
260
|
visibility := (featureU == "CDR3") || (featureU == assemblingFeature)
|
|
261
|
+
annotations := {
|
|
262
|
+
"pl7.app/vdj/imputed": string(isImputed),
|
|
263
|
+
"pl7.app/label": featureU + " " + alphabetShort
|
|
264
|
+
}
|
|
265
|
+
if featureU == anchorFeature && !isImputed && !isAminoAcid {
|
|
266
|
+
annotations["pl7.app/isAnchor"] = "true"
|
|
267
|
+
}
|
|
251
268
|
columnsSpecPerClonotype += [ {
|
|
252
269
|
column: alphabetShortMixcr + "Seq" + imputedU + featureU,
|
|
253
270
|
id: alphabetShortMixcr + "-seq-" + featureL + (isImputed ? "-imputed" : ""),
|
|
@@ -259,10 +276,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
259
276
|
"pl7.app/vdj/feature": featureU,
|
|
260
277
|
"pl7.app/alphabet": alphabet
|
|
261
278
|
},
|
|
262
|
-
annotations: a(orderP, visibility,
|
|
263
|
-
"pl7.app/vdj/imputed": string(isImputed),
|
|
264
|
-
"pl7.app/label": featureU + " " + alphabetShort
|
|
265
|
-
})
|
|
279
|
+
annotations: a(orderP, visibility, annotations)
|
|
266
280
|
}
|
|
267
281
|
} ]
|
|
268
282
|
exportArgs += [ [ "-" + alphabetShortMixcr + "Feature" + imputedU, featureU ] ]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.mixcr-clonotyping-2.workflow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Tengo-based template",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@platforma-open/milaboratories.mixcr-clonotyping-2.sc-clonotype-builder": "1.0.1"
|
|
7
|
+
},
|
|
5
8
|
"devDependencies": {
|
|
6
9
|
"@platforma-sdk/tengo-builder": "^1.19.2",
|
|
7
|
-
"@platforma-sdk/workflow-tengo": "^2.15.
|
|
10
|
+
"@platforma-sdk/workflow-tengo": "^2.15.6",
|
|
8
11
|
"@milaboratories/software-pframes-conv": "2.1.16",
|
|
9
|
-
"@platforma-open/milaboratories.software-small-binaries": "^1.15.
|
|
12
|
+
"@platforma-open/milaboratories.software-small-binaries": "^1.15.15",
|
|
10
13
|
"@platforma-open/milaboratories.software-mixcr": "4.7.0-147-develop",
|
|
11
14
|
"@platforma-open/milaboratories.software-ptransform": "^1.3.1",
|
|
12
|
-
"@platforma-sdk/test": "^1.22.
|
|
15
|
+
"@platforma-sdk/test": "^1.22.87",
|
|
13
16
|
"vitest": "^2.1.8",
|
|
14
17
|
"typescript": "~5.5.4"
|
|
15
18
|
},
|
|
@@ -107,37 +107,39 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
107
107
|
// Abundance
|
|
108
108
|
|
|
109
109
|
columnsSpecPerSample += [ {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
110
|
+
column: "readCount",
|
|
111
|
+
id: "read-count",
|
|
112
|
+
allowNA: false,
|
|
113
|
+
spec: {
|
|
114
|
+
name: "pl7.app/vdj/readCount",
|
|
115
|
+
valueType: "Long",
|
|
116
|
+
annotations: a(90000, !hasUmi, {
|
|
117
|
+
"pl7.app/min": "1",
|
|
118
|
+
"pl7.app/isAbundance": "true",
|
|
119
|
+
"pl7.app/abundance/unit": "reads",
|
|
120
|
+
"pl7.app/abundance/normalized": "false",
|
|
121
|
+
"pl7.app/abundance/isPrimary": string(!hasUmi),
|
|
122
|
+
"pl7.app/label": "Number Of Reads"
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
column: "readFraction",
|
|
127
|
+
id: "read-fraction",
|
|
128
|
+
allowNA: false,
|
|
129
|
+
spec: {
|
|
130
|
+
name: "pl7.app/vdj/readFraction",
|
|
131
|
+
valueType: "Double",
|
|
132
|
+
annotations: a(89000, !hasUmi, {
|
|
133
|
+
"pl7.app/min": "0",
|
|
134
|
+
"pl7.app/max": "1",
|
|
135
|
+
"pl7.app/isAbundance": "true",
|
|
136
|
+
"pl7.app/abundance/unit": "reads",
|
|
137
|
+
"pl7.app/abundance/normalized": "true",
|
|
138
|
+
"pl7.app/abundance/isPrimary": string(!hasUmi),
|
|
139
|
+
"pl7.app/label": "Fraction of reads"
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
} ]
|
|
141
143
|
exportArgs += [
|
|
142
144
|
[ "-readCount" ],
|
|
143
145
|
[ "-readFraction" ]
|
|
@@ -157,6 +159,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
157
159
|
"pl7.app/isAbundance": "true",
|
|
158
160
|
"pl7.app/abundance/unit": "molecules",
|
|
159
161
|
"pl7.app/abundance/normalized": "false",
|
|
162
|
+
"pl7.app/abundance/isPrimary": "true",
|
|
160
163
|
"pl7.app/label": "Number of UMI"
|
|
161
164
|
})
|
|
162
165
|
}
|
|
@@ -173,6 +176,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
173
176
|
"pl7.app/isAbundance": "true",
|
|
174
177
|
"pl7.app/abundance/unit": "molecules",
|
|
175
178
|
"pl7.app/abundance/normalized": "true",
|
|
179
|
+
"pl7.app/abundance/isPrimary": "true",
|
|
176
180
|
"pl7.app/label": "Fraction of UMI"
|
|
177
181
|
})
|
|
178
182
|
}
|
|
@@ -229,13 +233,19 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
229
233
|
|
|
230
234
|
// Sequences
|
|
231
235
|
|
|
236
|
+
// column with nucleotide sequence of this feature will be marked as anchor
|
|
237
|
+
anchorFeature := undefined;
|
|
238
|
+
|
|
232
239
|
features := undefined
|
|
233
240
|
if is_undefined(assemblingFeature) {
|
|
234
241
|
features = ["CDR1", "FR1", "FR2", "CDR2", "FR3", "CDR3", "FR4"]
|
|
242
|
+
anchorFeature = "CDR3"
|
|
235
243
|
} else if assemblingFeature != "CDR3" {
|
|
236
244
|
features = [assemblingFeature, "CDR1", "FR1", "FR2", "CDR2", "FR3", "CDR3", "FR4"]
|
|
245
|
+
anchorFeature = assemblingFeature
|
|
237
246
|
} else {
|
|
238
247
|
features = ["CDR3"]
|
|
248
|
+
anchorFeature = "CDR3"
|
|
239
249
|
}
|
|
240
250
|
|
|
241
251
|
for isImputed in ( is_undefined(assemblingFeature) ? [false, true] : [false] ) {
|
|
@@ -248,6 +258,13 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
248
258
|
alphabetShort := isAminoAcid ? "aa" : "nt"
|
|
249
259
|
alphabetShortMixcr := isAminoAcid ? "aa" : "n"
|
|
250
260
|
visibility := (featureU == "CDR3") || (featureU == assemblingFeature)
|
|
261
|
+
annotations := {
|
|
262
|
+
"pl7.app/vdj/imputed": string(isImputed),
|
|
263
|
+
"pl7.app/label": featureU + " " + alphabetShort
|
|
264
|
+
}
|
|
265
|
+
if featureU == anchorFeature && !isImputed && !isAminoAcid {
|
|
266
|
+
annotations["pl7.app/isAnchor"] = "true"
|
|
267
|
+
}
|
|
251
268
|
columnsSpecPerClonotype += [ {
|
|
252
269
|
column: alphabetShortMixcr + "Seq" + imputedU + featureU,
|
|
253
270
|
id: alphabetShortMixcr + "-seq-" + featureL + (isImputed ? "-imputed" : ""),
|
|
@@ -259,10 +276,7 @@ calculateExportSpecs := func(presetSpecForBack, blockId) {
|
|
|
259
276
|
"pl7.app/vdj/feature": featureU,
|
|
260
277
|
"pl7.app/alphabet": alphabet
|
|
261
278
|
},
|
|
262
|
-
annotations: a(orderP, visibility,
|
|
263
|
-
"pl7.app/vdj/imputed": string(isImputed),
|
|
264
|
-
"pl7.app/label": featureU + " " + alphabetShort
|
|
265
|
-
})
|
|
279
|
+
annotations: a(orderP, visibility, annotations)
|
|
266
280
|
}
|
|
267
281
|
} ]
|
|
268
282
|
exportArgs += [ [ "-" + alphabetShortMixcr + "Feature" + imputedU, featureU ] ]
|
package/src/main.tpl.tengo
CHANGED
|
@@ -20,7 +20,7 @@ processTpl := assets.importTemplate(":process")
|
|
|
20
20
|
wf.setPreRun(assets.importTemplate(":prerun"))
|
|
21
21
|
|
|
22
22
|
wf.prepare(func(args){
|
|
23
|
-
return{
|
|
23
|
+
return {
|
|
24
24
|
resolvedLibraryInput: wf.resolve(args.inputLibrary, { errIfMissing: false })
|
|
25
25
|
}
|
|
26
26
|
})
|
|
@@ -93,13 +93,10 @@ wf.body(func(args) {
|
|
|
93
93
|
presetSpecForBack := presetInfoResult.output("presetSpecForBack", 24 * 60 * 60 * 1000)
|
|
94
94
|
|
|
95
95
|
// calculating chains
|
|
96
|
-
chains := [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{ name: "TRB", mixcrChain: "TRB" },
|
|
101
|
-
{ name: "TRD", mixcrChain: "TRD" },
|
|
102
|
-
{ name: "TRG", mixcrChain: "TRG" } ]
|
|
96
|
+
chains := ["IGHeavy", "IGLight", "TRA", "TRB", "TRD", "TRG"]
|
|
97
|
+
if !is_undefined(args.chains) {
|
|
98
|
+
chains = args.chains
|
|
99
|
+
}
|
|
103
100
|
|
|
104
101
|
runMixcr := render.createEphemeral(processTpl, {
|
|
105
102
|
inputSpec: input.getFutureInputField("spec"),
|
package/src/process.tpl.tengo
CHANGED
|
@@ -7,6 +7,7 @@ assets := import("@platforma-sdk/workflow-tengo:assets")
|
|
|
7
7
|
pframes := import("@platforma-sdk/workflow-tengo:pframes")
|
|
8
8
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
9
9
|
slices := import("@platforma-sdk/workflow-tengo:slices")
|
|
10
|
+
maps := import("@platforma-sdk/workflow-tengo:maps")
|
|
10
11
|
file := import("@platforma-sdk/workflow-tengo:file")
|
|
11
12
|
llPFrames := import("@platforma-sdk/workflow-tengo:pframes.ll")
|
|
12
13
|
pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
|
|
@@ -28,6 +29,21 @@ self.awaitState("inputSpec", "ResourceReady")
|
|
|
28
29
|
self.awaitState("presetSpecForBack", "ResourceReady")
|
|
29
30
|
self.awaitState("presetContent", "ResourceReady")
|
|
30
31
|
|
|
32
|
+
chainInfos := {
|
|
33
|
+
"IGHeavy": { mixcrFilter: "IGH", name: "IG Heavy" },
|
|
34
|
+
"IGLight": { mixcrFilter: "IGK,IGL", name: "IG Light" },
|
|
35
|
+
"TRA": { mixcrFilter: "TRA", name: "TRA" },
|
|
36
|
+
"TRB": { mixcrFilter: "TRB", name: "TRB" },
|
|
37
|
+
"TRD": { mixcrFilter: "TRD", name: "TRD" },
|
|
38
|
+
"TRG": { mixcrFilter: "TRG", name: "TRG" }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
receptorInfo := {
|
|
42
|
+
"IG": { chains: ["IGHeavy", "IGLight"], name: "IG" },
|
|
43
|
+
"TRAB": { chains: ["TRB", "TRA"], name: "TRAB" },
|
|
44
|
+
"TRGD": { chains: ["TRD", "TRG"], name: "TRGD" }
|
|
45
|
+
}
|
|
46
|
+
|
|
31
47
|
self.body(func(inputs) {
|
|
32
48
|
|
|
33
49
|
inputSpec := inputs.inputSpec
|
|
@@ -198,6 +214,7 @@ self.body(func(inputs) {
|
|
|
198
214
|
name: "pl7.app/sequencing/readIndex",
|
|
199
215
|
optional: true
|
|
200
216
|
}],
|
|
217
|
+
|
|
201
218
|
// resulting aggregation axes names will be checked against supported combinations
|
|
202
219
|
// in the body template
|
|
203
220
|
passAggregationAxesNames: true,
|
|
@@ -225,6 +242,22 @@ self.body(func(inputs) {
|
|
|
225
242
|
clonotypes := pframes.pFrameBuilder()
|
|
226
243
|
|
|
227
244
|
for chain in chains {
|
|
245
|
+
chainInfo := chainInfos[chain]
|
|
246
|
+
additionalSpec := {
|
|
247
|
+
spec: {
|
|
248
|
+
domain: {
|
|
249
|
+
"pl7.app/chain": chain
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
columnSpecsTransform := func(specs) {
|
|
254
|
+
return slices.map(specs, func(spec) {
|
|
255
|
+
return maps.deepMerge(spec, additionalSpec)
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
traceSteps := [{type: "milaboratories.mixcr-clonotyping.export", id: blockId + "." + chain, importance: 80, label: chainInfo.name}]
|
|
260
|
+
|
|
228
261
|
exportOutputs := [ {
|
|
229
262
|
type: "Resource",
|
|
230
263
|
spec: {
|
|
@@ -237,17 +270,6 @@ self.body(func(inputs) {
|
|
|
237
270
|
},
|
|
238
271
|
name: "clonotypeTable",
|
|
239
272
|
path: ["tsv"]
|
|
240
|
-
// }, {
|
|
241
|
-
// type: "Xsv",
|
|
242
|
-
// xsvType: "tsv",
|
|
243
|
-
// settings: {
|
|
244
|
-
// axes: axesByClonotypeId,
|
|
245
|
-
// columns: columnsSpec,
|
|
246
|
-
// storageFormat: "Binary",
|
|
247
|
-
// partitionKeyLength: 0
|
|
248
|
-
// },
|
|
249
|
-
// name: "byCloneId",
|
|
250
|
-
// path: ["tsv"]
|
|
251
273
|
} ]
|
|
252
274
|
|
|
253
275
|
if !is_undefined(axesByClonotypeKey) {
|
|
@@ -256,7 +278,7 @@ self.body(func(inputs) {
|
|
|
256
278
|
xsvType: "tsv",
|
|
257
279
|
settings: {
|
|
258
280
|
axes: axesByClonotypeKey,
|
|
259
|
-
columns: columnsSpecPerSample,
|
|
281
|
+
columns: columnSpecsTransform(columnsSpecPerSample),
|
|
260
282
|
storageFormat: "Binary",
|
|
261
283
|
partitionKeyLength: 0
|
|
262
284
|
},
|
|
@@ -271,11 +293,11 @@ self.body(func(inputs) {
|
|
|
271
293
|
exportOutputs,
|
|
272
294
|
{
|
|
273
295
|
// will be automatically propagated to all output specs
|
|
274
|
-
traceSteps:
|
|
296
|
+
traceSteps: traceSteps,
|
|
275
297
|
|
|
276
298
|
extra: {
|
|
277
299
|
params: {
|
|
278
|
-
chains:
|
|
300
|
+
chains: chainInfo.mixcrFilter,
|
|
279
301
|
clonotypeKeyColumns: clonotypeKeyColumns,
|
|
280
302
|
exportArgs: exportArgs
|
|
281
303
|
}
|
|
@@ -283,15 +305,14 @@ self.body(func(inputs) {
|
|
|
283
305
|
}
|
|
284
306
|
)
|
|
285
307
|
|
|
286
|
-
|
|
287
|
-
exportResults.addXsvOutputToBuilder(clonotypes, "byCloneKeyBySample", "byCloneKeyBySample/" + chain.name + "/")
|
|
308
|
+
exportResults.addXsvOutputToBuilder(clonotypes, "byCloneKeyBySample", "byCloneKeyBySample/" + chain + "/")
|
|
288
309
|
|
|
289
310
|
aggregationOutputs := [ {
|
|
290
311
|
type: "Xsv",
|
|
291
312
|
xsvType: "tsv",
|
|
292
313
|
settings: {
|
|
293
314
|
axes: axesByClonotypeKey,
|
|
294
|
-
columns: columnsSpecPerClonotype,
|
|
315
|
+
columns: columnSpecsTransform(columnsSpecPerClonotype),
|
|
295
316
|
storageFormat: "Binary",
|
|
296
317
|
partitionKeyLength: 0
|
|
297
318
|
},
|
|
@@ -316,7 +337,7 @@ self.body(func(inputs) {
|
|
|
316
337
|
}
|
|
317
338
|
)
|
|
318
339
|
|
|
319
|
-
aggregateByCloneKey.addXsvOutputToBuilder(clonotypes, "byCloneKey", "byCloneKey/" + chain
|
|
340
|
+
aggregateByCloneKey.addXsvOutputToBuilder(clonotypes, "byCloneKey", "byCloneKey/" + chain + "/")
|
|
320
341
|
}
|
|
321
342
|
|
|
322
343
|
return {
|