Chapter 13 DEG Per Cluster

library(Seurat)
library(tidyverse)
library(magrittr)

13.1 Load seurat object

combined <- readRDS('data/Demo_CombinedSeurat_SCT_Preprocess_FilterLQCells.rds')

13.2 Identify DEG

  • For one cluster
Idents(combined) <- 'cluster'

mk <- FindMarkers(combined, ident.1 = 'RG', min.pct = 0.3, min.diff.pct = 0.2, only.pos = T)
mk[1:3,]
##                            p_val avg_logFC pct.1 pct.2     p_val_adj
## MLC1               8.099982e-124 0.5320391 0.523 0.019 1.432077e-119
## ACSBG1             3.730240e-117 0.6486125 0.376 0.005 6.595065e-113
## ENSMMUG00000061028 1.534215e-114 1.2136130 0.633 0.043 2.712491e-110
mk <- FindMarkers(combined, ident.1 = 'IP', ident.2 = 'OPC', min.pct = 0.3, min.diff.pct = 0.2)
mk[1:3, ]
##                p_val avg_logFC pct.1 pct.2    p_val_adj
## LHFPL3  1.247352e-17 -3.065501 0.129 0.909 2.205318e-13
## MEIS2   4.538099e-16  1.675128 0.984 0.705 8.023358e-12
## GRAMD1B 8.748577e-16  1.715042 0.919 0.114 1.546748e-11
  • For all clusters
mk <- FindAllMarkers(combined, min.pct = 0.3, min.diff.pct = 0.2, only.pos = T)
## Calculating cluster RG
## Calculating cluster Cycling
## Calculating cluster OPC
## Calculating cluster IP
## Calculating cluster ExN
## Calculating cluster ExM
## Calculating cluster ExU
## Calculating cluster ExDp
## Calculating cluster InMGE
## Calculating cluster InCGE
## Calculating cluster InPSB
## Calculating cluster Mic
## Calculating cluster Per
## Calculating cluster End
mk[1:3, ]
##                            p_val avg_logFC pct.1 pct.2     p_val_adj cluster
## MLC1               8.099982e-124 0.5320391 0.523 0.019 1.432077e-119      RG
## ACSBG1             3.730240e-117 0.6486125 0.376 0.005 6.595065e-113      RG
## ENSMMUG00000061028 1.534215e-114 1.2136130 0.633 0.043 2.712491e-110      RG
##                                  gene
## MLC1                             MLC1
## ACSBG1                         ACSBG1
## ENSMMUG00000061028 ENSMMUG00000061028
saveRDS(mk, file = 'data/Demo_CombinedSeurat_SCT_Preprocess_FilterLQCells_DEGPerCluster_Minpct03Mindiffpct02.rds')