Skip to content

Uncover spatially informed variations underlying single-cell spatial transcriptomics with STew.

License

Notifications You must be signed in to change notification settings

fanzhanglab/STew

Repository files navigation

STew

R-CMD-check Visitors

We introduce STew, a Spatial Transcriptomic multi-viEW representation learning method, or STew, to jointly characterize the gene expression variation and spatial information in the shared low-dimenion space in a scalable manner. STew will output distinct spatially informed cell gradients, robust clusters, and statistical goodness of model fit to reveal significant genes that reflect subtle spatial niches in complex tissues.


Installation

You can install the STew Package from GitHub using the devtools as follows:

# install.packages("devtools")
devtools::install_github("fanzhanglab/STew")

(OR)

remotes::install_github("fanzhanglab/STew")

Dependencies / Other required packages

  • R (>= 4.2)
  • MERINGUE (>= 1.0)
  • Matrix (>= 1.5.4)
  • ggplot2 (>= 3.4.2)
  • ggpubr (>= 0.6.0)
  • Seurat (>= 4.3.0)
  • future.apply (>= 1.10.0)
  • RANN (>= 2.6.1)
  • sctransform
  • tibble

Tutorials

Step-by-step notebook of applying STew on identifying spatially informed low-dimensional embeddings and spatially aware clusters on the 10X Visium Human Brain Data (DLPFC):


Below are several major steps of running STew:

# Create a new STew object for the loaded spatial transcriptomic data
STew = STew_Obj(count = dlpfc$count_exp,
                  spatial = dlpfc$spatial)

… (skip several preprocessing steps) …

# permute optimal penalty parameters
STew <- parallel_cca_permute(x = STew$exp_adj_matrix, z = STew$adj_matrix, obj = STew, nperms=50, niter=3)
# Perform sparse CCA based on the optimal penalty parameters
STew <- cca_main(x = STew$exp_adj_matrix, z = STew$adj_matrix, obj = STew, K=20, penaltyx=STew$bestpenaltyx, penaltyz=STew$bestpenaltyz, v=STew$v.init)
gradient_plot <- spatial_gradient(STew)
gradient_plot[1:5]


cluster_plot <- plot_cluster(coordis = spatial, label = cluster$res_0.30, colors = colors, t="Cell clusters based on STew")
cluster_plot


# Save the main results into the STew object
saveRDS(STew, file="STew_10x_human_dlpfc_no.rds")

Benchmarcking STew with other algorithms:


Citations

Guo, N., Vargas, J., Reynoso, S., Fritz, D., Krishna, R., Wang, C., Zhang, F., Uncover spatially informed variations for single-cell spatial transcriptomics with STew, Bioinformatics Advances, https://doi.org/10.1093/bioadv/vbae064, 2024


Help, Suggestion and Contribution

Using github issues section, if you have any question, comments, suggestions, or to report coding related issues of STew is highly encouranged than sending emails.

  • Please check the GitHub issues for similar issues that has been reported and resolved. This helps the team to focus on adding new features and working on cool projects instead of resolving the same issues!
  • Examples are required when filing a GitHub issue. In certain cases, please share your STew object and related codes to understand the issues.

Contact

Please contact [email protected] for further questions or protential collaborative opportunities!

About

Uncover spatially informed variations underlying single-cell spatial transcriptomics with STew.

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •