livnatje / DIALOGUE

DIALOGUE is a dimensionality reduction method that uses cross-cell-type associations to identify multicellular programs (MCPs) and map the cell transcriptome as a function of its environment.
Other
103 stars 16 forks source link

Error in DIALOGUE1(rA = rA, k = k, main = main, results.dir = results.dir, : Cannot run DIALOGUE with less than 5 samples. #37

Open bmill3r opened 1 year ago

bmill3r commented 1 year ago

Hello and thanks again for your help.

I have successfully made a list of cell.type objects that I am passing to DIALOGUE.run, and I am using the FOV as the sample argument to compute MCPs.

summary(cell.type.object)

      Length Class     Mode
 [1,] 1      cell.type S4  
 [2,] 1      cell.type S4  
 [3,] 1      cell.type S4  
 [4,] 1      cell.type S4  
 [5,] 1      cell.type S4  
 [6,] 1      cell.type S4  
 [7,] 1      cell.type S4  
 [8,] 1      cell.type S4  
 [9,] 1      cell.type S4  
[10,] 1      cell.type S4  
[11,] 1      cell.type S4  
[12,] 1      cell.type S4  
[13,] 1      cell.type S4  
[14,] 1      cell.type S4  
[15,] 1      cell.type S4  
[16,] 1      cell.type S4  
[17,] 1      cell.type S4  
[18,] 1      cell.type S4  
[19,] 1      cell.type S4  
[20,] 1      cell.type S4  
MPCs <- DIALOGUE.run(rA = cell.type.object, # list of cell.type objects
                      main = "Merfish_coronal",
                      k = 20, # number of MCPs to identify
                      results.dir = resultsDir, 
                      conf = c("cellQ"), # any potential confounders DIALOGUE needs to account for; default is "cellQ" 
                      pheno = NULL, # if there is a specific phenotype of interest, specify it here, and DIALOGUE will test its association with the resulting MCPs
                      spatial.flag = TRUE)

However, when running DIALOGUE.run, I receive the following error:

Error in DIALOGUE1(rA = rA, k = k, main = main, results.dir = results.dir, :
Cannot run DIALOGUE with less than 5 samples.

My dataset has approximately 1200 FOVs, so I am a little unclear why this is. Looking through the code, my guess is that FOVs that contain multiple cell types are considered. Does an FOV need to contain all cell types to be considered, or is there some threshold that I can control myself?

When I run the code in piecemeal myself, I end up with 80 FOVs, which is a little odd given that there are none when I run the code in full, but nonetheless if I had a way to control for the number of cell types in a "sample" that might help. I could also increase the size of the FOVs such that might contain more cell types, but given how cell types are organized in tissues, I still doubt that an FOV would contain all cell types unless if it contained the entire tissue.

Thanks, Brendan