I'm so sorry to make troubles because I have no idea to solve the little bug.
I'm learing the spatial registraion when I'm following the _Guide to Spatial Registration_. I just copy and run the codes from the guide. However, when it turns to the function registration_wrapper(), I meet an error. Here is the code.
library("spatialLIBD")
library("SingleCellExperiment")
## get reference layer enrichment statistics
layer_modeling_results <- fetch_data(type = "modeling_results")
# Download and save a local cache of the data available at:
# https://github.com/LieberInstitute/10xPilot_snRNAseq-human#processed-data
bfc <- BiocFileCache::BiocFileCache()
url <- paste0(
"https://libd-snrnaseq-pilot.s3.us-east-2.amazonaws.com/",
"SCE_DLPFC-n3_tran-etal.rda"
)
local_data <- BiocFileCache::bfcrpath(url, x = bfc)
load(local_data, verbose = TRUE)
## Perform the spatial registration
sce_modeling_results <- registration_wrapper(
sce = sce.dlpfc.tran,
var_registration = "cellType",
var_sample_id = "donor",
gene_ensembl = "gene_id",
gene_name = "gene_name"
)
It's the same with the guide.
And here is the error.
2023-10-26 21:23:51 make pseudobulk object
2023-10-26 21:23:55 dropping 13 pseudo-bulked samples that are below 'min_ncells'.
2023-10-26 21:23:55 drop lowly expressed genes
2023-10-26 21:23:55 normalize expression
2023-10-26 21:23:56 create model matrix
Error: The resulting model is not full rank. You might have some 'var_registration' levels that are empty which you can drop with 'droplevels()'. Check the output of 'table(sce_pseudo[[var_registration]])'.
Expected behavior
## Perform the spatial registration
sce_modeling_results <- registration_wrapper(
sce = sce.dlpfc.tran,
var_registration = "cellType",
var_sample_id = "donor",
gene_ensembl = "gene_id",
gene_name = "gene_name"
)
#> 2023-09-05 20:41:51.590053 make pseudobulk object
#> 2023-09-05 20:41:54.461424 dropping 13 pseudo-bulked samples that are below 'min_ncells'.
#> 2023-09-05 20:41:54.569132 drop lowly expressed genes
#> 2023-09-05 20:41:54.90711 normalize expression
#> 2023-09-05 20:41:55.922038 create model matrix
#> 2023-09-05 20:41:55.972502 run duplicateCorrelation()
#> 2023-09-05 20:42:32.153248 The estimated correlation is: 0.138734774807097
#> 2023-09-05 20:42:32.157722 computing enrichment statistics
#> 2023-09-05 20:42:34.301225 extract and reformat enrichment results
#> 2023-09-05 20:42:34.464852 running the baseline pairwise model
#> 2023-09-05 20:42:34.695452 computing pairwise statistics
#> 2023-09-05 20:42:37.152251 computing F-statistics
R Session Information
Please report the output of either sessionInfo() or
sessioninfo::session_info() here.
I'm so sorry to make troubles because I have no idea to solve the little bug. I'm learing the spatial registraion when I'm following the _Guide to Spatial Registration_. I just copy and run the codes from the guide. However, when it turns to the function
registration_wrapper()
, I meet an error. Here is the code.It's the same with the guide. And here is the error.
Expected behavior
R Session Information
Please report the output of either
sessionInfo()
orsessioninfo::session_info()
here.