Skip to content

MILAB-6818: export the study setup without its data - #132

Merged
AStaroverov merged 2 commits into
mainfrom
MILAB-6818_template-params-strip-data
Aug 25, 2026
Merged

MILAB-6818: export the study setup without its data#132
AStaroverov merged 2 commits into
mainfrom
MILAB-6818_template-params-strip-data

Conversation

@AStaroverov

@AStaroverov AStaroverov commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

deriveTemplateParams now always exports the study's setup and never its data.

Before, it had two modes: if every file in the block was a storage reference (index://), the whole state travelled — datasets with files, samples, sample labels, metadata values; otherwise everything keyed by sample or by group was stripped. The result was that the same export meant one thing for one study and another for the next, depending on where its files happened to live.

Now there is one mode:

  • datasets travel as configured — type, read indices, tag names, barcode tags, xsv flavour, sample column name — with data, sampleGroups, groupLabels and barcodeRules emptied;
  • metadata columns travel with id / label / global / valueType, without values;
  • sampleLabelColumnLabel travels;
  • sampleIds, sampleLabels, h5adFilesToPreprocess and seuratFilesToPreprocess stay behind — samples are created by importing files, so a sample arriving without its file is a row with metadata and no data.

The block a template seeds is the study as it was set up, waiting for its files: the user re-adds data into the datasets that are already there instead of rebuilding them.

The portability machinery (isDatasetPortable, collectDatasetHandles) is dropped with it.

Not changed

BlockParams in the kind package stays permissive — a fully populated dataset is still a valid param, it is just not something this block produces on export.

Greptile Summary

The PR makes template exports deterministic by retaining study configuration while always removing sample-, group-, and file-associated data.

  • Removes the portability-dependent full-study export path and its file-handle inspection helpers.
  • Preserves configured datasets while clearing dataset data, sample groups, group labels, and multiplexing barcode rules.
  • Preserves metadata column definitions while clearing their values.
  • Retains the sample-label column name while omitting sample identities, labels, and preprocessing file lists.
  • BlockParams — The optional initialization contract used to seed a block. This PR narrows what deriveTemplateParams produces without changing the permissive contract itself.
  • deriveTemplateParams — Converts current block state into template initialization parameters. It now always emits setup-only parameters rather than conditionally exporting a complete portable study.
  • DSAny / DSContent — The dataset object and typed dataset-content union. Their configured fields are retained, while sample- or group-keyed data is cleared.
  • Grouped dataset — A dataset whose files are organized into groups mapped to samples. Export now clears its data, sampleGroups, and groupLabels.
  • MultiplexedFastq — A grouped FASTQ dataset configured with barcode tags and assignment rules. Export retains its configuration but empties barcodeRules along with group-bound data.
  • MTColumn — A metadata column definition plus values keyed by sample ID. Export retains its identity, label, global flag, and value type while replacing values with an empty map.
  • Portable file handle — Previously, an index:// storage reference that allowed the complete study to be exported. Portability detection is removed because templates no longer export study data.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking defect identified in the changed export path.

The exported dataset and metadata shapes remain valid, omitted fields receive empty initialization defaults, and grouped and multiplexing validation accepts the deliberately emptied state.

Important Files Changed

Filename Overview
model/src/template_params.ts Replaces conditional portable-study export with a consistent setup-only projection; the resulting empty dataset and metadata shapes remain valid initialization inputs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    S[Current study state] --> D[Retain dataset configuration]
    D --> X[Clear data, groups, labels, and barcode rules]
    S --> M[Retain metadata definitions]
    M --> V[Clear metadata values]
    S --> L[Retain sample-label column name]
    X --> T[Setup-only BlockParams]
    V --> T
    L --> T
    T --> N[New study awaiting file imports]
Loading

Reviews (1): Last reviewed commit: "MILAB-6818: export the study setup witho..." | Re-trigger Greptile

Context used:

deriveTemplateParams carried a fully populated state whenever every file
in it was a storage reference, and stripped it otherwise. That made the
same export mean one thing for one study and another for the next.

Always strip instead: datasets and metadata columns travel as configured,
emptied of everything keyed by sample or by group, and the block a
template seeds waits for its files while the user re-adds data into the
datasets that are already there. Samples go with the files that produced
them, so sampleIds and sampleLabels stay behind as well.

Drops the portability machinery (isDatasetPortable, collectDatasetHandles)
along with it.
@AStaroverov
AStaroverov enabled auto-merge August 25, 2026 12:39
@AStaroverov
AStaroverov added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit ad52c20 Aug 25, 2026
10 checks passed
@AStaroverov
AStaroverov deleted the MILAB-6818_template-params-strip-data branch August 25, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant