rprops / Phenoflow_package

R package offering functionality for the advanced analysis of microbial flow cytometry data
GNU General Public License v2.0
9 stars 5 forks source link

RandomF_FCS error #64

Closed rprops closed 5 years ago

rprops commented 5 years ago

fig

FMKerckhof commented 5 years ago

experiencing similar errors with diversity_rf

rprops commented 5 years ago

does this occur on flowAI denoised data or on normal data too?

FMKerckhof commented 5 years ago

in my case it occured on normal (i.e. transformed, but not cleaned) data too, I looked at Diversity_rfand it happens when applying x <- x[, param] . R version 3.5.3 (2019-03-11), on linux, Phenoflow installed from GitHub 8d58f48

FMKerckhof commented 5 years ago

specifically, this type of subsetting appears to break after running mytrans in flowCore::transform

FMKerckhof commented 5 years ago

I have pinpointed the issue (at least in my dataset). Right before the mytrans normalization, we use flowCore::Subset to separate the cellular fraction. It would appear that, at least in my case, some samples retained 0 cells. This makes the transformation return a non-numeric matrix (i.e. a null matrix), which returns the error. Diagnostic: which(unlist(fsApply(flowData_transformed,function(x)is.numeric(x@exprs)))==FALSE) if this returns anything else but named integer (0) there are samples that are problematic. Even with 1 cell, it will still work, therefore I am now applying an additional subsetting step to assure that there are at least 500 cells in the sample.