EDePasquale / DoubletDecon

A tool for removing doublets from single-cell RNA-seq data
69 stars 19 forks source link

Improved_Seurat_Pre_Process: undefined columns selected #18

Open Tushar-87 opened 4 years ago

Tushar-87 commented 4 years ago

Hello, I ran following code `> wt1cx <- CreateSeuratObject(counts = wt1cx, project = "wt1cx", min.cells = 3, min.features = 200)

wt1cx[["percent.mt"]] <- PercentageFeatureSet(wt1cx, pattern = "mt-") wt1cx <- subset(wt1cx, subset = nFeature_RNA > 500 & nFeature_RNA < 5000 & percent.mt < 10) wt1cx <- NormalizeData(wt1cx) wt1cx <- FindVariableFeatures(wt1cx, selection.method = "vst", nfeatures = 5000) wt1cx.allgenes <- rownames(wt1cx) wt1cx <- ScaleData(wt1cx, features = wt1cx.allgenes) wt1cx <- RunPCA(wt1cx, features = VariableFeatures(object = wt1cx), verbose = FALSE) wt1cx <- FindNeighbors(wt1cx, dims = 1:15) wt1cx <- FindClusters(wt1cx, resolution = 0.1) library(DoubletDecon) Improved_Seurat_Pre_Process(wt1cx, num_genes=50, write_files=FALSE) Calculating cluster 0 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=48s
Calculating cluster 1 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 06s Calculating cluster 2 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=14s
Calculating cluster 3 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=43s
Calculating cluster 4 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=28s
Calculating cluster 5 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=30s
Calculating cluster 6 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s
Calculating cluster 7 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 07s Calculating cluster 8 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 13s Calculating cluster 9 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 36s Calculating cluster 10 |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 52s Warning: The following arguments are not used: thresh.use |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=08s
Error in [.data.frame(expression, row.names(clusters2)) : undefined columns selected`

I am getting this error. How can I resolve it? @EDePasquale

MichaelZH24 commented 4 years ago

I get same error. I searched and checked the file 'Improved_Seurat_Pre_Process.R'. I find there is a bug. You can replace this command clusters[,1]=gsub("-",".",clusters[,1]) with row.names(clusters)=gsub("-",".",row.names(clusters)) in 'Improved_Seurat_Pre_Process.R'. Then it will be fine.

EDePasquale commented 4 years ago

Thank you for following up on this MichaelZH24. I'll definitely look into that part of the code and figure out where I can make corrections. If I'm remembering correctly I have made the edit you suggested before and it caused errors for a different subset of users. I'm thinking it may have to do with Seurat versioning but I'm not 100% sure. When I find out a solution, though, I'll let you know and update the code.

Best, Erica