@platforma-open/milaboratories.top-antibodies.workflow 3.0.1 → 4.0.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 +6 -0
- package/dist/tengo/lib/sampled-cols-conv.lib.tengo +2 -2
- package/dist/tengo/lib/sampled-export-conv.lib.tengo +1 -1
- package/dist/tengo/lib/utils.lib.tengo +6 -6
- 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/main.tpl.tengo +64 -60
- package/src/sampled-cols-conv.lib.tengo +2 -2
- package/src/sampled-export-conv.lib.tengo +1 -1
- package/src/utils.lib.tengo +6 -6
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@
|
|
3
|
+
> @platforma-open/milaboratories.top-antibodies.workflow@4.0.0 build /home/runner/work/antibody-tcr-lead-selection/antibody-tcr-lead-selection/workflow
|
|
4
4
|
> shx rm -rf dist && pl-tengo check && pl-tengo build
|
|
5
5
|
|
|
6
6
|
Processing "src/assembling-fasta.tpl.tengo"...
|
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@ getColumns := func(datasetSpec, addRanking, addInVivoScore) {
|
|
|
6
6
|
id: "link",
|
|
7
7
|
allowNA: false,
|
|
8
8
|
spec: {
|
|
9
|
-
name: "pl7.app/
|
|
9
|
+
name: "pl7.app/lead-selection",
|
|
10
10
|
valueType: "Int",
|
|
11
11
|
domain: {},
|
|
12
12
|
annotations: {
|
|
@@ -21,7 +21,7 @@ getColumns := func(datasetSpec, addRanking, addInVivoScore) {
|
|
|
21
21
|
columns = columns + [{
|
|
22
22
|
column: "ranked_order",
|
|
23
23
|
spec: {
|
|
24
|
-
name: "pl7.app/
|
|
24
|
+
name: "pl7.app/ranking-order",
|
|
25
25
|
valueType: "Int",
|
|
26
26
|
domain: {},
|
|
27
27
|
annotations: {
|
|
@@ -61,7 +61,7 @@ findMatchingLinkerIndex := func(colsSpec, linkerColumns) {
|
|
|
61
61
|
|
|
62
62
|
rankingClusterIdAxis := undefined
|
|
63
63
|
for axis in colsSpec.axesSpec {
|
|
64
|
-
if axis.name == "pl7.app/
|
|
64
|
+
if axis.name == "pl7.app/clusterId" {
|
|
65
65
|
rankingClusterIdAxis = axis
|
|
66
66
|
break
|
|
67
67
|
}
|
|
@@ -76,7 +76,7 @@ findMatchingLinkerIndex := func(colsSpec, linkerColumns) {
|
|
|
76
76
|
|
|
77
77
|
linkerClusterIdAxis := undefined
|
|
78
78
|
for axis in linkerCol.spec.axesSpec {
|
|
79
|
-
if axis.name == "pl7.app/
|
|
79
|
+
if axis.name == "pl7.app/clusterId" {
|
|
80
80
|
linkerClusterIdAxis = axis
|
|
81
81
|
break
|
|
82
82
|
}
|
|
@@ -195,7 +195,7 @@ resolveClusterColumnHeader := func(args, columns, sortedLinkers) {
|
|
|
195
195
|
|
|
196
196
|
selectedClusterIdAxis := undefined
|
|
197
197
|
for axis in selectedLinkerSpec.axesSpec {
|
|
198
|
-
if axis.name == "pl7.app/
|
|
198
|
+
if axis.name == "pl7.app/clusterId" {
|
|
199
199
|
selectedClusterIdAxis = axis
|
|
200
200
|
break
|
|
201
201
|
}
|
|
@@ -209,7 +209,7 @@ resolveClusterColumnHeader := func(args, columns, sortedLinkers) {
|
|
|
209
209
|
for linkerIdx, col in sortedLinkers {
|
|
210
210
|
|
|
211
211
|
for axis in col.spec.axesSpec {
|
|
212
|
-
if axis.name == "pl7.app/
|
|
212
|
+
if axis.name == "pl7.app/clusterId" {
|
|
213
213
|
|
|
214
214
|
if clusterAxisDomainsMatch(selectedClusterIdAxis, axis) {
|
|
215
215
|
return "clusterAxis_" + string(linkerIdx) + "_0"
|
|
@@ -409,7 +409,7 @@ initializeCloneTable := func(pframes, columns, args, datasetSpec) {
|
|
|
409
409
|
addedCols = true
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
if !is_undefined(clusterIdAxis) && clusterIdAxis.name == "pl7.app/
|
|
412
|
+
if !is_undefined(clusterIdAxis) && clusterIdAxis.name == "pl7.app/clusterId" {
|
|
413
413
|
linkerClusterIdAxesWithIdx = append(linkerClusterIdAxesWithIdx, {
|
|
414
414
|
axis: clusterIdAxis,
|
|
415
415
|
linkerIdx: linkerIdx
|
|
@@ -423,7 +423,7 @@ initializeCloneTable := func(pframes, columns, args, datasetSpec) {
|
|
|
423
423
|
|
|
424
424
|
clusterSizeClusterIdAxis := undefined
|
|
425
425
|
for axis in col.spec.axesSpec {
|
|
426
|
-
if axis.name == "pl7.app/
|
|
426
|
+
if axis.name == "pl7.app/clusterId" {
|
|
427
427
|
clusterSizeClusterIdAxis = axis
|
|
428
428
|
break
|
|
429
429
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.top-antibodies.workflow",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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.20.0",
|
|
8
8
|
"@platforma-open/milaboratories.software-anarci": "^0.0.3",
|
|
9
|
-
"@platforma-open/milaboratories.top-antibodies.spectratype": "1.8.3",
|
|
10
9
|
"@platforma-open/milaboratories.top-antibodies.sample-clonotypes": "2.1.2",
|
|
11
|
-
"@platforma-open/milaboratories.top-antibodies.umap": "1.2.3",
|
|
12
10
|
"@platforma-open/milaboratories.top-antibodies.assembling-fasta": "1.3.2",
|
|
13
|
-
"@platforma-open/milaboratories.top-antibodies.anarci-kabat": "1.4.3"
|
|
11
|
+
"@platforma-open/milaboratories.top-antibodies.anarci-kabat": "1.4.3",
|
|
12
|
+
"@platforma-open/milaboratories.top-antibodies.spectratype": "1.8.3",
|
|
13
|
+
"@platforma-open/milaboratories.top-antibodies.umap": "1.2.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@platforma-sdk/tengo-builder": "2.5.
|
|
16
|
+
"@platforma-sdk/tengo-builder": "2.5.20"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "shx rm -rf dist && pl-tengo check && pl-tengo build",
|
package/src/main.tpl.tengo
CHANGED
|
@@ -134,6 +134,7 @@ wf.body(func(args) {
|
|
|
134
134
|
|
|
135
135
|
// Needed conditional variable
|
|
136
136
|
isSingleCell := datasetSpec.axesSpec[1].name == "pl7.app/vdj/scClonotypeKey"
|
|
137
|
+
isPeptide := datasetSpec.axesSpec[1].name == "pl7.app/variantKey"
|
|
137
138
|
|
|
138
139
|
////////// Clonotype Filtering //////////
|
|
139
140
|
// Initialize and build clone table with all columns
|
|
@@ -177,76 +178,79 @@ wf.body(func(args) {
|
|
|
177
178
|
// Export only the sampling column for downstream (built inside sub-template to avoid hang)
|
|
178
179
|
exports["sampledColumnsPf"] = filterSampleResult.output("sampledColumnsExport", 24 * 60 * 60 * 1000)
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
// CDR3 spectratype, V/J gene usage, and Kabat numbering are VDJ-only — skip for peptide inputs.
|
|
182
|
+
if !isPeptide {
|
|
183
|
+
////////// CDR3 Length Calculation //////////
|
|
184
|
+
// Initialize and build CDR3 sequence table
|
|
185
|
+
cdr3SeqTableBuilt := utils.initializeCdr3SeqTable(pframes, columns, datasetSpec, isSingleCell)
|
|
183
186
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
cdr3VspectratypeCmd := exec.builder().
|
|
188
|
+
software(assets.importSoftware("@platforma-open/milaboratories.top-antibodies.spectratype:main")).
|
|
189
|
+
mem("16GiB").
|
|
190
|
+
cpu(1).
|
|
191
|
+
addFile("cdr3_sequences_input.parquet", cdr3SeqTableBuilt).
|
|
192
|
+
arg("--input_parquet").arg("cdr3_sequences_input.parquet").
|
|
193
|
+
arg("--spectratype_tsv").arg("spectratype.tsv").
|
|
194
|
+
arg("--vj_usage_tsv").arg("vj_usage.tsv") // no dot here
|
|
192
195
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
// Add top clonotypes argument and file to the builder if provided
|
|
197
|
+
if finalClonotypes != undefined {
|
|
198
|
+
cdr3VspectratypeCmd = cdr3VspectratypeCmd.
|
|
199
|
+
arg("--final-clonotypes").arg("finalClonotypes.parquet").
|
|
200
|
+
addFile("finalClonotypes.parquet", finalClonotypes)
|
|
201
|
+
}
|
|
199
202
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
cdr3VspectratypeCmd = cdr3VspectratypeCmd. // continue building the command
|
|
204
|
+
saveFile("spectratype.tsv").
|
|
205
|
+
saveFile("vj_usage.tsv").
|
|
206
|
+
printErrStreamToStdout().
|
|
207
|
+
cache(24 * 60 * 60 * 1000).
|
|
208
|
+
run()
|
|
206
209
|
|
|
207
210
|
|
|
208
|
-
|
|
211
|
+
// Spectratype PFrame structure is [chain][cdr3Length][vGene] -> count
|
|
209
212
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
cdr3VspectratypePf := xsv.importFile(cdr3VspectratypeCmd.getFile("spectratype.tsv"),
|
|
214
|
+
"tsv", spectratypeConv.getColumns(),
|
|
215
|
+
{cpu: 1, mem: "16GiB"})
|
|
216
|
+
outputs["cdr3VspectratypePf"] = pframes.exportFrame(cdr3VspectratypePf)
|
|
214
217
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
// For vjUsage structure is [chain][vGene][jGene] -> count
|
|
219
|
+
vjUsagePf := xsv.importFile(cdr3VspectratypeCmd.getFile("vj_usage.tsv"),
|
|
220
|
+
"tsv", vjUsageConv.getColumns(),
|
|
221
|
+
{cpu: 1, mem: "16GiB"})
|
|
222
|
+
outputs["vjUsagePf"] = pframes.exportFrame(vjUsagePf)
|
|
220
223
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
if args.kabatNumbering == true {
|
|
225
|
+
////////// Assembling AA sequences //////////
|
|
226
|
+
// Initialize and build assembling sequence table
|
|
227
|
+
assemInit := utils.initializeAssemSeqTable(pframes, columns, datasetSpec, isSingleCell)
|
|
228
|
+
assemSeqTableBuilt := assemInit.assemSeqTable
|
|
229
|
+
bulkChain := assemInit.bulkChain
|
|
230
|
+
seqCols := assemInit.seqCols
|
|
228
231
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
232
|
+
// Convert assembling feature sequences to FASTA via sub-template
|
|
233
|
+
assemFastaTpl := assets.importTemplate(":assembling-fasta")
|
|
234
|
+
assem := render.create(assemFastaTpl, {
|
|
235
|
+
inputTsv: assemSeqTableBuilt,
|
|
236
|
+
keyColumn: "clonotypeKey",
|
|
237
|
+
finalClonotypes: finalClonotypes,
|
|
238
|
+
isSingleCell: isSingleCell,
|
|
239
|
+
bulkChain: bulkChain
|
|
240
|
+
})
|
|
241
|
+
//outputs["assemblingAnarci"] = assem.output("anarci", 24 * 60 * 60 * 1000)
|
|
242
|
+
kabatFile := assem.output("kabat", 24 * 60 * 60 * 1000)
|
|
243
|
+
// Derive feature name from assembling feature columns (prefer first column's feature)
|
|
244
|
+
featName := ""
|
|
245
|
+
if len(seqCols) > 0 {
|
|
246
|
+
f := seqCols[0].spec.domain["pl7.app/vdj/feature"]
|
|
247
|
+
if f != undefined { featName = f }
|
|
248
|
+
}
|
|
249
|
+
// Convert kabat.tsv to PFrame with proper specs (bulk: select heavy/light)
|
|
250
|
+
kabatPf := xsv.importFile(kabatFile, "tsv", kabatConv.getColumns(datasetSpec, featName, bulkChain), {cpu: 1, mem: "8GiB"})
|
|
251
|
+
outputs["assemblingKabatPf"] = pframes.exportFrame(kabatPf)
|
|
252
|
+
outputs["kabatStatsContent"] = assem.output("kabatStats")
|
|
245
253
|
}
|
|
246
|
-
// Convert kabat.tsv to PFrame with proper specs (bulk: select heavy/light)
|
|
247
|
-
kabatPf := xsv.importFile(kabatFile, "tsv", kabatConv.getColumns(datasetSpec, featName, bulkChain), {cpu: 1, mem: "8GiB"})
|
|
248
|
-
outputs["assemblingKabatPf"] = pframes.exportFrame(kabatPf)
|
|
249
|
-
outputs["kabatStatsContent"] = assem.output("kabatStats")
|
|
250
254
|
}
|
|
251
255
|
}
|
|
252
256
|
}
|
|
@@ -6,7 +6,7 @@ getColumns := func(datasetSpec, addRanking, addInVivoScore) {
|
|
|
6
6
|
id: "link",
|
|
7
7
|
allowNA: false,
|
|
8
8
|
spec: {
|
|
9
|
-
name: "pl7.app/
|
|
9
|
+
name: "pl7.app/lead-selection",
|
|
10
10
|
valueType: "Int",
|
|
11
11
|
domain: {},
|
|
12
12
|
annotations: {
|
|
@@ -21,7 +21,7 @@ getColumns := func(datasetSpec, addRanking, addInVivoScore) {
|
|
|
21
21
|
columns = columns + [{
|
|
22
22
|
column: "ranked_order",
|
|
23
23
|
spec: {
|
|
24
|
-
name: "pl7.app/
|
|
24
|
+
name: "pl7.app/ranking-order",
|
|
25
25
|
valueType: "Int",
|
|
26
26
|
domain: {},
|
|
27
27
|
annotations: {
|
package/src/utils.lib.tengo
CHANGED
|
@@ -61,7 +61,7 @@ findMatchingLinkerIndex := func(colsSpec, linkerColumns) {
|
|
|
61
61
|
// Find the clusterId axis in the ranking column
|
|
62
62
|
rankingClusterIdAxis := undefined
|
|
63
63
|
for axis in colsSpec.axesSpec {
|
|
64
|
-
if axis.name == "pl7.app/
|
|
64
|
+
if axis.name == "pl7.app/clusterId" {
|
|
65
65
|
rankingClusterIdAxis = axis
|
|
66
66
|
break
|
|
67
67
|
}
|
|
@@ -76,7 +76,7 @@ findMatchingLinkerIndex := func(colsSpec, linkerColumns) {
|
|
|
76
76
|
// Get the clusterId axis from the linker column
|
|
77
77
|
linkerClusterIdAxis := undefined
|
|
78
78
|
for axis in linkerCol.spec.axesSpec {
|
|
79
|
-
if axis.name == "pl7.app/
|
|
79
|
+
if axis.name == "pl7.app/clusterId" {
|
|
80
80
|
linkerClusterIdAxis = axis
|
|
81
81
|
break
|
|
82
82
|
}
|
|
@@ -195,7 +195,7 @@ resolveClusterColumnHeader := func(args, columns, sortedLinkers) {
|
|
|
195
195
|
// Find the clusterId axis in the selected linker
|
|
196
196
|
selectedClusterIdAxis := undefined
|
|
197
197
|
for axis in selectedLinkerSpec.axesSpec {
|
|
198
|
-
if axis.name == "pl7.app/
|
|
198
|
+
if axis.name == "pl7.app/clusterId" {
|
|
199
199
|
selectedClusterIdAxis = axis
|
|
200
200
|
break
|
|
201
201
|
}
|
|
@@ -209,7 +209,7 @@ resolveClusterColumnHeader := func(args, columns, sortedLinkers) {
|
|
|
209
209
|
for linkerIdx, col in sortedLinkers {
|
|
210
210
|
// Get the clusterId axis from this linker
|
|
211
211
|
for axis in col.spec.axesSpec {
|
|
212
|
-
if axis.name == "pl7.app/
|
|
212
|
+
if axis.name == "pl7.app/clusterId" {
|
|
213
213
|
// Use clusterAxisDomainsMatch for proper domain comparison
|
|
214
214
|
if clusterAxisDomainsMatch(selectedClusterIdAxis, axis) {
|
|
215
215
|
return "clusterAxis_" + string(linkerIdx) + "_0"
|
|
@@ -409,7 +409,7 @@ initializeCloneTable := func(pframes, columns, args, datasetSpec) {
|
|
|
409
409
|
addedCols = true
|
|
410
410
|
}
|
|
411
411
|
// Collect clusterId axes from linker columns to match cluster size columns
|
|
412
|
-
if !is_undefined(clusterIdAxis) && clusterIdAxis.name == "pl7.app/
|
|
412
|
+
if !is_undefined(clusterIdAxis) && clusterIdAxis.name == "pl7.app/clusterId" {
|
|
413
413
|
linkerClusterIdAxesWithIdx = append(linkerClusterIdAxesWithIdx, {
|
|
414
414
|
axis: clusterIdAxis,
|
|
415
415
|
linkerIdx: linkerIdx
|
|
@@ -423,7 +423,7 @@ initializeCloneTable := func(pframes, columns, args, datasetSpec) {
|
|
|
423
423
|
// Find the clusterId axis in this cluster size column
|
|
424
424
|
clusterSizeClusterIdAxis := undefined
|
|
425
425
|
for axis in col.spec.axesSpec {
|
|
426
|
-
if axis.name == "pl7.app/
|
|
426
|
+
if axis.name == "pl7.app/clusterId" {
|
|
427
427
|
clusterSizeClusterIdAxis = axis
|
|
428
428
|
break
|
|
429
429
|
}
|