Hey,
I'm trying to process a whole heap of flow data files (obviously), and I've set up gating strategies. My problem is that due to the nature of my research, in some files, a gated population will be empty, and this causes errors when I try to create a density plot (plots that population for each file until it reaches an empty population, then stops). It's inefficient for me to identify and remove the files, and there are other populations of interest aside from the population that is empty.
How can I remove or skip empty populations, so that I don't have to go back each time and find/delete the FCS files?
Example code:
fn <-list.files(pattern=".fcs") fs <- read.flowSet(fn,alter.names=TRUE) qg1 <- quadrantGate(fs,stains=c("CD19","CD3")) fsqg1 <- split(fs,qg1) bc <- fsqg1$`CD19+CD3-` dpl <- densityplot(IndividualID~`FITC.A`,bc)
Thanks!
It's a start. Is there a way that I can make the densityplot function skip over the empty frames within a subset? bc is the flowset resulting from a gate applied to fs. This is the result I get if one of the frames is blank, see how all the plots are generated up until the problem plot, and the remainder aren't generated?
I was wrong, bc is a flowSet. Filtering upon the number of rows (aka events) should do the job.
Brilliant! This works really well and reports errors! Thanks. I really appreciate it.