diff --git a/vignettes/01 NICHES Spatial.Rmd b/vignettes/01 NICHES Spatial.Rmd index 6568ce7..0ecaede 100644 --- a/vignettes/01 NICHES Spatial.Rmd +++ b/vignettes/01 NICHES Spatial.Rmd @@ -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")) @@ -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) diff --git a/vignettes/02 NICHES Single.Rmd b/vignettes/02 NICHES Single.Rmd index 63893b4..34c5159 100644 --- a/vignettes/02 NICHES Single.Rmd +++ b/vignettes/02 NICHES Single.Rmd @@ -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) @@ -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 @@ -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)