EDePasquale / DoubletDecon

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

Error at "creating synthetic doublet profiles" #5

Open maddiepyle opened 5 years ago

maddiepyle commented 5 years ago

Hello, I have successfully ran the Seurat_Pre_Process function for Seurat data and I believe my .txt files were in the correct format; however, when I run the main doublet decon function (code below):

NewARn_results <- Main_Doublet_Decon(rawDataFile = ARn_newFiles$newExpressionFile, groupsFile = ARn_newFiles$newGroupsFile, filename ="DD NewARn_test", location = "C:/Users/pylemp/Documents/Doublet Decon", fullDataFile = NULL, removeCC = FALSE, species = "mmu", rhop = 1, write = TRUE, PMF = TRUE, useFull = FALSE, heatmap = FALSE, centroids = TRUE, num_doubs = 30)

I get the following error and warning message at the "creating synthetic doublet profiles" step:

Error in PrepDR(object = object, genes.use = pc.genes, use.imputed = use.imputed, : trying to get slot "var.genes" from an object of a basic class ("matrix") with no slots In addition: Warning message: 'pca' is deprecated. Use 'RunPCA' instead. See help("Deprecated") and help("Seurat-deprecated").

I have been stuck at this point and would appreciate any input. Thank you!

maddiepyle commented 5 years ago

I solved this issue. For anyone else having trouble, the Seurat object at the RunPCA step must have been ran using variable genes (pc.genes = object@var.genes) for the pc.genes argument rather than all genes (pc.genes = rownames(object@data)). This will give you the correct counts matrix for the expressionFile and will allow the MainDoubletDecon function to create synthetic doublet profiles.

asbDBPub commented 5 years ago

Hi, I am putting this here since it is related to the same step. I was facing the issue that immediately after the message "Creating synthetic doublet profiles...", I would get the following error: "Error in paste0(location, "resultsreadable_synths.txt") : cannot coerce type 'closure' to vector of type 'character'"

I believe its occurring because the function Synthetic_Doublets() uses "location" but it is not listed as one of the arguments or defined in the function. For now, I simply created a modified function that takes it as an argument, and that seems to work.

Thanks!