Skip to content

feat(egv-202): replace samplesheet presets with single/paired/hybrid/assembled defaults#829

Open
diegomayorga-dept wants to merge 1 commit into
developmentfrom
feat/egv-202-update-sample-sheets
Open

feat(egv-202): replace samplesheet presets with single/paired/hybrid/assembled defaults#829
diegomayorga-dept wants to merge 1 commit into
developmentfrom
feat/egv-202-update-sample-sheets

Conversation

@diegomayorga-dept

Copy link
Copy Markdown
Contributor

Title*

Replace samplesheet schema presets with single/paired/hybrid/assembled defaults

Type of Change*

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

The Data Collection builder lets users pick a samplesheet schema preset — a named set of columns, each mapped to a semantic role (sample_id, read1, etc.) — that defines the CSV a pipeline run consumes. The presets were developer-named (nf_core_paired_end, nf_core_single_end, long_read, paired_end_with_reference) and the picker rendered labels by naively replacing underscores with spaces (e.g. "nf core paired end").

The client (Kelsey) provided the four schemas they actually use, with example CSVs, and the names they should carry. This PR replaces the presets with those four and gives them clean display labels:

Preset Columns (name → role)
Single sample→sample_id · fastq→reads
Paired sample→sample_id · fastq_1→read1 · fastq_2→read2
Hybrid sample→sample_id · fastq→reads · fastq_1→read1 (optional) · fastq_2→read2 (optional)
Assembled sample→sample_id · fasta→assembly_fasta

Key changes:

  • Added a new assembly_fasta column role (Zod enum, TS union, and role label map) for the assembled schema — its fasta is the sample's own assembly, not a reference genome, so reusing reference_fasta would be semantically wrong and collide with the reference role used by the paired-with-extras path.
  • Redefined SAMPLE_SHEET_SCHEMA_PRESETS and added an explicit SAMPLE_SHEET_SCHEMA_PRESET_LABELS map so the picker shows proper Title Case instead of underscore-stripped keys.
  • Added a readsread1 fallback in buildSampleSheetRowFromRoleMap so the single preset's fastq column populates whether a sample is detected as single-end (sets read1) or long-read (sets reads).
  • Updated the two consumers (EGAddToDataCollectionModal.vue, EGDataCollectionBuilder.vue) to default to paired and to render labels from the new label map.

Related: EGV-202.

Testing*

  • Unit tests (data-collection-sample-sheet.test.ts): 16/16 pass. Added assertions that exactly the four presets exist with the expected columns/roles/labels, and a test verifying the single preset fills its fastq column from a single-end sample via the read1 fallback. Renamed the paired-end build test to use the new paired preset.
  • Type-checked the three modified shared-lib source files — clean (the only repo-wide tsc error is a pre-existing, unrelated CDK version mismatch).
  • Confirmed no lingering references to the old preset keys across front-end, back-end, and shared-lib.

Impact

  • UI: the schema picker now shows exactly Single / Paired / Hybrid / Assembled with clean labels; a new "Assembled genome (FASTA)" option appears in the per-column role dropdown.
  • Existing collections: unaffected — collection columns are stored per-collection, not referenced by preset key. Old collections built with the previous paired columns still match Paired (identical shape); old single-end / long-read collections now display as Custom, which is expected.
  • No new dependencies. No backend/API/schema-persistence changes beyond widening the allowed role enum (backward-compatible — existing stored roles remain valid).

Additional Information

Out of scope by design: auto-detecting hybrid (long + short reads) and assembled (FASTA-only) sample layouts from uploaded S3 files. Those layouts originate in the file-grouping regex engine (sample-regex-grouping.ts), which was explicitly excluded from this change. The two presets are still fully usable as templates — the correct columns appear and rows populate from manually-built samples or CSV import; wiring up auto-detection is deferred to the separate regex/grouping ticket.

Checklist*

  • No new errors or warnings have been introduced.
  • All tests pass successfully and new tests added as necessary.
  • Documentation has been updated accordingly. (N/A — no user-facing docs for presets)
  • Code adheres to the coding and style guidelines of the project.
  • Code has been commented in particularly hard-to-understand areas. (the readsread1 fallback carries an explanatory comment)

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.

2 participants