I have scRNAseq
data and I am trying to do differential comparing 2 conditions (for each condition I have 3 samples). to do so I am using Seurat R package and to integrate the samples I used the following code. the part1 has code only for 1 sample (for other 5 samples I did the same) but the part2 is complete
part1:
med1 <- Read10X("AM-g001-raw-feature-bc-matrix")
med1 <- CreateSeuratObject(counts = med1, project = "med", min.cells = 3, min.features = 200)
med1 <- PercentageFeatureSet(med1, pattern = "^MT-", col.name = "percent.mt")
med1 <- subset((med1, subset = nFeature_RNA < 4000 & nCount_RNA < 20000 & pecent.mt < 10 )
part2:
med_isa.list <- list(med1 = med1, med2 = med2, med3 = med3, iSA1 = iSA1, iSA2 = iSA2, iSA3 = iSA3)
med_isa.list <- lapply(x = med_isa.list, FUN = function(x) {
x <- NormalizeData(x)
x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000)
})
features <- SelectIntegrationFeatures(object.list = med_isa.list)
med_isa.anchores <- FindIntegrationAnchors(object.list = med_isa.list, anchor.features = features)
med_isa.combined <- IntegrateData(anchorset = med_isa.anchores)
DefaultAssay(med_isa.combined) <- "integrated"
med_isa.combined <- ScaleData(med_isa.combined, verbose = FALSE)
med_isa.combined <- RunPCA(med_isa.combined, npcs = 50, verbose = FALSE)
med_isa.combined <- RunUMAP(med_isa.combined, reduction = "pca", dims = 1:30)
med_isa.combined <- FindNeighbors(med_isa.combined, reduction = "pca", dims = 1:30)
med_isa.combined <- FindClusters(med_isa.combined, resolution = 0.6)
saveRDS(med_isa.combined, file="med_isa.combined.rds")
when I look at med_isa.combined
I would expect to see samples IDs as well but it does not exist. I only see the following items:
orig.ident
: which is either med or isaseurat_clusters
nCount_RNA
nFeature_RNA
percent.mt
How can I add another item to med_isa.combined
which shows the sample IDs?