I am trying to run flowbin on my multi-tube flow set and got error message when trying to calculate medianFIDist.
tube.combined <- flowBin(tube.list=X.sample@tube.set,
bin.pars=X.sample@bin.pars,
control.tubes=X.sample@control.tubes,
expr.method='medianFIDist',
scale.expr=T)
Applying flowBin to Unnamed Flow Expr Set
Quantile normalising binning parameters across tubes
Binning using kmeans
Filtering sparse bins.
78 bins removed, containing a total of 69991 or 34 % of events (averaged across tubes).
Calculating medianFIDist for all populations.
Error in if (res < 1) res <- 1 : missing value where TRUE/FALSE needed
In addition: Warning message:
Quick-TRANSfer stage steps exceeded maximum (= 14099950)
Traceback and some googling (https://rdrr.io/bioc/flowBin/src/R/getBinExpr.R) into the function told me that medianFIDist is assuming the data has been log transformed.
This assumption is false. All my FCS parameters are still linear. I did not perform a transformation on them. It seems to me that this is a foolish assumption to make. What if I run the function on data that has been transformed with a biexponentialTransformation, would it still fail? What can be done to fix this?
#Distance function: difference of MFIs medianFIDist <- function(test, control) { if(is.null(control)) stop('NULL control frame -- no control tubes specified?') #Note: assumes log transform has been applied, so relinearises before subtracting res <- median(10^test) - median(10^control) if(res < 1) res <- 1 log(res,10) }
Thanks
Kelly
I'm not worried too much about the other warnings just yet. I have a set for FCS files that I have been using to experiment with various flow analysis packages in R. I downloaded the flowBin package because I think it will be useful in the set of analysis that I would like to run, and I like the fact that it takes into account control data. I was walking through the workflow published for flowBin on Bioconductor and was actually a little surprised when the code started running as the files are rather large and have not been downsampled yet. Luckily it was the end of the day, so I let the code go to see what would happen, and you can see the warnings I got above when I returned the next day.
My concern for the package the way it's written, is there is no mention of it being necessary to transform the data. FCS files are exported from the cytometer as linear. It is true that most people would apply a transformation as part of their workflow, but there is no mention of installing flowCore and applying a log transformation in the documentation before running flowBin. However, it's actually not so easy to apply a log10 transformation to flow data as 0 data points are converted to NaN, and therefore other data manipulations are necessary before performing a log transformation. In addition, flowCore offers many different transformation options, so while the data may be transformed, it may not necessarily be in log10. Therefore, the assumption that the data is in log10 is specific to the aml.sample dataset, and not generally applicable.
I'll let you decide what you think is best in terms of patching the code. I don't know much about patch/pull requests. I'm pretty new at this. If you think proportionPositive is the better method and would be more flexible in terms of data input and easier to interpret in data output then I think that is definitely the way to go.
Thanks for your help
Kelly