Skip to content

Commit

Permalink
updated vignettes based on Seurat V5
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchen Yang committed Mar 3, 2024
1 parent 2266c0e commit 858c90d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vignettes/01 NICHES Spatial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Next, we load the data, perform basic pre-processing, and cluster the data so th
```{r message=F, warning=F}
InstallData("stxBrain")
brain <- LoadData("stxBrain", type = "anterior1")
brain <- UpdateSeuratObject(brain) # JC: need to update seurat obj
# Normalization
brain <- SCTransform(brain, assay = "Spatial", verbose = FALSE)
SpatialFeaturePlot(brain, features = c("Hpca", "Ttr"))
Expand Down Expand Up @@ -89,7 +90,7 @@ NICHES outputs a list of objects. Each object contains a certain style of cell-s

```{r message=F, warning=F}
niche <- NICHES_output[['NeighborhoodToCell']]
Idents(niche) <- niche[['ReceivingType']]
Idents(niche) <- niche@meta.data$ReceivingType
# Scale and visualize
niche <- ScaleData(niche)
Expand Down
7 changes: 6 additions & 1 deletion vignettes/02 NICHES Single.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Here, we use the 'pbmc3k' dataset from SeuratData. This is a commonly-used datas
```{r message=F, warning=F}
InstallData("pbmc3k")
data("pbmc3k")
pbmc3k <- UpdateSeuratObject(pbmc3k) # JC: need to update pbmc3k
Idents(pbmc3k) <- pbmc3k$seurat_annotations
pbmc3k <- NormalizeData(pbmc3k) # JC: to be added
pbmc3k <- ScaleData(pbmc3k)
pbmc3k <- FindVariableFeatures(pbmc3k)
pbmc3k <- RunPCA(pbmc3k)
Expand All @@ -58,7 +60,9 @@ scc <- RunNICHES(sub,
species = 'human',
LR.database = 'omnipath',
cell_types = 'seurat_annotations',
CellToCell = T)
CellToCell = T,
SystemToCell = T
)
```

## Visualize Cell-Cell Signaling Relationships using UMAP
Expand Down Expand Up @@ -86,6 +90,7 @@ scc.imputed <- RunNICHES(imputed,
cell_types = 'seurat_annotations',
CellToCell = T)
demo.2 <- scc.imputed$CellToCell
demo.2 <- ScaleData(demo.2)
demo.2 <- RunPCA(demo.2,features = rownames(demo.2))
ElbowPlot(demo.2,ndims=50)
Expand Down

0 comments on commit 858c90d

Please sign in to comment.