Skip to content

Commit f8ee498

Browse files
committed
spec R43: attach pl7.app/trace on single-shot path
Workflow comment admitted R43 trace was deferred during the per-row to single-shot migration. Pattern from 3d-structure-clustering: build `pSpec.makeTrace(pdbCol.spec, {type, id, importance, label})` from the upstream PDB column's existing trace, then iterate the imported `scoresXsvPf` map and stamp every column via `pfb.add(k, trace.inject(v.spec), v.data)`. Downstream blocks consuming our PColumns now see the full upstream chain ending in this block id.
1 parent 636515b commit f8ee498

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

workflow/src/main.tpl.tengo

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ assets := import("@platforma-sdk/workflow-tengo:assets")
1818
exec := import("@platforma-sdk/workflow-tengo:exec")
1919
maps := import("@platforma-sdk/workflow-tengo:maps")
2020
pframes := import("@platforma-sdk/workflow-tengo:pframes")
21+
pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
2122
xsv := import("@platforma-sdk/workflow-tengo:pframes.xsv")
2223
json := import("json")
2324

@@ -159,16 +160,24 @@ wf.body(func(args) {
159160

160161
// Spec R38 / R39: import the per_clonotype.tsv as PColumns. Axes come
161162
// straight from the upstream PDB column so downstream blocks auto-join
162-
// against `[sampleId, scClonotypeKey]`. R43 trace is attached to the
163-
// resulting PFrame as an annotation post-import.
163+
// against the upstream scClonotypeKey axis.
164164
xsvSettings := specs.buildScoresXsvSettings(blockId, scClonotypeAxis)
165-
scoresPf := xsv.importFile(scoresTsv, "tsv", xsvSettings, { cpu: 1, mem: "2GiB" })
166-
167-
// R43 trace assembly is left as a follow-up for the single-shot path
168-
// (the per-row path used to thread `traceStep` through `processColumn`'s
169-
// `traceSteps` option, which xsv.importFile doesn't have). Block-id
170-
// domain is still attached per column via specs.lib.tengo so trace
171-
// propagation can be reattached without an output shape change.
165+
scoresXsvPf := xsv.importFile(scoresTsv, "tsv", xsvSettings, { cpu: 1, mem: "2GiB" })
166+
167+
// Spec R43: derive the trace chain from the upstream PDB column and
168+
// stamp every emitted PColumn so downstream consumers see the full
169+
// block lineage (upstream blocks plus this one).
170+
trace := pSpec.makeTrace(pdbCol.spec, {
171+
type: "milaboratories.3d-structure-based-liabilities",
172+
id: blockId,
173+
importance: 20,
174+
label: "3D Structure-Based Liabilities"
175+
})
176+
scoresPfBuilder := pframes.pFrameBuilder()
177+
for k, v in scoresXsvPf {
178+
scoresPfBuilder.add(k, trace.inject(v.spec), v.data)
179+
}
180+
scoresPf := scoresPfBuilder.build()
172181

173182
return {
174183
outputs: {

0 commit comments

Comments
 (0)