DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
61 stars 13 forks source link

error in load_cytoset_from_fcs when emptyValue = FALSE #37

Closed Biomiha closed 4 years ago

Biomiha commented 4 years ago

It seems that load_cytoset_from_fcs doesn't actually accept the emptyValue argument. When I read in a set of fcs files using read.flowSet(fcs_files, emptyValue = FALSE) this works but when I try the same with load_cytoset_from_fcs(fcs_files, emptyValue = FALSE), I get the following error:

Error_ in fcs_to_cytoset(sapply(files, normalizePath), list(which.lines = which.lines, : Empty keyword name detected!If it is due to the double delimiters in keyword value, please set emptyValue to FALSE and try again!

Biomiha commented 4 years ago

Just realised load_cytoset_from_fcs is actually part of flowWorkspace. Apologies.

DillonHammill commented 4 years ago

The CytoExploreR wrapper for this is cyto_load() which calls these functions internally. cyto_load() is called inside cyto_setup() to read in the files. All exported CytoexploreR functions are prefixed with cyto_. You can post this issue on flowWorkspace so that it can be fixed by the RGLab - double check the docs to see if the name of the argument has not changed.

Biomiha commented 4 years ago

I get the same issue with cyto_load, e.g.:

cyto_load(path = fcs_files, select = list.files(fcs_files, pattern = "fcs"), emptyValue = FALSE)

Error in fcs_to_cytoset(sapply(files, normalizePath), list(which.lines = which.lines, : Empty keyword name detected!If it is due to the double delimiters in keyword value, please set emptyValue to FALSE and try again!

DillonHammill commented 4 years ago

That is to be expected, the same function is being called.

Have you tried looping through the files individually and calling load_cytoframe_from_fcs(). Perhaps the argument is not being passed on to this function from load_cytoset_from_fcs()?

files <- list.files("fcs_files", full.names = TRUE)
cf_list <- lapply(files, function(file){load_cytoframe_from_fcs(file, emptyValue = FALSE)})
cs <- cytoset(cf_list)
Biomiha commented 4 years ago

I still get an error:

files <- list.files("fcs_files", pattern = "fcs", full.names = TRUE)
cf_list <- lapply(files, function(file){load_cytoframe_from_fcs(file, emptyValue = FALSE)})
cs <- cytoset(cf_list)

Error in parseFCS(normalizePath(filename), list(which.lines = which.lines, : Empty keyword name detected!If it is due to the double delimiters in keyword value, please set emptyValue to FALSE and try again!

DillonHammill commented 4 years ago

If read.flowSet() works just use this and then convert the flowSet to a cytoset if you need to:

files <- list.files("fcs_files", pattern = "fcs", full.names = TRUE)
fs <- read.flowSet(files, emptyValue = FALSE)
cs <- flowSet_to_cytoset(fs)

I would still file an issue on flowWorkspace as well, so that this can be fixed.

Biomiha commented 4 years ago

Yes. This works as well.

files <- list.files("fcs_files", pattern = "fcs", full.names = TRUE)
cf_list <- lapply(files, function(file){read.FCS(file, emptyValue = FALSE)})
cs <- cytoset(cf_list)
DillonHammill commented 4 years ago

For anyone else experiencing the same problem this has now been fixed. If you need this feature you will need the latest versions of cytolib and flowWorkspace.

BenJCQuah commented 1 year ago

Dear Dillon Hammill,

Thank you for your awesome better-than-flowjo flow Cytometry analysis package. Do you think you will ever have a pipeline for spectral unmixing like you do for compensation?

Thanks!

BQ