SeuratData::InstallData("pbmc3k")
## Warning: The following packages are already installed and will not be
## reinstalled: pbmc3k
library(Seurat)
library(SeuratData)
## ── Installed datasets ──────────────────────────────── SeuratData v0.2.2.9001 ──
## ✔ cbmc 3.1.4 ✔ pbmc3k 3.1.4
## ────────────────────────────────────── Key ─────────────────────────────────────
## ✔ Dataset loaded successfully
## ❯ Dataset built with a newer version of Seurat than installed
## ❓ Unknown version of Seurat installed
library(ggplot2)
library(ggridges)
library(patchwork)
pbmc3k.final <- LoadData("pbmc3k", type = "pbmc3k.final")
## Validating object structure
## Updating object slots
## Ensuring keys are in the proper structure
## Updating matrix keys for DimReduc 'pca'
## Updating matrix keys for DimReduc 'umap'
## Warning: Assay RNA changing from Assay to Assay
## Warning: Graph RNA_nn changing from Graph to Graph
## Warning: Graph RNA_snn changing from Graph to Graph
## Warning: DimReduc pca changing from DimReduc to DimReduc
## Warning: DimReduc umap changing from DimReduc to DimReduc
## Ensuring keys are in the proper structure
## Ensuring feature names don't have underscores or pipes
## Updating slots in RNA
## Updating slots in RNA_nn
## Setting default assay of RNA_nn to RNA
## Updating slots in RNA_snn
## Setting default assay of RNA_snn to RNA
## Updating slots in pca
## Updating slots in umap
## Setting umap DimReduc to global
## Setting assay used for NormalizeData.RNA to RNA
## Setting assay used for FindVariableFeatures.RNA to RNA
## Setting assay used for ScaleData.RNA to RNA
## Setting assay used for RunPCA.RNA to RNA
## Setting assay used for JackStraw.RNA.pca to RNA
## No assay information could be found for ScoreJackStraw
## Warning: Adding a command log without an assay associated with it
## Setting assay used for FindNeighbors.RNA.pca to RNA
## No assay information could be found for FindClusters
## Warning: Adding a command log without an assay associated with it
## Setting assay used for RunUMAP.RNA.pca to RNA
## Validating object structure for Assay 'RNA'
## Validating object structure for Graph 'RNA_nn'
## Validating object structure for Graph 'RNA_snn'
## Validating object structure for DimReduc 'pca'
## Validating object structure for DimReduc 'umap'
## Object representation is consistent with the most current Seurat version
## Warning: Assay RNA changing from Assay to Assay5
pbmc3k.final$groups <- sample(c("group1", "group2"), size = ncol(pbmc3k.final), replace = TRUE)
features <- c("LYZ", "CCL5", "IL32", "PTPRCAP", "FCGR3A", "PF4")
pbmc3k.final
## An object of class Seurat
## 13714 features across 2638 samples within 1 assay
## Active assay: RNA (13714 features, 2000 variable features)
## 3 layers present: data, counts, scale.data
## 2 dimensional reductions calculated: pca, umap