Cannot inverse transform GatingSet
2
0
Entering edit mode
mfahlber • 0
@mfahlber-20761
Last seen 5.5 years ago

I am importing a FlowJo Workspace via parsing the workspace, and then normalizing the workspace using the normalize() function. No issues here. However, after taking these steps, I am trying to export the files via write.flowSet. But when I do so, the data comes back untransformed, so the MFI is squished between 50-200 or so, instead of between -500 and 26,000 as I would expect.

I have tried nearly every which way of utilizing the flowJobiexponential transform function but it just isn't working right. For example, it transforms the data from MFI 70 to MFI 700, when it should really be MFI in the 1000s. Does anyone know how to inverse transform the data? It works when I use getStats and set inverse.transform = TRUE, but I can't find a similar function when writing the transformed FCS files. I wish there were something like, write.flowSet(inverse.transform=TRUE). Would be so helpful.

flowworkspace flow cytometry flow workspace • 1.5k views
ADD COMMENT
0
Entering edit mode

Moved comment to answer

ADD REPLY
1
Entering edit mode
Jake Wagner ▴ 310
@jake-wagner-19995
Last seen 4.1 years ago

Would getTransformations() with inverse=TRUE work for your case? So something along these lines:

fs_transformed <- getData(gs)
inv_trans <- lapply(gs, function(gh){
  invs <- getTransformations(gh, inverse=TRUE)
  invs <- transformList(names(invs), invs)
})
fs_inverted <- transform(fs_transformed, inv_trans)
write.flowSet(fs_inverted)

We may make this easier with a single inverse.transform=TRUE flag for getData (similar to getStats) soon, but hopefully this will solve your problem for now.

ADD COMMENT
0
Entering edit mode
Jake Wagner ▴ 310
@jake-wagner-19995
Last seen 4.1 years ago

Additionally, I went ahead and added an inverse.transform flag to getData in https://github.com/RGLab/flowWorkspace/commit/0346da50b5e876ac90465a4ecdc3aa71589b7778 Those changes will be in the Bioconductor 3.10 development branch as well and will make this a bit easier:

fs_inverted <- getData(gs, inverse.transform=TRUE)
write.flowSet(fs_inverted)

If you do incorporate those changes, just keep in mind that getData will throw a harmless deprecation warning because that method is being renamed gh_pop_get_data/gs_pop_get_data in this release cycle.

Also keep in mind that will not reverse the compensation. You could use decompensate for that.

ADD COMMENT

Login before adding your answer.

Traffic: 784 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6