LieberInstitute / spatialLIBD

Code for the spatialLIBD R/Bioconductor package and shiny app
http://LieberInstitute.github.io/spatialLIBD/
80 stars 16 forks source link

SpatialExperiment::spatialData(as_df=TRUE) now returns a DFrame not a data.frame #10

Closed jvelezmagic closed 3 years ago

jvelezmagic commented 3 years ago

Hey, Leo! c:

In the last days the SpatialExperiment package made changes to SpatialExperiment::spatialData(), in which they no longer return a data.frame but a DFrame when function is call with as_df=TRUE (https://github.com/drighelli/SpatialExperiment/commit/bf2abe9d663c5f490705f3f5ff312af71ec1ce18). Therefore, the functions for plots are not working. Plotting calls produce the following error:

Wrapping the calls SpatialExperiment::spatialData(spe_sub, cd_bind = TRUE, as_df = TRUE) with as.data.frame should fix the issue for now.

Defining a utility function to use in all those calls might also work:

function(spe){
    as.data.frame(
        SpatialExperiment::spatialData(spe, cd_bind = TRUE, as_df = TRUE)
    )
}