@platforma-open/milaboratories.mixcr-shm-trees.workflow 2.0.1 → 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/CHANGELOG.md +6 -0
- package/dist/tengo/lib/export-settings.lib.tengo +9 -11
- package/dist/tengo/tpl/main.plj.gz +0 -0
- package/dist/tengo/tpl/process.plj.gz +0 -0
- package/dist/tengo/tpl/reconstruct-shm-trees.plj.gz +0 -0
- package/package.json +6 -6
- package/src/export-settings.lib.tengo +9 -11
- package/src/process.tpl.tengo +8 -4
- package/src/reconstruct-shm-trees.tpl.tengo +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -13,9 +13,7 @@ text := import("text")
|
|
|
13
13
|
allowNA := true
|
|
14
14
|
|
|
15
15
|
// export of threes whithout nodes
|
|
16
|
-
shmTreeTableOptions := func(dataDescription
|
|
17
|
-
// TODO add forChain if runWithSingleCell
|
|
18
|
-
|
|
16
|
+
shmTreeTableOptions := func(dataDescription) {
|
|
19
17
|
axes := []
|
|
20
18
|
columns := []
|
|
21
19
|
cmdArgs := []
|
|
@@ -33,7 +31,7 @@ shmTreeTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
33
31
|
}
|
|
34
32
|
})
|
|
35
33
|
|
|
36
|
-
if
|
|
34
|
+
if dataDescription["cellsAssembled"] {
|
|
37
35
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
38
36
|
axes = append(axes, {
|
|
39
37
|
"column": "subtreeId",
|
|
@@ -224,9 +222,7 @@ shmTreeTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
224
222
|
}
|
|
225
223
|
|
|
226
224
|
// export data that is uniq for node
|
|
227
|
-
shmTreeNodesTableOptions := func(dataDescription
|
|
228
|
-
// TODO add forChain if runWithSingleCell
|
|
229
|
-
|
|
225
|
+
shmTreeNodesTableOptions := func(dataDescription) {
|
|
230
226
|
axes := []
|
|
231
227
|
columns := []
|
|
232
228
|
cmdArgs := []
|
|
@@ -244,7 +240,7 @@ shmTreeNodesTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
244
240
|
}
|
|
245
241
|
})
|
|
246
242
|
|
|
247
|
-
if
|
|
243
|
+
if dataDescription["cellsAssembled"] {
|
|
248
244
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
249
245
|
axes = append(axes, {
|
|
250
246
|
"column": "subtreeId",
|
|
@@ -424,8 +420,7 @@ shmTreeNodesTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
424
420
|
|
|
425
421
|
// export data that is unique for clones, but not unique for a node
|
|
426
422
|
// (different clones could be in the same topology node, for example, different time points)
|
|
427
|
-
shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn
|
|
428
|
-
// TODO add forChain if runWithSingleCell
|
|
423
|
+
shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn) {
|
|
429
424
|
donorColumnSpec := donorColumn.get("spec").getDataAsJson()
|
|
430
425
|
|
|
431
426
|
axes := []
|
|
@@ -445,7 +440,7 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
445
440
|
}
|
|
446
441
|
})
|
|
447
442
|
|
|
448
|
-
if
|
|
443
|
+
if dataDescription["cellsAssembled"] {
|
|
449
444
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
450
445
|
axes = append(axes, {
|
|
451
446
|
"column": "subtreeId",
|
|
@@ -476,6 +471,8 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
476
471
|
cmdArgs = append(cmdArgs, "-fileName")
|
|
477
472
|
axes = append(axes, {
|
|
478
473
|
"column": "fileName",
|
|
474
|
+
// in case of single cell trees, not all subtrees will be filled for nodes with observed
|
|
475
|
+
"allowNA": true,
|
|
479
476
|
"preProcess": [
|
|
480
477
|
{
|
|
481
478
|
"type": "regexpReplace",
|
|
@@ -490,6 +487,7 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
490
487
|
axes = append(axes, {
|
|
491
488
|
"column": "cloneId",
|
|
492
489
|
"id": "clone-id",
|
|
490
|
+
"allowNA": true,
|
|
493
491
|
"spec": {
|
|
494
492
|
"name": "pl7.app/vdj/cloneId",
|
|
495
493
|
"type": "Long",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.mixcr-shm-trees.workflow",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tengo-based template",
|
|
6
6
|
"//": {
|
|
7
7
|
"build": "node ./scripts/build-static.mjs src/pfconv_params.json src/pfconv_params.lib.tengo && rm -rf dist && pl-tengo check && pl-tengo build && ./create_tags.sh"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@platforma-sdk/tengo-builder": "^1.
|
|
11
|
-
"@platforma-sdk/workflow-tengo": "1.
|
|
12
|
-
"@milaboratories/software-pframes-conv": "^1.6.
|
|
10
|
+
"@platforma-sdk/tengo-builder": "^1.16.1",
|
|
11
|
+
"@platforma-sdk/workflow-tengo": "^1.7.5",
|
|
12
|
+
"@milaboratories/software-pframes-conv": "^1.6.8",
|
|
13
13
|
"@platforma-open/milaboratories.software-small-binaries": "^1.14.5",
|
|
14
|
-
"@platforma-open/milaboratories.software-mixcr": "4.7.0-
|
|
15
|
-
"@platforma-sdk/test": "^1.7.
|
|
14
|
+
"@platforma-open/milaboratories.software-mixcr": "4.7.0-133-develop",
|
|
15
|
+
"@platforma-sdk/test": "^1.7.52",
|
|
16
16
|
"vitest": "^2.1.4",
|
|
17
17
|
"typescript": "~5.5.4"
|
|
18
18
|
},
|
|
@@ -13,9 +13,7 @@ text := import("text")
|
|
|
13
13
|
allowNA := true
|
|
14
14
|
|
|
15
15
|
// export of threes whithout nodes
|
|
16
|
-
shmTreeTableOptions := func(dataDescription
|
|
17
|
-
// TODO add forChain if runWithSingleCell
|
|
18
|
-
|
|
16
|
+
shmTreeTableOptions := func(dataDescription) {
|
|
19
17
|
axes := []
|
|
20
18
|
columns := []
|
|
21
19
|
cmdArgs := []
|
|
@@ -33,7 +31,7 @@ shmTreeTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
33
31
|
}
|
|
34
32
|
})
|
|
35
33
|
|
|
36
|
-
if
|
|
34
|
+
if dataDescription["cellsAssembled"] {
|
|
37
35
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
38
36
|
axes = append(axes, {
|
|
39
37
|
"column": "subtreeId",
|
|
@@ -224,9 +222,7 @@ shmTreeTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
224
222
|
}
|
|
225
223
|
|
|
226
224
|
// export data that is uniq for node
|
|
227
|
-
shmTreeNodesTableOptions := func(dataDescription
|
|
228
|
-
// TODO add forChain if runWithSingleCell
|
|
229
|
-
|
|
225
|
+
shmTreeNodesTableOptions := func(dataDescription) {
|
|
230
226
|
axes := []
|
|
231
227
|
columns := []
|
|
232
228
|
cmdArgs := []
|
|
@@ -244,7 +240,7 @@ shmTreeNodesTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
244
240
|
}
|
|
245
241
|
})
|
|
246
242
|
|
|
247
|
-
if
|
|
243
|
+
if dataDescription["cellsAssembled"] {
|
|
248
244
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
249
245
|
axes = append(axes, {
|
|
250
246
|
"column": "subtreeId",
|
|
@@ -424,8 +420,7 @@ shmTreeNodesTableOptions := func(dataDescription, runWithSingleCell) {
|
|
|
424
420
|
|
|
425
421
|
// export data that is unique for clones, but not unique for a node
|
|
426
422
|
// (different clones could be in the same topology node, for example, different time points)
|
|
427
|
-
shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn
|
|
428
|
-
// TODO add forChain if runWithSingleCell
|
|
423
|
+
shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn) {
|
|
429
424
|
donorColumnSpec := donorColumn.get("spec").getDataAsJson()
|
|
430
425
|
|
|
431
426
|
axes := []
|
|
@@ -445,7 +440,7 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
445
440
|
}
|
|
446
441
|
})
|
|
447
442
|
|
|
448
|
-
if
|
|
443
|
+
if dataDescription["cellsAssembled"] {
|
|
449
444
|
cmdArgs = append(cmdArgs, "-subtreeId")
|
|
450
445
|
axes = append(axes, {
|
|
451
446
|
"column": "subtreeId",
|
|
@@ -476,6 +471,8 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
476
471
|
cmdArgs = append(cmdArgs, "-fileName")
|
|
477
472
|
axes = append(axes, {
|
|
478
473
|
"column": "fileName",
|
|
474
|
+
// in case of single cell trees, not all subtrees will be filled for nodes with observed
|
|
475
|
+
"allowNA": true,
|
|
479
476
|
"preProcess": [
|
|
480
477
|
{
|
|
481
478
|
"type": "regexpReplace",
|
|
@@ -490,6 +487,7 @@ shmTreeNodesWithClonesTableOptions := func(dataDescription, donorColumn, runWith
|
|
|
490
487
|
axes = append(axes, {
|
|
491
488
|
"column": "cloneId",
|
|
492
489
|
"id": "clone-id",
|
|
490
|
+
"allowNA": true,
|
|
493
491
|
"spec": {
|
|
494
492
|
"name": "pl7.app/vdj/cloneId",
|
|
495
493
|
"type": "Long",
|
package/src/process.tpl.tengo
CHANGED
|
@@ -25,7 +25,8 @@ self.body(func(inputs) {
|
|
|
25
25
|
"hasUmiTags": false,
|
|
26
26
|
"hasCellTags": false,
|
|
27
27
|
// will be filled
|
|
28
|
-
"coveredFeatures": []
|
|
28
|
+
"coveredFeatures": [],
|
|
29
|
+
"cellsAssembled": false
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
assemblingFeature := ""
|
|
@@ -38,6 +39,9 @@ self.body(func(inputs) {
|
|
|
38
39
|
if presetAnnotations["mixcr.com/umiTags"] != "" {
|
|
39
40
|
dataDescription["hasUmiTags"] = true
|
|
40
41
|
}
|
|
42
|
+
if presetAnnotations["mixcr.com/cellsAssembled"] == "true" {
|
|
43
|
+
dataDescription["cellsAssembled"] = true
|
|
44
|
+
}
|
|
41
45
|
dataDescription["coveredFeatures"] = text.re_split(',', presetAnnotations["mixcr.com/coveredFeaturesOnExport"])
|
|
42
46
|
// check that assemblingFeature feature is the same. If so, coveredFeatures will be the same too
|
|
43
47
|
if (assemblingFeature == "") {
|
|
@@ -51,9 +55,9 @@ self.body(func(inputs) {
|
|
|
51
55
|
dataGroupedByDonorId := prepareDonorColumn.groupDataByDonorId(inputs.donorColumn, inputs.datasets)
|
|
52
56
|
|
|
53
57
|
// collect params for running export commands and to parse result tsv files into pColumns
|
|
54
|
-
shmTreeTableOptions := exportSettings.shmTreeTableOptions(dataDescription
|
|
55
|
-
shmTreeNodesTableOptions := exportSettings.shmTreeNodesTableOptions(dataDescription
|
|
56
|
-
shmTreeNodesWithClonesTableOptions := exportSettings.shmTreeNodesWithClonesTableOptions(dataDescription, inputs.donorColumn
|
|
58
|
+
shmTreeTableOptions := exportSettings.shmTreeTableOptions(dataDescription)
|
|
59
|
+
shmTreeNodesTableOptions := exportSettings.shmTreeNodesTableOptions(dataDescription)
|
|
60
|
+
shmTreeNodesWithClonesTableOptions := exportSettings.shmTreeNodesWithClonesTableOptions(dataDescription, inputs.donorColumn)
|
|
57
61
|
|
|
58
62
|
// TODO that call is too low level. Should be replaced with something that works with pColumns, not data only
|
|
59
63
|
mixcrResults := llPFrames.aggregate(
|
|
@@ -72,9 +72,7 @@ self.body(func(inputs) {
|
|
|
72
72
|
arg("--report").arg("report.txt").
|
|
73
73
|
saveFile("report.txt").
|
|
74
74
|
arg("--json-report").arg("report.json").
|
|
75
|
-
saveFile("report.json")
|
|
76
|
-
// TODO support single cell trees
|
|
77
|
-
arg("--dont-combine-tree-by-cells")
|
|
75
|
+
saveFile("report.json")
|
|
78
76
|
|
|
79
77
|
if !is_undefined(globalParams.seed) {
|
|
80
78
|
shmTreesCmdBuilder.env("SEED", globalParams.seed)
|