Skip to content

Commit

Permalink
ReadME Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
reyvnth committed Sep 8, 2023
1 parent c82c84e commit 6332953
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# STew <img width="43%" align = "right" src="https://github.com/fanzhanglab/STew/blob/main/STew_logo.png">
# STew <img width="43%" align = "right" src="https://github.com/fanzhanglab/STew/blob/main/STewlogo.png">

[![R-CMD-check](https://github.com/fanzhanglab/STew/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/fanzhanglab/STew/actions/workflows/check-standard.yaml)
![](https://komarev.com/ghpvc/?username=fanzhanglab&style=flat-square&color=green)
Expand Down
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# stCCA <img width="43%" align = "right" src="https://github.com/fanzhanglab/stCCA/blob/main/stCCA_logo.png">
# STew <img width="43%" align = "right" src="https://github.com/fanzhanglab/STew/blob/main/STewlogo.png">

[![R-CMD-check](https://github.com/fanzhanglab/stCCA/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/fanzhanglab/stCCA/actions/workflows/check-standard.yaml)
[![R-CMD-check](https://github.com/fanzhanglab/STew/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/fanzhanglab/STew/actions/workflows/check-standard.yaml)
![](https://komarev.com/ghpvc/?username=fanzhanglab&style=flat-square&color=green)

<!-- badges: start -->
<!-- badges: end -->
<p align="justify">
We introduce stCCA, a multi-view representation learning method for
We introduce STew, a multi-view representation learning method for
spatial transcriptomic data, to jointly characterize the gene expression
variation and spatial information in the shared low-dimenion space in a
scalable manner. stCCA will output distinct spatially informed cell
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.
</p>

<img width="100%" align = "center" src="https://github.com/fanzhanglab/stCCA/blob/main/man/figures/Figure1.png">
<img width="100%" align = "center" src="https://github.com/fanzhanglab/STew/blob/main/man/figures/Figure1.png">

</br>

## Installation

You can install the stCCA Package from
[GitHub](https://github.com/fanzhanglab/stCCA/) using the devtools as
You can install the STew Package from
[GitHub](https://github.com/fanzhanglab/STew/) using the devtools as
follows:

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

(OR)

``` r
remotes::install_github("fanzhanglab/stCCA")
remotes::install_github("fanzhanglab/STew")
```

<br/>
Expand All @@ -59,90 +59,89 @@ remotes::install_github("fanzhanglab/stCCA")

## Tutorials

**Step-by-step notebook** of applying stCCA on identifying spatially
**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):

- <a href="https://htmlpreview.github.io/?https://github.com/fanzhanglab/stCCA/blob/main/vignettes/Tutorial_stCCA_DLPFC.html">
Tutorial of applying stCCA on DLPFC data </a>
- <a href = 'https://htmlpreview.github.io/?https://github.com/fanzhanglab/stCCA/blob/main/vignettes/count_modeling_tutorial_dlfcp.nb.html'>
- <a href="https://htmlpreview.github.io/?https://github.com/fanzhanglab/STew/blob/main/vignettes/Tutorial_STew_DLPFC.html">
Tutorial of applying STew on DLPFC data </a>
- <a href = 'https://htmlpreview.github.io/?https://github.com/fanzhanglab/STew/blob/main/vignettes/count_modeling_tutorial_dlfcp.nb.html'>
Tutorial of count data modelling </a>

<br/>

#### Below are several major steps of running stCCA:
#### Below are several major steps of running STew:

``` r
# Create a new stCCA object for the loaded spatial transcriptomic data
stCCA = stCCA_Obj(count = dlpfc$count_exp,
# 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) …

``` r
# permute optimal penalty parameters
stCCA <- parallel_cca_permute(x = stCCA$exp_adj_matrix, z = stCCA$adj_matrix, obj = stCCA, nperms=50, niter=3)
STew <- parallel_cca_permute(x = STew$exp_adj_matrix, z = STew$adj_matrix, obj = STew, nperms=50, niter=3)
```

``` r
# Perform sparse CCA based on the optimal penalty parameters
stCCA <- cca_main(x = stCCA$exp_adj_matrix, z = stCCA$adj_matrix, obj = stCCA, K=20, penaltyx=stCCA$bestpenaltyx, penaltyz=stCCA$bestpenaltyz, v=stcc$v.init)
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)
```

``` r
gradient_plot <- spatial_gradient(stCCA)
gradient_plot <- spatial_gradient(STew)
gradient_plot[1:5]
```

<img width="85%" align = "center" src="https://github.com/fanzhanglab/stCCA/blob/main/man/figures/cca_vis.png">
<img width="85%" align = "center" src="https://github.com/fanzhanglab/STew/blob/main/man/figures/cca_vis.png">

<br/>

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

<img width="25%" align = "center" src="https://github.com/fanzhanglab/stCCA/blob/main/man/figures/README-unnamed-chunk-14-1.png">
<img width="25%" align = "center" src="https://github.com/fanzhanglab/STew/blob/main/man/figures/README-unnamed-chunk-14-1.png">

<br/>

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

<br/>

#### Benchmarcking stCCA with other algorithms:
#### Benchmarcking STew with other algorithms:

<img width="85%" align = "center" src="https://github.com/fanzhanglab/stCCA/blob/main/man/figures/ARI_DLPFC.png">
<img width="85%" align = "center" src="https://github.com/fanzhanglab/STew/blob/main/man/figures/ARI_DLPFC.png">

<br/>

## Citations

Guo, N., Vargas, J., Fritz, D., Krishna, R., Zhang, F. Uncover spatially
informed shared variations underlying single-cell spatial
transcriptomics with stCCA, [*bioRxiv*](link), 2023
transcriptomics with STew, [*bioRxiv*](link), 2023

<br/>

## Help, Suggestion and Contribution

Using github [**issues**](https://github.com/fanzhanglab/stCCA/issues)
Using github [**issues**](https://github.com/fanzhanglab/STew/issues)
section, if you have any question, comments, suggestions, or to report
coding related issues of stCCA is highly encouranged than sending
emails.
coding related issues of STew is highly encouranged than sending emails.

- Please **check the GitHub
[issues](https://github.com/fanzhanglab/stCCA/issues)** for similar
[issues](https://github.com/fanzhanglab/STew/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 stCCA object and related codes to understand
cases, please share your STew object and related codes to understand
the issues.

<br/>
Expand Down

0 comments on commit 6332953

Please sign in to comment.