Wed Jun 15, 2022 9:17 am by sgranjeaud
It is quite easy to normalize the data as shown below. The main point is to read the FCS files and write them back once normalized.
IIRC Cytobank is based on the scaling of the channel. Check its documentation or ask support.
CellEngine and OMIQ have straight forward functionality to do it. Don't know about other software.
- Code:
# let's some data in matrix form
mat_exprs = as.matrix(iris[,-5])
# get the range of each column aka dim 2
minmax = apply(mat_exprs, 2, range, na.rm = TRUE)
minmax
diff(minmax) # the difference between max and min for each column
# remove offset, ie minimal value in each column
mat_norm = sweep(mat_exprs, 2, minmax[1,], "-")
# divide by the difference
mat_norm = sweep(mat_norm, 2, diff(minmax), "/")
# check
apply(mat_norm, 2, range, na.rm = TRUE)
# alternatively, quantile might be useful at targeting a fraction of values
# use the following command as minmax, 5th and 99th percentiles
apply(mat_exprs, 2, quantile, probs = c(0.05, 0.99), na.rm = TRUE)