DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

clean argument in cyto_setup() #135

Closed rwbaer closed 2 years ago

rwbaer commented 2 years ago

Briefly describe what you hope to achieve: Background. FlowAI has not worked for .fcs files created by my Biorad S3e cell sorter because of the unusual way this instrument seems to record time using a very small time step, and the TIMESTEP parameter does not get properly set by the instrument.

Gianni Monaco https://github.com/giannimonaco/flowAI was kind enough to fix flow_auto_qc so I can run my files through flowAI by passing an appropriate parameter list (ver 1.25.7)

My question is whether there is any convenient way to pass these same arguments through to cyto_setup(). The clean argument seems to be a simple Boolean TRUE/FALSE.

Alternatively, if I run flow_auto_qc() directly, is there anything special I need to do to integrate a cleaned flowset/cytoset/gatingset into my CytoExploreR workflow? Would I do it before or after running cyto_setup()? Thanks for any advice you might have. for me

Outline the steps taken to attempt to reach this goal (paste code below): This is the code that will successfully clean my file when used directly from flowAI

devtools::install_github("giannimonaco/flowAI")
fs_comp_clean <- flow_auto_qc(fs_comp, 
                              timeCh ="TIME", 
                              timestep = 0.0000001,
                              second_fractionFR=0.1 ,
                              ChExcludeFS = c("FSC","SSC"))
cs <- flowSet_to_cytoset(fs_comp_clean)

Include any associated screenshots or images here:

DillonHammill commented 2 years ago

@rwbaer, the clean argument in cyto_setup() can only pass the remove_from argument to FlowAI. If you need to supply more arguments you are better of using cyto_clean() directly after the data has been loaded with cyto_setup(). Refer to the docs for details (https://dillonhammill.github.io/CytoExploreR/reference/cyto_clean.html).

gs <- cyto_setup("Samples")
gs <- cyto_clean(gs, 
                 timeCh ="TIME", 
                 timestep = 0.0000001,
                 second_fractionFR=0.1 ,
                 ChExcludeFS = c("FSC","SSC"))

In CytoExploreR version 2.0.0, cyto_clean() gets support for a plethora of such algorithms, including flowCut, flowClean and PeacoQC. There is also a new cyto_gate_clean() function which applies the algorithms and stores the output as gates in your GatingSet, it also puts an entry in the gatingTemplate for you as well.

rwbaer commented 2 years ago

@DillonHammill - As always you are so patient and helpful. You provide terrific support for this wonderful package. Thank you.