plantarum / flowPloidy

An R package for flow cytometry histogram analysis
5 stars 0 forks source link

Histogram bins setting error with files from CytExpert software #4

Closed taprs closed 1 year ago

taprs commented 1 year ago

Hi Tyler! Thanks for making this package, it is a pleasure to use it! I am not sure if my issue is related to flowPloidy alone, but maybe you could try to help?

CytExpert software at my lab sometimes produces FCS files that can be read with read.FCS but fail to pass through FlowHist in some channels. My humble effort in debugging led to realisation that the error comes from setBins function. The error reads as follows:

> FlowHist("sas.fcs", "FL2.H")
Error in if (xx >= first.channel & xx < length(intensity)) { : 
  missing value where TRUE/FALSE needed

I attach the minimal FCS file that causes the error, it has only 6 events in it. Is there anything I (or you?) could do about it?

Cheers, Nikita

File: sas.fcs.zip

plantarum commented 1 year ago

Hi Nikita,

I don't understand how you generated a file with only 6 events in it. I don't think flowPloidy will be able to fit a curve to such a small data set. In our lab, we would consider a file with only 6 events to be a failed experiment, and would need to trouble-shoot the sample processing. This doesn't sound like a problem we can solve with a computer program.

Sorry I can't be more helpful, but we don't deal with flow cytometry histograms with less than 500 events, and usually much more.

Good luck!

Tyler

taprs commented 1 year ago

Hi Tyler,

Thanks for looking into this! And sorry for being not clear. Normally I generate FCS files with a few hundreds/thousands target events, in case of other machines they work good with flowPloidy but with CytoFlex + CytExpert they produce the same error. I firstly attached an artificially made small FCS file just to make all the channel values visible by eye to demonstrate the reason for the error is not them. If you are more comfortable with big FCS files, I attach one now.

Bests! Nikita

carex_final.fcs.zip

taprs commented 1 year ago

Hi Tyler!

All good, I gained some more experience with debugging and I see the problem. The error appears because for some reason all positive channel values get grouped in the first bin of the histogram and fhStart fails to return a positive startBin, so first.channel is set to NA. Definitely not the problem of the package. I will look into tuning the machine. Closing the issue now.