RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
44 stars 21 forks source link

gs_pop_get_count_fast accept only path="full" option #371

Open OuNao opened 2 years ago

OuNao commented 2 years ago

Hi,

I having problem with gs_pop_get_count_fast as it accept only path="full" option. I need to pass path as "auto" or 1 (last node name).

gs_pop_get_count_fast(gs, path="auto")[,2:4]

Results:

Error in .getPopCounts(x@pointer, statistic == "freq", subpopulations,  :  limph not found in gating tree of main

With path="full" works but the table use full node path.

Using last CRAN version, flowWorkspace_4.6.0, and R 4.1.2

I get no error in version 4.2.0 and R 4.05.

Thanks,

mikejiang commented 2 years ago

due to a significant amount of overhead from look up population by partial path, we have refactored the underlying C code to only take full path, which speeds up this API many folds. Maybe I should also update R interface to make it clear to user, in terms of partial path, I believe it can be easily parsed out from the full path by user.

DillonHammill commented 2 years ago

In case you or others find it useful, CytoExploreR has a nice cyto_nodes_convert() function to convert the paths for you @OuNao:

counts <- gs_pop_get_count_fast(gs)
counts$Population <- cyto_nodes_convert(gs, nodes = counts$Population, path = "auto")
OuNao commented 2 years ago

Hi,

I solved my problem with simple

counts$Population<-basename(counts$Population)

I know that basename was not created for this but works very well.

I think that maybe gs_pop_get_count_fast must test for path option != "full" and throw a more informative error.

Thanks,