I am trying to normalise (some chosen) expression values of all flowFrames within a flowSet. They desired output would be again a flowSet. Unfortunately my understanding of defining functions in R is not sufficient to do so.
What I have tried so far was to use fsApply (flowcore) or normalize (flowcore) functions, however I think that both were unsuccesful because I wasnt able to define the normalization function correctly. For matrices, z-Score normalization is easily possible with the scale function, but I wasnt able to translate this into a working solution for flowSets.
Does anyone have more experience in defining function in R and has any idea how to solve this? See my naive and failed attempts below.
Thanks a lot and best wishes, Jerg
Try1 using fsApply:
scale_fun <- scale(x, center = TRUE, scale = TRUE)
fs_scaled <- fsApply(fs_initial, FUN = scale, center = T, scale = TRUE,
simplify = T,
use.exprs = T)
Try2 using normalization:
scale_fun <- normalization(parameters = scale_para,
normalizationId = "zScore",
normFunction = scale,
arguments = list("x=data", "center=T", "scale=T"))
fs_norm <- normalize(data = fs_initial, x = scale_fun)