DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
61 stars 13 forks source link

Error with cyto_save + cyto_load #102

Closed Biomiha closed 3 years ago

Biomiha commented 3 years ago

Hi Dillon,

I'm experiencing an issue using cyto_save followed by cyto_load. If I save my GatingSet as:

cyto_save(x = WholeBlood_gs, save_as = "WholeBlood_gs_LD/")

And then try to read it back in using:

cyto_load("WholeBlood_gs_LD/")

I get:

 > Error in cyto_load("WholeBlood_gs_LD/") : 
      WholeBlood_gs_LD/ does not contain any valid FCS files.

Looks like cyto_save is saving the GatingSet as .h5 files, but cyto_load is expecting .fcs files. Using the parental flowWorkspace::load_cytoset("WholeBlood_gs_LD/") or alternatively the combination of flowWorkspace::save_gs, and flowWorkspace::load_gs seem to work fine.

DillonHammill commented 3 years ago

@Biomiha, I have actually already fixed this on the version that I am currently working on. Since it doesn't affect too many other things I have pushed those changes to the master branch for you. This should do the trick in the meantime until I release the new version (it is awesome!).

Please update your CytoExploreR and try again:

devtools::install_github("DillonHammill/CytoExploreR")

Let me know how you go.

P.S. If you want to save the FCS files instead of the entire GatingSet just supply the name of the population that you want to export to the parent argument in cyto_save()

Biomiha commented 3 years ago

Prompt as ever. Works as expected. Yes, I've noticed you said you were updating to account for the new cytoframe and cytoset objects. I have absolutely no doubt it's going to be awesome.

Thanks Dillon! Take care.

DillonHammill commented 3 years ago

Since it is related to the changes I pushed here, I just pushed a fix to master to ensure that file_sort() appropriately handles single samples.