farrellja / URD

URD - Reconstruction of Branching Developmental Trajectories
GNU General Public License v3.0
115 stars 41 forks source link

floodPseudotime #77

Open allisoncheney opened 2 years ago

allisoncheney commented 2 years ago

Hi, I'm having trouble with the floodPseudotime function.

rootcells <- cellsInCluster(hffURD, "ARCcluster", "12")

hffURD.floods <- floodPseudotime(hffURD, root.cells = rootcells, n=50, minimum.cells.flooded = 2,  verbose=TRUE)

[1] "Starting flood number 1" Error in intI(j, n = d[2], dn[[2]], give.dn = FALSE) : no 'dimnames[[.]]': cannot use character indexing

here's the traceback:

  1. stop("no 'dimnames[[.]]': cannot use character indexing")
  2. intI(j, n = d[2], dn[[2]], give.dn = FALSE)
  3. subCsp_ij(x, i, j, drop = drop)
  4. tm.flood[cells.not.visited, cells.visited, drop = F]
  5. tm.flood[cells.not.visited, cells.visited, drop = F]
  6. apply(tm.flood[cells.not.visited, cells.visited, drop = F], 1, combine.probs)
  7. floodPseudotimeCalc(object, start.cells = root.cells, minimum.cells.flooded = minimum.cells.flooded, tm.flood = tm.flood, verbose.freq = verbose.freq)
  8. FUN(X[[i]], ...)
  9. lapply(1:n, function(x) { if (verbose) print(paste("Starting flood number", x)) floodPseudotimeCalc(object, start.cells = root.cells, minimum.cells.flooded = minimum.cells.flooded, ...
  10. as.data.frame(lapply(1:n, function(x) { if (verbose) print(paste("Starting flood number", x)) floodPseudotimeCalc(object, start.cells = root.cells, minimum.cells.flooded = minimum.cells.flooded, ...
  11. floodPseudotime(hffURD, root.cells = rootcells, n = 50, minimum.cells.flooded = 2, verbose = TRUE)

I thought maybe it was that the cell names somehow weren't present in the data, but all(rootcells %in% colnames(hffURD@count.data)) returns TRUE.

Thank you!

farrellja commented 2 years ago

Hi @allisoncheney,

the floodPseudotime function looks at hffURD@logupx.data. Does that slot have data with cell names as columns and genes as rows?