Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nest fails in some cases #28

Open
stemangiola opened this issue Apr 11, 2024 · 0 comments
Open

nest fails in some cases #28

stemangiola opened this issue Apr 11, 2024 · 0 comments

Comments

@stemangiola
Copy link
Collaborator

library(SpatialExperiment)
library(STexampleData)
library(ggspavis)
library(scuttle)
library(scater)
library(scran)
library(here)

# From https://bioconductor.org/packages/devel/bioc/vignettes/Banksy/inst/doc/multi-sample.html
library(spatialLIBD)
library(ExperimentHub)

spatial_data <- 
  ExperimentHub::ExperimentHub() |> 
  spatialLIBD::fetch_data( eh = _, type = "spe")

# Select only 4 samples
spatial_data = spatial_data[,spatial_data$sample_id %in% c("151673", "151675", "151676")]

# # Loading example data (assuming example data is provided in the workshop)
# # Replace 'example_data' with the actual data file name
# spatial_data <- Visium_humanDLPFC()

# Display the object
spatial_data
spatial_data |> 
  nest(sample_data = sample_id)
Error in `mutate()`:In argument: `sample_data = map(sample_data, ~pull(.x, index))`.
Caused by error in `map()`:In index: 1.
Caused by error in `pull()`:
! `!!enquo(var)` must select exactly one column.
Backtrace:
1. tidyr::nest(spatial_data, sample_data = sample_id)
13. purrr::map(sample_data, ~pull(.x, index))
14. purrr:::map_("list", .x, .f, ..., .progress = .progress)
18. tidySpatialExperiment (local) .f(.x[[i]], ...)
20. dplyr:::pull.data.frame(.x, index)
Error in mutate(tidyr::nest(rowid_to_column(as_tibble(my_data__), "index"),  : 

Caused by error in `map()`:In index: 1.
Caused by error in `pull()`:
! `!!enquo(var)` must select exactly one column.
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

No branches or pull requests

1 participant