@platforma-open/milaboratories.top-antibodies.workflow 1.15.0 → 1.16.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 +3 -3
- package/CHANGELOG.md +19 -0
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/tengo/lib/sampled-cols-conv.lib.tengo +1 -1
- package/dist/tengo/lib/utils.lib.tengo +139 -0
- package/dist/tengo/tpl/assembling-fasta.plj.gz +0 -0
- package/dist/tengo/tpl/filter-and-sample.plj.gz +0 -0
- package/dist/tengo/tpl/main.plj.gz +0 -0
- package/package.json +6 -6
- package/src/assembling-fasta.tpl.tengo +6 -6
- package/src/filter-and-sample.tpl.tengo +30 -20
- package/src/main.tpl.tengo +465 -6
- package/src/sampled-cols-conv.lib.tengo +1 -1
- package/src/utils.lib.tengo +139 -0
- package/dist/tengo/tpl/prerun.plj.gz +0 -0
- package/src/prerun.tpl.tengo +0 -493
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-open/milaboratories.top-antibodies.workflow@1.
|
|
3
|
+
> @platforma-open/milaboratories.top-antibodies.workflow@1.16.0 build /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow
|
|
4
4
|
> rm -rf dist && pl-tengo check && pl-tengo build
|
|
5
5
|
|
|
6
6
|
Processing "src/assembling-fasta.tpl.tengo"...
|
|
@@ -9,17 +9,17 @@ Processing "src/main.tpl.tengo"...
|
|
|
9
9
|
Processing "src/pf-kabat-conv.lib.tengo"...
|
|
10
10
|
Processing "src/pf-spectratype-conv.lib.tengo"...
|
|
11
11
|
Processing "src/pf-vj-usage-conv.lib.tengo"...
|
|
12
|
-
Processing "src/prerun.tpl.tengo"...
|
|
13
12
|
Processing "src/sampled-cols-conv.lib.tengo"...
|
|
13
|
+
Processing "src/utils.lib.tengo"...
|
|
14
14
|
No syntax errors found.
|
|
15
15
|
info: Compiling 'dist'...
|
|
16
16
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/lib/pf-kabat-conv.lib.tengo
|
|
17
17
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/lib/pf-spectratype-conv.lib.tengo
|
|
18
18
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/lib/pf-vj-usage-conv.lib.tengo
|
|
19
19
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/lib/sampled-cols-conv.lib.tengo
|
|
20
|
+
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/lib/utils.lib.tengo
|
|
20
21
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/tpl/assembling-fasta.plj.gz
|
|
21
22
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/tpl/filter-and-sample.plj.gz
|
|
22
|
-
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/tpl/prerun.plj.gz
|
|
23
23
|
info: - writing /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow/dist/tengo/tpl/main.plj.gz
|
|
24
24
|
info: Template Pack build done.
|
|
25
25
|
info: Template Pack build done.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @platforma-open/milaboratories.top-antibodies.workflow
|
|
2
2
|
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4ecbe6b: Improve cluster-based ranking
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4ecbe6b]
|
|
12
|
+
- @platforma-open/milaboratories.top-antibodies.sample-clonotypes@1.8.0
|
|
13
|
+
|
|
14
|
+
## 1.15.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 5619236: Fix missing input related error
|
|
19
|
+
- Updated dependencies [5619236]
|
|
20
|
+
- @platforma-open/milaboratories.top-antibodies.sample-clonotypes@1.7.2
|
|
21
|
+
|
|
3
22
|
## 1.15.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module.exports = { Templates: {
|
|
2
2
|
'assembling-fasta': { type: 'from-file', path: require.resolve('./tengo/tpl/assembling-fasta.plj.gz') },
|
|
3
3
|
'filter-and-sample': { type: 'from-file', path: require.resolve('./tengo/tpl/filter-and-sample.plj.gz') },
|
|
4
|
-
'prerun': { type: 'from-file', path: require.resolve('./tengo/tpl/prerun.plj.gz') },
|
|
5
4
|
'main': { type: 'from-file', path: require.resolve('./tengo/tpl/main.plj.gz') }
|
|
6
5
|
}};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare type TemplateFromFile = { readonly type: "from-file"; readonly path: string; };
|
|
2
|
-
declare type TplName = "assembling-fasta" | "filter-and-sample" | "
|
|
2
|
+
declare type TplName = "assembling-fasta" | "filter-and-sample" | "main";
|
|
3
3
|
declare const Templates: Record<TplName, TemplateFromFile>;
|
|
4
4
|
export { Templates };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,5 @@ import { resolve } from 'node:path';
|
|
|
2
2
|
export const Templates = {
|
|
3
3
|
'assembling-fasta': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/assembling-fasta.plj.gz') },
|
|
4
4
|
'filter-and-sample': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/filter-and-sample.plj.gz') },
|
|
5
|
-
'prerun': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/prerun.plj.gz') },
|
|
6
5
|
'main': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/main.plj.gz') }
|
|
7
6
|
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
slices := import("@platforma-sdk/workflow-tengo:slices")
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
clusterAxisDomainsMatch := func(axis1, axis2) {
|
|
14
|
+
|
|
15
|
+
if is_undefined(axis1) || is_undefined(axis2) {
|
|
16
|
+
return false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if is_undefined(axis1.domain) != is_undefined(axis2.domain) {
|
|
21
|
+
return false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if is_undefined(axis1.domain) && is_undefined(axis2.domain) {
|
|
26
|
+
return true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if len(axis1.domain) != len(axis2.domain) {
|
|
31
|
+
return false
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
for k, v in axis1.domain {
|
|
36
|
+
if is_undefined(axis2.domain[k]) || axis2.domain[k] != v {
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return true
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
findMatchingLinkerIndex := func(colsSpec, linkerColumns) {
|
|
53
|
+
|
|
54
|
+
rankingClusterIdAxis := undefined
|
|
55
|
+
for axis in colsSpec.axesSpec {
|
|
56
|
+
if axis.name == "pl7.app/vdj/clusterId" {
|
|
57
|
+
rankingClusterIdAxis = axis
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if is_undefined(rankingClusterIdAxis) {
|
|
64
|
+
return undefined
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for li, linkerCol in linkerColumns {
|
|
68
|
+
|
|
69
|
+
linkerClusterIdAxis := undefined
|
|
70
|
+
for axis in linkerCol.spec.axesSpec {
|
|
71
|
+
if axis.name == "pl7.app/vdj/clusterId" {
|
|
72
|
+
linkerClusterIdAxis = axis
|
|
73
|
+
break
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if clusterAxisDomainsMatch(rankingClusterIdAxis, linkerClusterIdAxis) {
|
|
79
|
+
return li
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return undefined
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
processRankingColumn := func(colsSpec, datasetMainAxisName, linkerColumns, clusterPropertyIdx) {
|
|
96
|
+
axesNames := slices.map(colsSpec.axesSpec, func (a) { return a.name})
|
|
97
|
+
isClusterProperty := !slices.hasElement(axesNames, datasetMainAxisName)
|
|
98
|
+
|
|
99
|
+
if !isClusterProperty {
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
isClusterProperty: false,
|
|
103
|
+
header: undefined,
|
|
104
|
+
clusterAxisIdx: undefined,
|
|
105
|
+
newClusterPropertyIdx: clusterPropertyIdx
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
linkerIdx := findMatchingLinkerIndex(colsSpec, linkerColumns)
|
|
111
|
+
|
|
112
|
+
header := ""
|
|
113
|
+
clusterAxisIdx := undefined
|
|
114
|
+
newClusterPropertyIdx := clusterPropertyIdx
|
|
115
|
+
|
|
116
|
+
if linkerIdx != undefined {
|
|
117
|
+
|
|
118
|
+
header = "Col_linker." + string(linkerIdx)
|
|
119
|
+
clusterAxisIdx = linkerIdx
|
|
120
|
+
} else {
|
|
121
|
+
|
|
122
|
+
header = "Col_cluster." + string(clusterPropertyIdx)
|
|
123
|
+
clusterAxisIdx = clusterPropertyIdx
|
|
124
|
+
newClusterPropertyIdx = clusterPropertyIdx + 1
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
isClusterProperty: true,
|
|
129
|
+
header: header,
|
|
130
|
+
clusterAxisIdx: clusterAxisIdx,
|
|
131
|
+
newClusterPropertyIdx: newClusterPropertyIdx
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
clusterAxisDomainsMatch: clusterAxisDomainsMatch,
|
|
137
|
+
findMatchingLinkerIndex: findMatchingLinkerIndex,
|
|
138
|
+
processRankingColumn: processRankingColumn
|
|
139
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.top-antibodies.workflow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Block Workflow",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@platforma-sdk/workflow-tengo": "^5.
|
|
7
|
+
"@platforma-sdk/workflow-tengo": "^5.7.3",
|
|
8
8
|
"@platforma-open/milaboratories.software-anarci": "^0.0.3",
|
|
9
|
-
"@platforma-open/milaboratories.top-antibodies.sample-clonotypes": "1.
|
|
9
|
+
"@platforma-open/milaboratories.top-antibodies.sample-clonotypes": "1.8.0",
|
|
10
10
|
"@platforma-open/milaboratories.top-antibodies.umap": "1.2.1",
|
|
11
|
-
"@platforma-open/milaboratories.top-antibodies.spectratype": "1.7.1",
|
|
12
11
|
"@platforma-open/milaboratories.top-antibodies.assembling-fasta": "1.2.1",
|
|
12
|
+
"@platforma-open/milaboratories.top-antibodies.spectratype": "1.7.1",
|
|
13
13
|
"@platforma-open/milaboratories.top-antibodies.anarci-kabat": "1.2.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@platforma-sdk/tengo-builder": "^2.4.
|
|
17
|
-
"@platforma-sdk/test": "^1.
|
|
16
|
+
"@platforma-sdk/tengo-builder": "^2.4.2",
|
|
17
|
+
"@platforma-sdk/test": "^1.48.8",
|
|
18
18
|
"vitest": "^2.1.8"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
@@ -12,7 +12,7 @@ self.body(func(inputs) {
|
|
|
12
12
|
|
|
13
13
|
inputTsv := inputs.inputTsv
|
|
14
14
|
keyColumn := inputs.keyColumn // "clonotypeKey" or "scClonotypeKey"
|
|
15
|
-
|
|
15
|
+
finalClonotypes := inputs.finalClonotypes // optional
|
|
16
16
|
isSingleCell := inputs.isSingleCell // boolean
|
|
17
17
|
bulkChain := inputs.bulkChain // "H" or "KL" when !isSingleCell
|
|
18
18
|
|
|
@@ -20,14 +20,14 @@ self.body(func(inputs) {
|
|
|
20
20
|
software(assets.importSoftware("@platforma-open/milaboratories.top-antibodies.assembling-fasta:main")).
|
|
21
21
|
cpu(1).
|
|
22
22
|
mem("4GiB").
|
|
23
|
-
addFile("assembling.
|
|
24
|
-
arg("--
|
|
23
|
+
addFile("assembling.parquet", inputTsv).
|
|
24
|
+
arg("--input_parquet").arg("assembling.parquet").
|
|
25
25
|
arg("--key_column").arg(keyColumn).
|
|
26
26
|
arg("--output_fasta").arg("assembling.fasta")
|
|
27
27
|
|
|
28
|
-
if
|
|
29
|
-
cmd = cmd.addFile("finalClonotypes.
|
|
30
|
-
arg("--
|
|
28
|
+
if finalClonotypes != undefined {
|
|
29
|
+
cmd = cmd.addFile("finalClonotypes.parquet", finalClonotypes).
|
|
30
|
+
arg("--final-clonotypes").arg("finalClonotypes.parquet")
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
cmd = cmd.saveFile("assembling.fasta").
|
|
@@ -8,7 +8,7 @@ render := import("@platforma-sdk/workflow-tengo:render")
|
|
|
8
8
|
sampledColsConv := import(":sampled-cols-conv")
|
|
9
9
|
json := import("json")
|
|
10
10
|
|
|
11
|
-
self.defineOutputs("sampledRows", "
|
|
11
|
+
self.defineOutputs("sampledRows", "finalClonotypes")
|
|
12
12
|
|
|
13
13
|
self.body(func(inputs) {
|
|
14
14
|
|
|
@@ -19,63 +19,73 @@ self.body(func(inputs) {
|
|
|
19
19
|
topClonotypes := inputs.topClonotypes
|
|
20
20
|
|
|
21
21
|
outputs := {}
|
|
22
|
-
|
|
22
|
+
finalClonotypes := undefined
|
|
23
23
|
|
|
24
24
|
// Run filtering script
|
|
25
25
|
filterResult := exec.builder().
|
|
26
26
|
software(assets.importSoftware("@platforma-open/milaboratories.top-antibodies.sample-clonotypes:filter")).
|
|
27
27
|
mem("16GiB").
|
|
28
28
|
cpu(1).
|
|
29
|
-
addFile("clonotypes.
|
|
30
|
-
arg("--
|
|
31
|
-
arg("--out").arg("filteredClonotypes.
|
|
29
|
+
addFile("clonotypes.parquet", cloneTable).
|
|
30
|
+
arg("--parquet").arg("clonotypes.parquet").
|
|
31
|
+
arg("--out").arg("filteredClonotypes.parquet").
|
|
32
32
|
arg("--filter-map").arg(string(json.encode(filterMap))).
|
|
33
|
-
saveFile("filteredClonotypes.
|
|
33
|
+
saveFile("filteredClonotypes.parquet").
|
|
34
34
|
printErrStreamToStdout().
|
|
35
35
|
cache(24 * 60 * 60 * 1000).
|
|
36
36
|
run()
|
|
37
37
|
|
|
38
|
-
// Save filtered
|
|
39
|
-
|
|
38
|
+
// Save filtered parquet file
|
|
39
|
+
filteredClonotypes := filterResult.getFile("filteredClonotypes.parquet")
|
|
40
40
|
|
|
41
41
|
// Store outputs
|
|
42
42
|
sampledColsParams := sampledColsConv.getColumns(datasetSpec, false) // No ranking column
|
|
43
|
-
filteredClonotypesPf := xsv.importFile(
|
|
43
|
+
filteredClonotypesPf := xsv.importFile(filteredClonotypes, "parquet", sampledColsParams,
|
|
44
44
|
{cpu: 1, mem: "16GiB"})
|
|
45
45
|
|
|
46
46
|
// Prepare outputs in case there is no top ranking
|
|
47
47
|
outputs["sampledRows"] = pframes.exportFrame(filteredClonotypesPf)
|
|
48
|
-
|
|
48
|
+
finalClonotypes = filteredClonotypes
|
|
49
49
|
|
|
50
50
|
if topClonotypes != undefined {
|
|
51
51
|
|
|
52
52
|
////////// Top Clonotypes Sampling //////////
|
|
53
53
|
// Run sampling script on filtered data
|
|
54
|
-
|
|
54
|
+
builder := exec.builder().
|
|
55
55
|
software(assets.importSoftware("@platforma-open/milaboratories.top-antibodies.sample-clonotypes:main")).
|
|
56
56
|
mem("16GiB").
|
|
57
57
|
cpu(1).
|
|
58
|
-
addFile("filteredClonotypes.
|
|
59
|
-
arg("--
|
|
58
|
+
addFile("filteredClonotypes.parquet", filteredClonotypes).
|
|
59
|
+
arg("--parquet").arg("filteredClonotypes.parquet").
|
|
60
60
|
arg("--n").arg(string(topClonotypes)).
|
|
61
|
-
arg("--ranking-map").arg(string(json.encode(rankingMap)))
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
arg("--ranking-map").arg(string(json.encode(rankingMap)))
|
|
62
|
+
|
|
63
|
+
// Add optional parameters if provided in block args
|
|
64
|
+
if inputs.disableClusterRanking {
|
|
65
|
+
builder = builder.arg("--disable-cluster-ranking")
|
|
66
|
+
}
|
|
67
|
+
if inputs.clusterColumn != undefined && inputs.clusterColumn != "" {
|
|
68
|
+
builder = builder.arg("--cluster-column").arg(inputs.clusterColumn)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
sampleClones := builder.
|
|
72
|
+
arg("--out").arg("sampledClonotypes_top.parquet").
|
|
73
|
+
saveFile("sampledClonotypes_top.parquet").
|
|
64
74
|
printErrStreamToStdout().
|
|
65
75
|
cache(24 * 60 * 60 * 1000).
|
|
66
76
|
run()
|
|
67
77
|
|
|
68
|
-
// Save top clonotypes
|
|
69
|
-
|
|
78
|
+
// Save top clonotypes parquet file
|
|
79
|
+
finalClonotypes = sampleClones.getFile("sampledClonotypes_top.parquet")
|
|
70
80
|
|
|
71
81
|
// Store outputs
|
|
72
82
|
sampledColsParams := sampledColsConv.getColumns(datasetSpec, true) // Add ranking column
|
|
73
|
-
sampledColumnsPf := xsv.importFile(
|
|
83
|
+
sampledColumnsPf := xsv.importFile(finalClonotypes, "parquet", sampledColsParams,
|
|
74
84
|
{cpu: 1, mem: "16GiB"})
|
|
75
85
|
outputs["sampledRows"] = pframes.exportFrame(sampledColumnsPf)
|
|
76
86
|
}
|
|
77
87
|
|
|
78
|
-
outputs["
|
|
88
|
+
outputs["finalClonotypes"] = finalClonotypes
|
|
79
89
|
|
|
80
90
|
return outputs
|
|
81
91
|
})
|