Visium HD integration - #41
Open
ch99l wants to merge 24 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated Visium HD execution path to the Nextflow pipeline, alongside a refactor of standard clustering/quantification modules to support both automated and “manual clustering” restarts. It also introduces separate bambu and seurat containers and expands smoke tests to cover the new workflows.
Changes:
- Added a Visium HD workflow (
--visium_hd) including bin aggregation, spot/bin mapping, optional Banksy clustering, and per-resolution quantification. - Refactored standard clustering + quantification into shared/standard/visium_hd module structure; renamed
--resolution→--seurat_resolutionandEM_clusters→clusteredEM. - Added
--manual_clusteringrestart mode, updated docs/examples, and extended CI smoke tests + container build workflow.
Reviewed changes
Copilot reviewed 38 out of 60 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
subworkflows/prepare_input_visium_hd.nf |
New Visium HD input preparation subworkflow. |
subworkflows/prepare_input_standard.nf |
Updated module include paths for standard input prep. |
subworkflows/clustering.nf |
Removed legacy clustering subworkflow. |
subworkflows/clustering_standard.nf |
New standard clustering subworkflow with updated inputs. |
README.md |
Documented Visium HD + manual clustering + parameter renames. |
nextflow.config |
Added Visium HD/manual params; renamed clustering params. |
modules/seurat/visium_hd/clustering.nf |
New Seurat/Banksy clustering process for Visium HD. |
modules/seurat/standard/single_sample_clustering.nf |
Refactored single-sample clustering to use count dirs + colData. |
modules/seurat/standard/multi_sample_clustering.nf |
Refactored multi-sample clustering (Harmony integration) inputs. |
modules/prepare_input/visium_hd/spot_bin_mappings.nf |
New process to produce spot→bin mapping CSVs. |
modules/prepare_input/visium_hd/filter_barcoded_bam.nf |
New BAM filter process using in-tissue barcodes. |
modules/prepare_input/visium_hd/convert_tissue_positions.nf |
New parquet→CSV conversion for tissue positions (+ barcodes). |
modules/prepare_input/visium_hd/convert_barcode_mappings.nf |
New parquet→CSV conversion for barcode mappings per resolution. |
modules/prepare_input/standard/extract_spatial_coordinates.nf |
New process extracting spatial coordinates for Visium chemistries. |
modules/prepare_input/standard/extract_barcodes.nf |
New process extracting 10x barcode whitelist per chemistry. |
modules/bambu/visium_hd/transcript_discovery.nf |
New transcript discovery for Visium HD at 2µm. |
modules/bambu/visium_hd/spot_level_quantification.nf |
New per-resolution spot/bin-level EM quantification for Visium HD. |
modules/bambu/visium_hd/map_clusters_to_2um_spots.nf |
New mapping of bin clusters down to 2µm spots. |
modules/bambu/visium_hd/extract_spot_barcodes.nf |
New helper to extract 2µm barcodes + sample name from quantData. |
modules/bambu/visium_hd/aggregate_bins.nf |
New aggregation of 2µm SE into coarser bin resolutions. |
modules/bambu/standard/transcript_discovery.nf |
Refactored standard discovery; now always publishes restart artifacts. |
modules/bambu/standard/single_cell_quantification.nf |
New single-cell EM quantification module (standard workflow). |
modules/bambu/shared/prepare_annotation.nf |
Retagged process label to bambu container. |
modules/bambu/shared/construct_read_class.nf |
Retagged process label to bambu container. |
modules/bambu/shared/cluster_level_quantification.nf |
Refactored cluster-level quantification into shared module. |
main.nf |
Split into STANDARD and VISIUM_HD workflows; rewired modules. |
lib/Validation.groovy |
Added Visium HD + new param validations; renamed seurat param. |
examples/samplesheet_visium_hd_synthetic.csv |
Added Visium HD synthetic example samplesheet. |
examples/samplesheet_visium_hd_quant_data.csv |
Added Visium HD manual-clustering restart samplesheet. |
examples/samplesheet_test_sc_quant_data.csv |
Added standard manual-clustering restart samplesheet. |
examples/bins_visium_hd_synthetic.csv |
Added synthetic Visium HD bins CSV example. |
containers/seurat/Dockerfile |
New Seurat container (Seurat, Harmony, Banksy, wrappers). |
containers/bambu/Dockerfile |
Updated bambu container dependencies and removed Seurat/Harmony. |
conf/smoke_test.config |
Added smoke-test profiles for Visium HD + manual clustering. |
conf/dev.config |
Updated valid quantification mode list (clusteredEM). |
conf/containers.config |
Split r into bambu + seurat; add pyarrow/pandas image. |
conf/base.config |
Updated retry strategy labels to `bambu |
CHANGELOG.md |
Added v0.10.0 notes for Visium HD + refactor. |
bin/visium_hd_spot_bin_mappings.py |
New script to subset barcode mappings to quantified spots. |
bin/visium_hd_convert_tissue_positions.py |
New script to convert tissue_positions parquet→CSV (+ barcodes). |
bin/visium_hd_convert_barcode_mappings.py |
New script to subset barcode_mappings parquet per resolution. |
bin/visium_hd_cluster.R |
New R helpers for Banksy/expression-only Visium HD clustering. |
bin/visium_hd_aggregate_resolution.R |
New R helper to aggregate 2µm counts to bins. |
bin/save_counts.R |
Renamed helper to saveCounts() and refactored variable names. |
bin/map_spots_to_clusters.R |
New R helpers to read clusters and expand bin clusters to spots. |
bin/create_seurat_object.R |
New R helper to build Seurat objects from count directories. |
bin/bambu_discovery.R |
New shared R helper encapsulating discovery + quantData + uniqueCounts. |
.github/workflows/smoke_test.yml |
Expanded smoke-test matrix with Visium HD/manual variants. |
.github/workflows/build_container.yml |
Generalized container build to multiple labeled images. |
Suppressed comments (1)
modules/bambu/shared/cluster_level_quantification.nf:31
- Manual clustering docs indicate the clusters input can be a CSV/TSV with
id,cluster, but this code passes non-.rdsinputs as a string path intobambu.singlecell(). That’s unlikely to match the expected named-vector type and will break manual clustering with CSV input. Parse the file into anid -> clusternamed vector (the repo already includes areadClusters()helper).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+17
| // Visium HD: single sample, starting from a pre-aligned, barcode-tagged BAM file | ||
| ch_rows.collect(flat: false).map { rows -> Validation.validateVisiumHDRows(rows) } | ||
|
|
||
| ch_sample = ch_rows.map { row -> | ||
| def sample_path = file(row.path, checkIfExists: true) | ||
| def meta = [chemistry: 'visium-hd', technology: 'NA'] | ||
| [row.sample, sample_path, meta] | ||
| } |
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.
No description provided.