@platforma-open/milaboratories.rarefaction.workflow 1.1.2 → 1.1.4

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.
@@ -1,11 +1,13 @@
1
1
   WARN  Issue while reading "/home/runner/work/rarefaction/rarefaction/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.rarefaction.workflow@1.1.2 build /home/runner/work/rarefaction/rarefaction/workflow
3
+ > @platforma-open/milaboratories.rarefaction.workflow@1.1.4 build /home/runner/work/rarefaction/rarefaction/workflow
4
4
  > rm -rf dist && pl-tengo check && pl-tengo build
5
5
 
6
6
  Processing "src/main.tpl.tengo"...
7
+ Processing "src/rarefaction-calculation.tpl.tengo"...
7
8
  No syntax errors found.
8
9
  info: Compiling 'dist'...
10
+ info: - writing /home/runner/work/rarefaction/rarefaction/workflow/dist/tengo/tpl/rarefaction-calculation.plj.gz
9
11
  info: - writing /home/runner/work/rarefaction/rarefaction/workflow/dist/tengo/tpl/main.plj.gz
10
12
  info: Template Pack build done.
11
13
  info: Template Pack build done.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @platforma-open/milaboratories.rarefaction.workflow
2
2
 
3
+ ## 1.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 602e87e: Fix deduplication
8
+
9
+ ## 1.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - f1cf90d: Support parquet format (update SDK)
14
+ - Updated dependencies [f1cf90d]
15
+ - @platforma-open/milaboratories.rarefaction.software@1.2.3
16
+
3
17
  ## 1.1.2
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
1
  module.exports = { Templates: {
2
+ 'rarefaction-calculation': { type: 'from-file', path: require.resolve('./tengo/tpl/rarefaction-calculation.plj.gz') },
2
3
  'main': { type: 'from-file', path: require.resolve('./tengo/tpl/main.plj.gz') }
3
4
  }};
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 = "main";
2
+ declare type TplName = "rarefaction-calculation" | "main";
3
3
  declare const Templates: Record<TplName, TemplateFromFile>;
4
4
  export { Templates };
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
2
  export const Templates = {
3
+ 'rarefaction-calculation': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/rarefaction-calculation.plj.gz') },
3
4
  'main': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/main.plj.gz') }
4
5
  };
Binary file
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.rarefaction.workflow",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "description": "Block Workflow",
6
6
  "dependencies": {
7
- "@platforma-sdk/workflow-tengo": "^5.3.3",
8
- "@platforma-open/milaboratories.rarefaction.software": "1.2.2"
7
+ "@platforma-sdk/workflow-tengo": "^5.5.12",
8
+ "@platforma-open/milaboratories.rarefaction.software": "1.2.3"
9
9
  },
10
10
  "devDependencies": {
11
- "@platforma-sdk/tengo-builder": "^2.3.0",
12
- "@platforma-sdk/test": "^1.44.7",
11
+ "@platforma-sdk/tengo-builder": "^2.3.3",
12
+ "@platforma-sdk/test": "^1.45.15",
13
13
  "vitest": "^2.1.8"
14
14
  },
15
15
  "scripts": {
@@ -1,13 +1,13 @@
1
1
  wf := import("@platforma-sdk/workflow-tengo:workflow")
2
- exec := import("@platforma-sdk/workflow-tengo:exec")
3
2
  assets := import("@platforma-sdk/workflow-tengo:assets")
4
3
  ll := import("@platforma-sdk/workflow-tengo:ll")
5
4
  pframes := import("@platforma-sdk/workflow-tengo:pframes")
6
5
  xsv := import("@platforma-sdk/workflow-tengo:pframes.xsv")
7
6
  pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
8
7
  maps := import("@platforma-sdk/workflow-tengo:maps")
8
+ render := import("@platforma-sdk/workflow-tengo:render")
9
9
 
10
- rarefactionSw := assets.importSoftware("@platforma-open/milaboratories.rarefaction.software:main")
10
+ rarefactionTpl := assets.importTemplate(":rarefaction-calculation")
11
11
 
12
12
  getSpec := func(abundanceSpec, args) {
13
13
  return {
@@ -70,7 +70,9 @@ getSpec := func(abundanceSpec, args) {
70
70
  }
71
71
  }
72
72
  }
73
- ]
73
+ ],
74
+ storageFormat: "Parquet",
75
+ partitionKeyLength: 0
74
76
  }
75
77
  }
76
78
 
@@ -96,8 +98,6 @@ wf.prepare(func(args) {
96
98
  })
97
99
 
98
100
  wf.body(func(args) {
99
- infile := "rarefaction-input.tsv"
100
- outfile := "rarefaction-output.tsv"
101
101
 
102
102
  datasetSpec := args.columns.getSpec(args.datasetRef)
103
103
  tsvBuilder := pframes.tsvFileBuilder()
@@ -105,23 +105,19 @@ wf.body(func(args) {
105
105
  tsvBuilder.setAxisHeader(datasetSpec.axesSpec[1].name, "clonotypeKey")
106
106
  tsv := tsvBuilder.build()
107
107
 
108
- rarefactionCmd := exec.builder().
109
- software(rarefactionSw).
110
- mem(string(args.mem) + "GiB").
111
- cpu(args.cpu).
112
- arg(infile).
113
- addFile(infile, tsv).
114
- arg(outfile).
115
- arg(args.numPoints).
116
- arg(args.numIterations).
117
- arg(string(args.extrapolation)).
118
- saveFile(outfile).
119
- dontSaveStdoutOrStderr().
120
- cacheMinutes(24*60).
121
- printErrStreamToStdout().
122
- run()
108
+ // Call UMAP calculation subtemplate
109
+ rarefactionRender := render.create(rarefactionTpl, {
110
+ inputTsv: tsv,
111
+ numPoints: args.numPoints,
112
+ numIterations: args.numIterations,
113
+ extrapolation: args.extrapolation,
114
+ metaInputs: {
115
+ mem: args.mem,
116
+ cpu: args.cpu
117
+ }
118
+ })
123
119
 
124
- rarefactionPFrame := xsv.importFile(rarefactionCmd.getFile(outfile), "tsv", getSpec(datasetSpec, args), {
120
+ rarefactionPFrame := xsv.importFile(rarefactionRender.output("rarefactionOutput"), "tsv", getSpec(datasetSpec, args), {
125
121
  splitDataAndSpec: true
126
122
  })
127
123
 
@@ -0,0 +1,52 @@
1
+ self := import("@platforma-sdk/workflow-tengo:tpl")
2
+ exec := import("@platforma-sdk/workflow-tengo:exec")
3
+ assets := import("@platforma-sdk/workflow-tengo:assets")
4
+
5
+ rarefactionSw := assets.importSoftware("@platforma-open/milaboratories.rarefaction.software:main")
6
+
7
+ self.validateInputs({
8
+ "__options__,closed": "",
9
+ inputTsv: "any",
10
+ numPoints: "string",
11
+ numIterations: "string",
12
+ extrapolation: "boolean",
13
+ metaInputs: {
14
+ "__options__,closed": "",
15
+ "mem,?": "number",
16
+ "cpu,?": "number"
17
+ }
18
+ })
19
+
20
+ self.defineOutputs("rarefactionOutput")
21
+
22
+ self.body(func(args) {
23
+ // Get input parameters
24
+ cpu := args.metaInputs.cpu
25
+ mem := args.metaInputs.mem
26
+ numPoints := args.numPoints
27
+ numIterations := args.numIterations
28
+ extrapolation := args.extrapolation
29
+ inputTsv := args.inputTsv
30
+
31
+ infile := "rarefaction-input.tsv"
32
+ outfile := "rarefaction-output.tsv"
33
+
34
+ rarefactionCmd := exec.builder().
35
+ software(rarefactionSw).
36
+ mem(string(mem) + "GiB").
37
+ cpu(cpu).
38
+ arg(infile).
39
+ addFile(infile, inputTsv).
40
+ arg(outfile).
41
+ arg(numPoints).
42
+ arg(numIterations).
43
+ arg(string(extrapolation)).
44
+ saveFile(outfile).
45
+ cacheMinutes(4*60).
46
+ printErrStreamToStdout().
47
+ run()
48
+
49
+ return {
50
+ rarefactionOutput: rarefactionCmd.getFile(outfile)
51
+ }
52
+ })