@platforma-open/milaboratories.top-antibodies.workflow 1.1.0 → 1.1.1
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 +4 -4
- package/CHANGELOG.md +8 -0
- package/dist/tengo/lib/sampled-cols-conv.lib.tengo +46 -0
- package/dist/tengo/tpl/main.plj.gz +0 -0
- package/package.json +5 -4
- package/src/main.tpl.tengo +78 -1
- package/src/sampled-cols-conv.lib.tengo +46 -0
- package/src/wf.test.ts +0 -13
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/work/top-antibodies/top-antibodies/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-open/milaboratories.top-antibodies.workflow@1.1.
|
|
3
|
+
> @platforma-open/milaboratories.top-antibodies.workflow@1.1.1 build /home/runner/work/top-antibodies/top-antibodies/workflow
|
|
4
4
|
> rm -rf dist && pl-tengo check && pl-tengo build
|
|
5
5
|
|
|
6
|
-
info: Skipping unknown file type: wf.test.ts
|
|
7
6
|
Processing "src/main.tpl.tengo"...
|
|
7
|
+
Processing "src/sampled-cols-conv.lib.tengo"...
|
|
8
8
|
No syntax errors found.
|
|
9
|
-
info: Skipping unknown file type: wf.test.ts
|
|
10
9
|
info: Compiling 'dist'...
|
|
10
|
+
info: - writing /home/runner/work/top-antibodies/top-antibodies/workflow/dist/tengo/lib/sampled-cols-conv.lib.tengo
|
|
11
11
|
info: - writing /home/runner/work/top-antibodies/top-antibodies/workflow/dist/tengo/tpl/main.plj.gz
|
|
12
|
-
info:
|
|
12
|
+
info: Template Pack build done.
|
|
13
13
|
info: Template Pack build done.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @platforma-open/milaboratories.top-antibodies.workflow
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 339a780: Main backbone
|
|
8
|
+
- Updated dependencies [339a780]
|
|
9
|
+
- @platforma-open/milaboratories.top-antibodies.software@1.0.1
|
|
10
|
+
|
|
3
11
|
## 1.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
2
|
+
|
|
3
|
+
getColumns := func(datasetSpec, linkerAxisSpec) {
|
|
4
|
+
axes := [
|
|
5
|
+
{
|
|
6
|
+
"column": "clonotypeKey",
|
|
7
|
+
"spec": datasetSpec.axesSpec[1]
|
|
8
|
+
}]
|
|
9
|
+
|
|
10
|
+
if len(linkerAxisSpec) > 0 {
|
|
11
|
+
for key, val in linkerAxisSpec {
|
|
12
|
+
axes.push([
|
|
13
|
+
{
|
|
14
|
+
"column": key,
|
|
15
|
+
"spec": val
|
|
16
|
+
}])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
"axes": axes,
|
|
22
|
+
"columns": [
|
|
23
|
+
{
|
|
24
|
+
"column": "top",
|
|
25
|
+
"id": "link",
|
|
26
|
+
"allowNA": false,
|
|
27
|
+
"spec": {
|
|
28
|
+
"name": "pl7.app/vdj/link",
|
|
29
|
+
"valueType": "Int",
|
|
30
|
+
"domain": {},
|
|
31
|
+
"annotations": {
|
|
32
|
+
"pl7.app/isLinkerColumn": "true",
|
|
33
|
+
"pl7.app/label": "Linker column",
|
|
34
|
+
"pl7.app/table/visibility": "optional"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"storageFormat": "Binary",
|
|
40
|
+
"partitionKeyLength": 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export ll.toStrict({
|
|
45
|
+
getColumns: getColumns
|
|
46
|
+
})
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.top-antibodies.workflow",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Block Workflow",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@platforma-sdk/workflow-tengo": "^4.
|
|
7
|
+
"@platforma-sdk/workflow-tengo": "^4.3.2",
|
|
8
|
+
"@platforma-open/milaboratories.top-antibodies.software": "1.0.1"
|
|
8
9
|
},
|
|
9
10
|
"devDependencies": {
|
|
10
|
-
"@platforma-sdk/tengo-builder": "^2.
|
|
11
|
-
"@platforma-sdk/test": "^1.
|
|
11
|
+
"@platforma-sdk/tengo-builder": "^2.1.3",
|
|
12
|
+
"@platforma-sdk/test": "^1.30.19",
|
|
12
13
|
"vitest": "^2.1.8"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
package/src/main.tpl.tengo
CHANGED
|
@@ -1,10 +1,87 @@
|
|
|
1
1
|
// light block with no workflow
|
|
2
2
|
wf := import("@platforma-sdk/workflow-tengo:workflow")
|
|
3
|
+
exec := import("@platforma-sdk/workflow-tengo:exec")
|
|
4
|
+
assets:= import("@platforma-sdk/workflow-tengo:assets")
|
|
5
|
+
xsv := import("@platforma-sdk/workflow-tengo:pframes.xsv")
|
|
6
|
+
pframes := import("@platforma-sdk/workflow-tengo:pframes")
|
|
7
|
+
sampledColsConv := import(":sampled-cols-conv")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
wf.prepare(func(args){
|
|
11
|
+
// We need a table with cluster ID (optional) | clonotype id | selected ranking columns
|
|
12
|
+
|
|
13
|
+
bundleBuilder := wf.createPBundleBuilder()
|
|
14
|
+
bundleBuilder.ignoreMissingDomains() // to make query work for both bulk and single cell data
|
|
15
|
+
bundleBuilder.addAnchor("main", args.inputAnchor)
|
|
16
|
+
|
|
17
|
+
for col in args.rankingOrder {
|
|
18
|
+
bundleBuilder.addSingle(col)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
bundleBuilder.addMulti({
|
|
22
|
+
axes: [{ anchor: "main", idx: 1 }],
|
|
23
|
+
partialAxesMatch: true,
|
|
24
|
+
annotations: { "pl7.app/isLinkerColumn": "true" }
|
|
25
|
+
},
|
|
26
|
+
"linker")
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
columns: bundleBuilder.build()
|
|
30
|
+
}
|
|
31
|
+
})
|
|
3
32
|
|
|
4
33
|
wf.body(func(args) {
|
|
5
34
|
|
|
35
|
+
columns := args.columns
|
|
36
|
+
datasetSpec := columns.getSpec(args.inputAnchor)
|
|
37
|
+
topClonotypes := args.topClonotypes
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
clonoTable := columns.xsvTableBuilder()
|
|
41
|
+
clonoTable.setAxisHeader(datasetSpec.axesSpec[1].name, "clonotypeKey")
|
|
42
|
+
|
|
43
|
+
for i, col in args.rankingOrder {
|
|
44
|
+
clonoTable.add(col, {header: "Col" + string(i)})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Columns gotten by query require .key
|
|
48
|
+
linkerAxisSpec := {}
|
|
49
|
+
for i, col in columns.getColumns("linker") {
|
|
50
|
+
if datasetSpec.axesSpec[1].name == col.spec.axesSpec[1].name {
|
|
51
|
+
clonoTable.add(col.key, {header: "linker." + string(i)})
|
|
52
|
+
clonoTable.setAxisHeader(col.spec.axesSpec[0].name, "cluster_" + string(i))
|
|
53
|
+
linkerAxisSpec["cluster_" + string(i)] = col.spec.axesSpec[0]
|
|
54
|
+
} else if datasetSpec.axesSpec[1].name == col.spec.axesSpec[0].name {
|
|
55
|
+
clonoTable.add(col.key, {header: "linker." + string(i)})
|
|
56
|
+
clonoTable.setAxisHeader(col.spec.axesSpec[1].name, "cluster_" + string(i))
|
|
57
|
+
linkerAxisSpec["cluster_" + string(i)] = col.spec.axesSpec[1]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
clonoTable = clonoTable.build("csv")
|
|
63
|
+
|
|
64
|
+
sampleClones := exec.builder().
|
|
65
|
+
software(assets.importSoftware("@platforma-open/milaboratories.top-antibodies.software:sample-clonotypes")).
|
|
66
|
+
addFile("filteredClonotypes.csv", clonoTable).
|
|
67
|
+
arg("--csv").arg("filteredClonotypes.csv").
|
|
68
|
+
arg("--n").arg(string(topClonotypes)).
|
|
69
|
+
arg("--out").arg("sampledClonotypes.csv").
|
|
70
|
+
saveFile("sampledClonotypes_top.csv").
|
|
71
|
+
printErrStreamToStdout().
|
|
72
|
+
saveStdoutContent().
|
|
73
|
+
cache(24 * 60 * 60 * 1000).
|
|
74
|
+
run()
|
|
75
|
+
|
|
76
|
+
sampledColsParams := sampledColsConv.getColumns(datasetSpec, linkerAxisSpec)
|
|
77
|
+
sampledColumnsPf := xsv.importFile(sampleClones.getFile("sampledClonotypes_top.csv"), "csv", sampledColsParams)
|
|
78
|
+
|
|
79
|
+
// we need to output all filtered data axis
|
|
80
|
+
|
|
6
81
|
return {
|
|
7
|
-
outputs: {
|
|
82
|
+
outputs: {
|
|
83
|
+
"sampledColumns": pframes.exportFrame(sampledColumnsPf)
|
|
84
|
+
},
|
|
8
85
|
exports: {}
|
|
9
86
|
}
|
|
10
87
|
})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
2
|
+
|
|
3
|
+
getColumns := func(datasetSpec, linkerAxisSpec) {
|
|
4
|
+
axes := [
|
|
5
|
+
{
|
|
6
|
+
"column": "clonotypeKey",
|
|
7
|
+
"spec": datasetSpec.axesSpec[1]
|
|
8
|
+
}]
|
|
9
|
+
|
|
10
|
+
if len(linkerAxisSpec) > 0 {
|
|
11
|
+
for key, val in linkerAxisSpec {
|
|
12
|
+
axes.push([
|
|
13
|
+
{
|
|
14
|
+
"column": key,
|
|
15
|
+
"spec": val
|
|
16
|
+
}])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
"axes": axes,
|
|
22
|
+
"columns": [
|
|
23
|
+
{
|
|
24
|
+
"column": "top",
|
|
25
|
+
"id": "link",
|
|
26
|
+
"allowNA": false,
|
|
27
|
+
"spec": {
|
|
28
|
+
"name": "pl7.app/vdj/link",
|
|
29
|
+
"valueType": "Int",
|
|
30
|
+
"domain": {},
|
|
31
|
+
"annotations": {
|
|
32
|
+
"pl7.app/isLinkerColumn": "true",
|
|
33
|
+
"pl7.app/label": "Linker column",
|
|
34
|
+
"pl7.app/table/visibility": "optional"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"storageFormat": "Binary",
|
|
40
|
+
"partitionKeyLength": 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export ll.toStrict({
|
|
45
|
+
getColumns: getColumns
|
|
46
|
+
})
|
package/src/wf.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { tplTest } from "@platforma-sdk/test";
|
|
2
|
-
|
|
3
|
-
tplTest(
|
|
4
|
-
'should return a concatenated string',
|
|
5
|
-
async ({ helper, expect }) => {
|
|
6
|
-
const results = await helper.renderWorkflow("main", false, {
|
|
7
|
-
name: 'World'
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const tengoMessage = results.output("tengoMessage", (a) => a?.getDataAsJson<string>());
|
|
11
|
-
expect(await tengoMessage.awaitStableValue()).eq('Hello from Tengo, World!');
|
|
12
|
-
}
|
|
13
|
-
);
|