diff --git a/DESCRIPTION b/DESCRIPTION index 7c02eb4..e8d8d36 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: SEraster Type: Package Title: Rasterization Preprocessing Framework for Scalable Spatial Omics Data Analysis -Version: 0.99.1 +Version: 0.99.2 Authors@R: c(person("Gohta", "Aihara", email = "gaihara1@jh.edu", role = c("aut", "cre"), @@ -41,12 +41,16 @@ Suggests: nnSVG, testthat (>= 3.0.0), knitr, - rmarkdown + rmarkdown, + BiocManager, + MERINGUE, + remotes, + reshape2 VignetteBuilder: knitr Config/testthat/edition: 3 -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Depends: - R (>= 4.3.0) + R (>= 4.4.0) Imports: BiocParallel, ggplot2, diff --git a/README.md b/README.md index 99e5791..076f3e5 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,25 @@ require(remotes) remotes::install_github('JEFworks-Lab/SEraster') ``` +To install this package using Bioconductor, start R (version "4.4.0") and enter: +``` r +if (!require("BiocManager", quietly = TRUE)) + install.packages("BiocManager") + +BiocManager::install("SEraster") +``` + ## Tutorials Introduction: - [Formatting a SpatialExperiment Object for SEraster](https://jef.works/SEraster/articles/formatting-SpatialExperiment-for-SEraster.html) - [Getting Started With SEraster](https://jef.works/SEraster/articles/getting-started-with-SEraster.html) +- [SEraster for Spatial Variable Genes Analysis](https://jef.works/SEraster/articles/SEraster-for-SVG-analysis.html) +- [Characterizing mPOA cell-type heterogeneity with spatial bootstrapping](https://jef.works/SEraster/articles/characterizing-mPOA-cell-type-heterogeneity.html) ## Citation -Our preprint describing `SEraster` is available on *bioRxiv*: +Our manuscript describing `SEraster` is available on *Bioinformatics*: -[Aihara G. et al. (2024), "SEraster: a rasterization preprocessing framework for scalable spatial omics data analysis", *bioRxiv*](https://doi.org/10.1101/2024.02.01.578436) \ No newline at end of file +[Gohta Aihara, Kalen Clifton, Mayling Chen, Zhuoyan Li, Lyla Atta, Brendan F Miller, Rahul Satija, John W Hickey, Jean Fan, SEraster: a rasterization preprocessing framework for scalable spatial omics data analysis, Bioinformatics, Volume 40, Issue 7, July 2024, btae412, https://doi.org/10.1093/bioinformatics/btae412](https://academic.oup.com/bioinformatics/article/40/7/btae412/7696710) \ No newline at end of file diff --git a/_pkgdown.yml b/_pkgdown.yml index ab56c47..21059bf 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -10,11 +10,14 @@ navbar: href: articles/install.html - text: "Tutorials" menu: - - text: "Introduction" - text: "Formatting a SpatialExperiment Object for SEraster" href: articles/formatting-SpatialExperiment-for-SEraster.html - text: "Getting Started With SEraster" href: articles/getting-started-with-SEraster.html + - text: "SEraster for Spatial Variable Genes Analysis" + href: articles/SEraster-for-SVG-analysis.html + - text: "Characterizing mPOA cell-type heterogeneity with spatial bootstrapping" + href: articles/characterizing-mPOA-cell-type-heterogeneity.html - text: "Functions" href: reference/index.html - text: "Changelog" diff --git a/data-raw/merfish_mousePOA.R b/data-raw/merfish_mousePOA.R deleted file mode 100644 index 1a5f1c5..0000000 --- a/data-raw/merfish_mousePOA.R +++ /dev/null @@ -1,85 +0,0 @@ -## Prepares data/merfish_mousePOA.rda -## format the MERFISH mouse POA dataset into a SpatialExperiment object for the package - -library(SpatialExperiment) -library(Matrix) -library(ggplot2) -library(gridExtra) - -data <- read.csv('~/Downloads/Moffitt_and_Bambah-Mukku_et_al_merfish_all_cells.csv') - -animal <- 1 -sex <- "Female" -behavior <- "Naive" -bregma <- "-0.29" -data_sub <- data[(data$Animal_ID == animal & data$Animal_sex == sex & data$Behavior == behavior & data$Bregma == bregma),] -dim(data_sub) - -## save subsetted data for vignettes -saveRDS(data_sub, file = "vignettes/merfish_mousePOA_raw.RDS") - -## genes-by-cells matrix -# extract the genes-by-cells matrix as a sparse matrix (dgCMatrix) -mat <- as(t(data_sub[,10:ncol(data_sub)]), "CsparseMatrix") - -# remove blank genes used for quality control -blanks <- rownames(mat)[grepl("Blank", rownames(mat))] -mat <- mat[setdiff(rownames(mat),blanks),] - -## spatial coordinates matrix -# extract the spatial coordinates -pos <- data_sub[,c("Centroid_X", "Centroid_Y")] -colnames(pos) <- c("x","y") - -# make x,y coordinates positive -pos[,1] <- pos[,1] - min(pos[,1]) -pos[,2] <- pos[,2] - min(pos[,2]) - -## cell-type labels -# extract the data frame with cell-type labels -meta <- data_sub[,c("Bregma", "Cell_class", "Neuron_cluster_ID")] -colnames(meta) <- c("bregma", "celltype", "neurontype") - -## standardize cell IDs for the extracted objects -colnames(mat) <- rownames(pos) <- rownames(meta) <- data_sub$Cell_ID - -## filter genes with NaN values -bad_genes <- names(which(rowSums(is.nan(mat)) > 0)) -mat <- mat[setdiff(rownames(mat),bad_genes),] - -## filter cells with NaN values -bad_cells <- names(which(colSums(is.nan(mat)) > 0)) -mat <- mat[,setdiff(colnames(mat),bad_cells)] -pos <- pos[setdiff(rownames(pos),bad_cells),] -meta <- meta[setdiff(rownames(pos),bad_cells),] - -df_plt <- data.frame(pos, total_gexp = colSums(mat)) - -ggplot(df_plt, aes(x = x, y = y, color = total_gexp)) + - coord_fixed() + - geom_point(size = 1, stroke = 0) + - scale_color_viridis_c(name = "total gene expression") + - theme_bw() + - theme(panel.grid = element_blank(), - axis.title = element_blank(), - axis.text = element_blank(), - axis.ticks = element_blank()) - -df_plt <- data.frame(pos, celltype = meta$celltype) - -ggplot(df_plt, aes(x = x, y = y, color = celltype)) + - coord_fixed() + - geom_point(size = 1, stroke = 0) + - theme_bw() + - theme(panel.grid = element_blank(), - axis.title = element_blank(), - axis.text = element_blank(), - axis.ticks = element_blank()) - -merfish_mousePOA <- SpatialExperiment::SpatialExperiment( - assays = list(volnorm = mat), - spatialCoords = as.matrix(pos), - colData = meta -) - -usethis::use_data(merfish_mousePOA, overwrite = TRUE) diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/.nojekyll @@ -0,0 +1 @@ + diff --git a/docs/404.html b/docs/404.html index 8b7f1f0..2bcb740 100644 --- a/docs/404.html +++ b/docs/404.html @@ -8,70 +8,56 @@ Page not found (404) • SEraster - - - - + + + Skip to contents - -