Skip to content

Comments

Fix Interaction between UpdateSeuratObject and VisiumV1 Objects#277

Closed
YoukaiFromAccounting wants to merge 2 commits intomainfrom
fix-updatev1objects
Closed

Fix Interaction between UpdateSeuratObject and VisiumV1 Objects#277
YoukaiFromAccounting wants to merge 2 commits intomainfrom
fix-updatev1objects

Conversation

@YoukaiFromAccounting
Copy link

This PR is a continuation of: satijalab/seurat#10265

Currently, attempting to perform Spatial plotting using VisiumV1 objects on Seurat versions 5.4.0+ and SeuratObject versions 5.3.0+ result in the following errors:

Error in SpatialPlot(object) : 
  Please run `UpdateSeuratObject` on your Seurat object first to ensure that data aligns to the image slice1 when plotting.

Error updating objects in boundaries in FOV ‘slice1’
Message: ‘coords_x_orientation’ is not a slot in class “VisiumV1”
Class: simpleError, error, condition
Call: checkSlotAssignment(object, name, value)

Running UpdateSeuratObject on the V1 object does not resolve this issue. This is because with current UpdateSpatialPlot logic, the coords_x_orientation slot for an object's image will only be updated if that image inherits from the FOV class. While VisiumV2 objects inherit from FOV, VisiumV1 objects do not, merely inheriting from SpatialImage. This means that with existing logic, VisiumV1 objects will never be updated to have the coords_x_orientation slot:

# From SeuratObject::UpdateSeuratObject
message("Updating slots in ", x)
        xobj <- object[[x]]
        if (inherits(x = xobj, what = 'FOV')) {

To address this, changes in both Seurat and SeuratObject are required. On the SeuratObject side, UpdateSeuratObject should be mended to update coords_x_orientation for both FOV-type objects (VisiumV2) and VisiumV1 class objects. Additionally, the boundaries slot of the object should only be updated for VisiumV2+.

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