RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
44 stars 21 forks source link

Calculating Geometric Mean Fluorescence Intensity (gMFI) #392

Open carduncombe opened 11 months ago

carduncombe commented 11 months ago

I am trying to calculate the gMFI from a data set.

I had a couple questions about how this pop.MFI data type is calculated. What is the transformation/equation that is applied to the raw values (produced when inverse.transform = TRUE) to create the output table of pop.MFI values?

Was there a way to calculate the geometric MFI with this function?

Example code: MFI_df <- gs_pop_get_stats(gs, nodes = "/Lymphocytes/Single Cells/live/CD3+", type = pop.MFI, inverse.transform = FALSE)

mikejiang commented 11 months ago

Transformation is whatever is stored/attached to gatingset. Which can be inspected by trans <- gh_get_transformations(gh, inverse = TRUE)

You can follow the example of pop.MFI https://github.com/RGLab/flowWorkspace/blob/devel/R/getStats.R#L232 to write your own custom function to calculate your geometric MFI (whatever it means), it should receive flowFrame data object, return a named numeric vector, pass the function to type in the similar way