Entering edit mode
@chandraswarnendu-22534
Last seen 5.0 years ago
I am trying to do the analysis of my fcs file by flowCore. In my analysis I have fl1 and fl3 data, but I want to create a new column consisting of the mathematical calculation ((fl1+fll3) /fl1) and name it df and then plot it as df in x-axis and fl1 in y-axis. Is there any function in flowCore package or in any other package, which can help me in doing this in my fcs file?
use frappendcols
see https://github.com/RGLab/flowCore/issues/121 For your case, something like this
Thanks..... It is a great help.
I am trying to use a for loop to add the new column in all fcs files at the same time. my codes are
The error I am gating is: Error in abs(i) : non-numeric argument to mathematical function
Please help.
You cannot add a column to a flowFrame of a flowSet directly, because all flowFrames of the flowSet are sharing the exact same set of columns (Mike will correct me if I'm wrong). This does not explain the error, but it will improve your loop. You have to define clearly your result. If you want to get a flowSet at the end of the process, you will have to build a flowSet from the modified flowFrames. Mike may have a nice piece of code. If you want to get a set of modified FCS files, just write the modified flowFrame to disk using write.FCS. PS1: be careful with double quote PS2: try to improve your knowledge about R concerning vectors and lists PS3: I added some comments to Mike's code