kharchenkolab / cacoa

Single-cell Case Control Analysis
46 stars 7 forks source link

Error: dimension should be positive #33

Closed cubense closed 2 years ago

cubense commented 2 years ago

when I convert seurat to Cacoa, error was reported:

cao<- Cacoa$new(seurat, sample.groups=newmetadata$treat, cell.groups=seurat$celltype, sample.per.cell=seurat$sample, ref.level="PreTreat", target.level="PostTreat")

Which step did I do wrong??

Error: dimension should be positive 9. stop("dimension should be positive", call. = FALSE) 8. check_dim(dim) 7. coda.base::ilr_basis(ncol(freqs), type = "default") 6. getLoadings(samples.init$cnts[[ib]], samples.init$groups[[ib]]) 5. FUN(X[[i]], ...) 4. lapply(1:length(samples.init$cnts), function(ib) { getLoadings(samples.init$cnts[[ib]], samples.init$groups[[ib]]) }) 3. do.call(cbind, lapply(1:length(samples.init$cnts), function(ib) { getLoadings(samples.init$cnts[[ib]], samples.init$groups[[ib]]) })) 2. runCoda(cnts, groups, n.boot = n.boot, n.seed = n.seed, ref.cell.type = ref.cell.type) 1. cao$estimateCellLoadings()

cubense commented 2 years ago

Using vector could solve it.

GhobrialMoheb commented 1 year ago

@cubense , I have the sample problem. May you please let me know if you managed to use the package on a seurat object? Thanks alot in advance