@platforma-open/milaboratories.3d-structure-prediction.workflow 1.0.5 → 1.0.7

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,12 +1,13 @@
1
1
   WARN  Issue while reading "/home/runner/work/3d-structure-prediction/3d-structure-prediction/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.3d-structure-prediction.workflow@1.0.5 build /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow
3
+ > @platforma-open/milaboratories.3d-structure-prediction.workflow@1.0.7 build /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow
4
4
  > shx rm -rf dist && pl-tengo check && pl-tengo build
5
5
 
6
6
  info: Skipping unknown file type: wf.test.ts
7
7
  Processing "src/build-pdbs-map.tpl.tengo"...
8
8
  Processing "src/main.tpl.tengo"...
9
9
  Processing "src/predict-batch.tpl.tengo"...
10
+ Processing "src/prerun.tpl.tengo"...
10
11
  Processing "src/structure-cols-conv.lib.tengo"...
11
12
  No syntax errors found.
12
13
  info: Skipping unknown file type: wf.test.ts
@@ -14,6 +15,7 @@ No syntax errors found.
14
15
  info: - writing /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow/dist/tengo/lib/structure-cols-conv.lib.tengo
15
16
  info: - writing /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow/dist/tengo/tpl/build-pdbs-map.plj.gz
16
17
  info: - writing /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow/dist/tengo/tpl/predict-batch.plj.gz
18
+ info: - writing /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow/dist/tengo/tpl/prerun.plj.gz
17
19
  info: - writing /home/runner/work/3d-structure-prediction/3d-structure-prediction/workflow/dist/tengo/tpl/main.plj.gz
18
20
  info: Template Pack build done.
19
21
  info: Template Pack build done.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @platforma-open/milaboratories.3d-structure-prediction.workflow
2
2
 
3
+ ## 1.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 49b6d30: Update workflow version
8
+ - Updated dependencies [49b6d30]
9
+ - @platforma-open/milaboratories.3d-structure-prediction.software@1.0.6
10
+
11
+ ## 1.0.6
12
+
13
+ ### Patch Changes
14
+
15
+ - 0aae4c9: Add a pre-flight clonotype-count check. The prerun counts distinct clonotypes in the selected dataset (after the optional filter) and disables Run with an explanatory alert when the count exceeds 10 000.
16
+
3
17
  ## 1.0.5
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  module.exports = { Templates: {
2
2
  'build-pdbs-map': { type: 'from-file', path: require.resolve('./tengo/tpl/build-pdbs-map.plj.gz') },
3
3
  'predict-batch': { type: 'from-file', path: require.resolve('./tengo/tpl/predict-batch.plj.gz') },
4
+ 'prerun': { type: 'from-file', path: require.resolve('./tengo/tpl/prerun.plj.gz') },
4
5
  'main': { type: 'from-file', path: require.resolve('./tengo/tpl/main.plj.gz') }
5
6
  }};
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 = "build-pdbs-map" | "predict-batch" | "main";
2
+ declare type TplName = "build-pdbs-map" | "predict-batch" | "prerun" | "main";
3
3
  declare const Templates: Record<TplName, TemplateFromFile>;
4
4
  export { Templates };
package/dist/index.js CHANGED
@@ -2,5 +2,6 @@ import { resolve } from 'node:path';
2
2
  export const Templates = {
3
3
  'build-pdbs-map': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/build-pdbs-map.plj.gz') },
4
4
  'predict-batch': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/predict-batch.plj.gz') },
5
+ 'prerun': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/prerun.plj.gz') },
5
6
  'main': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/main.plj.gz') }
6
7
  };
@@ -165,7 +165,7 @@ getPredictionSuccessfulSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
165
165
  valueType: "Int",
166
166
  name: "pl7.app/structure/predictionSuccessful",
167
167
  annotations: {
168
- "pl7.app/label": "Structure predicted",
168
+ "pl7.app/label": "All structures",
169
169
  "pl7.app/isSubset": "true",
170
170
  "pl7.app/table/visibility": "hidden"
171
171
  }
@@ -177,7 +177,7 @@ getPredictionSuccessfulSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
177
177
 
178
178
 
179
179
 
180
- getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName, confidenceMetric, threshold) {
180
+ getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
181
181
  return {
182
182
  axes: [{ column: clonotypeAxisName, spec: clonotypeAxisSpec }],
183
183
  columns: [{
@@ -186,7 +186,7 @@ getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName, confidenceMet
186
186
  valueType: "Int",
187
187
  name: "pl7.app/structure/confident",
188
188
  annotations: {
189
- "pl7.app/label": "Confident structure (" + confidenceMetric + " ≤ " + string(threshold) + " Å)",
189
+ "pl7.app/label": "Confident structures",
190
190
  "pl7.app/isSubset": "true",
191
191
  "pl7.app/table/visibility": "hidden"
192
192
  }
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.3d-structure-prediction.workflow",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Block Workflow",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@platforma-sdk/workflow-tengo": "5.21.0",
8
- "@platforma-open/milaboratories.3d-structure-prediction.software": "1.0.5"
7
+ "@platforma-sdk/workflow-tengo": "5.25.0",
8
+ "@platforma-open/milaboratories.3d-structure-prediction.software": "1.0.6"
9
9
  },
10
10
  "devDependencies": {
11
- "@platforma-sdk/tengo-builder": "2.5.26",
12
- "@platforma-sdk/test": "1.75.6"
11
+ "@platforma-sdk/tengo-builder": "3.0.1",
12
+ "@platforma-sdk/test": "1.77.5"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "vitest": "*"
@@ -14,6 +14,8 @@ structureColsConv := import(":structure-cols-conv")
14
14
  predictBatchTpl := assets.importTemplate(":predict-batch")
15
15
  immuneBuilderSw := assets.importSoftware("@platforma-open/milaboratories.3d-structure-prediction.software:immunebuilder-predict")
16
16
 
17
+ wf.setPreRun(assets.importTemplate(":prerun"))
18
+
17
19
  wf.prepare(func(args) {
18
20
  // args.dataset is a PrimaryRef { __isPrimaryRef: "v1", column: PlRef, filter?: PlRef }.
19
21
  // `addAnchor` resolves the dataset column (also gives us its spec for the
@@ -208,7 +210,7 @@ wf.body(func(args) {
208
210
 
209
211
  confidentPf := xsv.importFile(
210
212
  subsetRun.getFile("confident.tsv"), "tsv",
211
- structureColsConv.getConfidentSettings(clonotypeAxisSpec, clonotypeAxisName, confidenceMetric, threshold),
213
+ structureColsConv.getConfidentSettings(clonotypeAxisSpec, clonotypeAxisName),
212
214
  { splitDataAndSpec: true })
213
215
 
214
216
  // Final structures pframe: confidence + subset columns. The label column
@@ -70,4 +70,4 @@ self.body(func(inputs) {
70
70
  confidence: predictRun.getFile("confidence.tsv"),
71
71
  pdbsMap: predictRun.getProcessorResult("pdbsMap")
72
72
  }
73
- })
73
+ })
@@ -0,0 +1,54 @@
1
+ // Pre-flight check for the 3D Structure Prediction workflow.
2
+ //
3
+ // Counts the number of distinct clonotype-axis values in the selected
4
+ // heavy-chain column AFTER applying the optional dataset filter. The result
5
+ // is surfaced to the model so the UI can warn / disable Run when the input
6
+ // would generate too many batches to be feasible.
7
+ //
8
+ // Mirrors `main.tpl.tengo`'s primary-source plumbing: the optional filter is
9
+ // applied via the ResolvedPrimaryRef shape, so the count reflects exactly
10
+ // what the main `pframes.processColumn` would batch over.
11
+
12
+ wf := import("@platforma-sdk/workflow-tengo:workflow")
13
+ pt := import("@platforma-sdk/workflow-tengo:pt")
14
+
15
+ wf.prepare(func(args) {
16
+ bb := wf.createPBundleBuilder()
17
+ bb.ignoreMissingDomains()
18
+ bb.addAnchor("main", args.dataset.column)
19
+ bb.addSingle(args.heavyChainRef)
20
+ if !is_undefined(args.dataset.filter) {
21
+ bb.addRef(args.dataset.filter)
22
+ }
23
+ return { columns: bb.build() }
24
+ })
25
+
26
+ wf.body(func(args) {
27
+ columns := args.columns
28
+ heavy := columns.getColumn(args.heavyChainRef)
29
+
30
+ // Counting workflow: load heavy chain, optionally inner-join the filter
31
+ // on the (shared) clonotype axis, then count rows. Heavy chain is keyed
32
+ // solely by the clonotype axis, so the row count equals the number of
33
+ // distinct clonotypes that the main batch run would fan out over.
34
+ countWf := pt.workflow().mem("1GiB").cpu(1)
35
+ heavyEntry := pt.p.column("heavy", { spec: heavy.spec, data: heavy.data })
36
+
37
+ pEntry := heavyEntry
38
+ if !is_undefined(args.dataset.filter) {
39
+ filterCol := columns.getColumn(args.dataset.filter)
40
+ filterEntry := pt.p.column("filterValue", { spec: filterCol.spec, data: filterCol.data })
41
+ pEntry = pt.p.inner(heavyEntry, filterEntry)
42
+ }
43
+
44
+ df := countWf.frame(pEntry)
45
+ df.select(pt.col("heavy").count().alias("count")).saveContent("count.tsv")
46
+ countRun := countWf.run()
47
+
48
+ return {
49
+ outputs: {
50
+ clonotypeCount: countRun.getFileContent("count.tsv")
51
+ },
52
+ exports: {}
53
+ }
54
+ })
@@ -165,7 +165,7 @@ getPredictionSuccessfulSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
165
165
  valueType: "Int",
166
166
  name: "pl7.app/structure/predictionSuccessful",
167
167
  annotations: {
168
- "pl7.app/label": "Structure predicted",
168
+ "pl7.app/label": "All structures",
169
169
  "pl7.app/isSubset": "true",
170
170
  "pl7.app/table/visibility": "hidden"
171
171
  }
@@ -177,7 +177,7 @@ getPredictionSuccessfulSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
177
177
 
178
178
  // xsv.importFile settings for the `confident` subset PColumn — 1 when the
179
179
  // user-selected confidence metric is ≤ threshold AND prediction succeeded.
180
- getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName, confidenceMetric, threshold) {
180
+ getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName) {
181
181
  return {
182
182
  axes: [{ column: clonotypeAxisName, spec: clonotypeAxisSpec }],
183
183
  columns: [{
@@ -186,7 +186,7 @@ getConfidentSettings := func(clonotypeAxisSpec, clonotypeAxisName, confidenceMet
186
186
  valueType: "Int",
187
187
  name: "pl7.app/structure/confident",
188
188
  annotations: {
189
- "pl7.app/label": "Confident structure (" + confidenceMetric + " ≤ " + string(threshold) + " Å)",
189
+ "pl7.app/label": "Confident structures",
190
190
  "pl7.app/isSubset": "true",
191
191
  "pl7.app/table/visibility": "hidden"
192
192
  }