SofieVG/FlowSOM

NewData: doc & example

SamGG opened this issue · 1 comments

SamGG commented

Hi. The doc states that

We assume the data is already compensated and transformed, but not scaled yet. The same scaling parameters as from the original grid will be used.

The code shows that if compensation/transform/scale slots are present in the flowSOM object those operations are applied to the flowframe.

FlowSOM/R/3_buildMST.R

Lines 1794 to 1811 in 50daac2

if(fsom$compensate){
ff <- flowCore::compensate(ff, fsom$spillover)
}
if(fsom$transform){
ff <- flowCore::transform(ff, flowCore::transformList(
BiocGenerics::colnames(ff[, fsom$toTransform]),
fsom$transformFunction))
}
if(fsom$scale){
newData <- scale(exprs(ff),
center = fsom$scaled.center[
BiocGenerics::colnames(ff)],
scale = fsom$scaled.scale[
BiocGenerics::colnames(ff)])
} else {
newData <- exprs(ff)
}

I think the doc should be updated accordingly. The example should also be changed because a flowframe might be compensated and transformed twice currently leading to wrong interpretations.
Let me know if I should setup a PR. Best.

SamGG commented

7d1fcfc
Thanks.