Skip to content

Comments

Import cell segmentations for VisiumHD datasets#56

Open
andpet0101 wants to merge 21 commits intomainfrom
visiumhd_segmentation
Open

Import cell segmentations for VisiumHD datasets#56
andpet0101 wants to merge 21 commits intomainfrom
visiumhd_segmentation

Conversation

@andpet0101
Copy link
Member

This pull request implements loading of cell segmented Visium HD data into scrnaseq2.

IMPORTANT: Seurat itself does not yet support loading Visium HD cell segmentations. However, there is a development branch that seems to be close to completion and I suspect that several new functions will be included in the new release. For now, I copied these functions (temporarily) into our code so that they can be used. Once they become part of Seurat, we can remove the copies. That means do we want to wait with our release?

Furthermore I removed the possibility to load multiple bin sizes at once for VisiumHD (visiumhd_bin_sizes) since we almost never used it and it makes the code more complicated. In the file that contains the datasets you just specify the path to one type of data (segmented or a bin size).

@andpet0101
Copy link
Member Author

An example report can be found at: /dcgc/analysis/andreasp/scrnaseq2/visiumhd_example

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements support for loading cell segmented Visium HD datasets into scrnaseq2. The implementation includes temporary functions copied from a development Seurat branch while awaiting official support, and removes the ability to load multiple bin sizes simultaneously for VisiumHD data to simplify the codebase.

  • Adds support for Visium HD cell segmentations with temporary Seurat functions
  • Removes multi-bin size loading capability for VisiumHD datasets
  • Updates documentation and export functionality for better tool compatibility

Reviewed Changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
modules/1_read_data/read_data.qmd Removes multi-bin size support and updates spatial coordinate handling
modules/9_export/export.qmd Updates documentation for metadata export and Loupe browser compatibility
modules/7_cluster_annotation/cluster_annotation.qmd Fixes parameter name in function call
modules/10_deg_analysis/deg_analysis.qmd Updates Seurat object saving configuration
R/functions_io.R Major changes to support segmented VisiumHD data and temporary Seurat functions
R/functions_plotting.R Adds temporary Seurat plotting functions for segmentation support
R/functions_analysis.R Removes globals parameter from furrr options
R/general_configuration.R Adds version tracking for Seurat packages
datasets/*/download.R Updates dataset URLs and adds segmented data downloads
_quarto-scrnaseq.yml Removes visiumhd_bin_sizes configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

# Check files
assertthat::is.readable(image_dir)
for (f in c("tissue_lowres_image.png", "scalefactors_json.json")) {
for (f in c("tissue_hires_image.png", "tissue_lowres_image.png", "scalefactors_json.json")) {
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The function now checks for 'tissue_hires_image.png' in addition to the previous files, but later in the code only 'tissue_lowres_image.png' is used (line 1307). Consider documenting why the hires image check is needed or remove it if not used.

Suggested change
for (f in c("tissue_hires_image.png", "tissue_lowres_image.png", "scalefactors_json.json")) {
for (f in c("tissue_lowres_image.png", "scalefactors_json.json")) {

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to prepare for the possibility to load the high-resolution image 'tissue_hires_image.png' as an alternative.

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