Milab-6847: vj usage abundance dtype - #41
Merged
Merged
Conversation
The input table was built with tsvFileBuilder.build(), which emits an untyped TSV, so ptabler let polars infer the column types. An abundance column with no parseable numeric value in the exported table -- an empty join result, or all-null abundance -- is inferred as String; sum() keeps that dtype and the per-sample normalisation then fails during query planning with "division with 'String' datatypes is not allowed". Build the table with buildForPT() instead, so column types come from the p-column and axis specs and nulls are written as the "%%NA%%" sentinel that ptabler declares per column. wf.frame() reads xsvType and the schema straight off the structural input, so its options argument is no longer needed. This changes the exported TSV bytes, so cached results for this block are invalidated -- correct here, since the previous output was wrong.
The shared CI gates publication on @platforma-sdk/block-tools being at the latest version (node-simple-pnpm.yaml, require-latest step), so the build is rejected otherwise. pnpm-lock.yaml is updated alongside, which the same workflow also enforces for any pnpm-workspace.yaml change.
Both workflows pinned node-version to '20.x'. Move them to '22.x', matching the 12 blocks already on it against the same shared workflows (node-simple-pnpm.yaml and block-mark-stable.yaml at @v4). Both also carried a copy-paste leftover naming this block "CDR3 SpectraType", with app-name-slug 'block-cdr3-spectratype' colliding with the real cdr3-spectratype block. Since the slug is part of the release file name and app-name is what CI reports in messages, this block's builds and releases were labelled as another one. Name it after itself instead.
kevindetry-milaboratories
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
The PR fixes abundance normalization for empty or all-null input by preserving the analysis table’s declared schema, while also updating CI identity, Node, and publication tooling.
buildForPT()to carry this schema into the calculation.@platforma-sdk/block-tools— Build, packaging, publication, and stable-marking tooling. It is upgraded from 2.12.6 to 2.14.3.Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified.
The paired typed-table construction and frame-loading changes preserve existing headers and calculation contracts while preventing empty or all-null abundance data from being inferred as strings; the CI and tooling updates show no established incompatibility.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Resolved sample, clonotype, V, J, and abundance columns] --> B[Build typed PTabler table] B --> C[Load frame with declared schema] C --> D[Compute per-sample totals] C --> E[Group V, J, and V/J usage] D --> F[Normalize weighted and unweighted measures] E --> F F --> G[Publish typed usage results]Reviews (1): Last reviewed commit: "MILAB-6847: run CI on node 22, fix copy-..." | Re-trigger Greptile
Context used (3)