Closed lahuuki closed 1 month ago
Thanks for the report @lahuuki!
Here's how things behave now in spatialLIBD
version 1.17.6. See https://github.com/LieberInstitute/spatialLIBD/commit/08c2b2d80a29b1decee578d01f7230b595a9bf5a for more details on the internal changes to sort_clusters()
and get_colors()
.
Best, Leo
suppressPackageStartupMessages(library("spatialLIBD"))
spe <- fetch_data("spatialDLPFC_Visium_example_subset")
#> 2024-07-12 10:58:34.14279 loading file /Users/leocollado/Library/Caches/org.R-project.R/R/BiocFileCache/6f563a40ecf7_spatialDLPFC_spe_subset_example.rds%3Fdl%3D1
spe$BayesSpace_harmony_02_lgl <- spe$BayesSpace_harmony_02 ==1
set.seed(20240712)
spe$BayesSpace_harmony_02_lgl[sample(seq_len(ncol(spe)), 2000)] <- NA
vis_grid_clus(
spe = spe,
clustervar = "BayesSpace_harmony_02_lgl",
return_plots = TRUE,
sort_clust = FALSE,
point_size = 2
)
#> $Br6432_ant
#>
#> $Br6522_ant
#>
#> $Br8667_mid
vis_grid_clus(
spe = spe,
clustervar = "BayesSpace_harmony_02_lgl",
return_plots = TRUE,
sort_clust = TRUE,
point_size = 2
)
#> $Br6432_ant
#>
#> $Br6522_ant
#>
#> $Br8667_mid
vis_clus(
sampleid = "Br6432_ant",
spe = spe,
clustervar = "BayesSpace_harmony_02_lgl",
point_size = 2
)
packageVersion("spatialLIBD")
#> [1] '1.17.6'
Created on 2024-07-12 with reprex v2.1.0
I noticed some strange behavior in
vis_grid_clus()
when trying to plot logical variables such asin_tissue
, the same variables plot as expected invis_clus()
. Converting the lgl to factor does not fix this.Example in
spatialDLPFC_Visium_example_subset
Doesn't work with logical data
Note.
spatialLIBD
is a recent github versionAdditional Context
I found this bug plotting data from the LFF_spatial_ERC project: more examples of this issue
Is the package installed via bioconda? No