Dear Community,
I am interest in how to modify of write a FCS file in R, in a way that I edit a flowframe and then save it to a FCS file. I think writing it from scratch is harder, so I would start with an existing file and modify it.
What I would like to do is to enter scRNAseq data into the FCS file so that I or others can explore the data with FlowJo as if it was data from flow cytometry. What I managed by myself is to modify the "exprs"-slot of the FCS file, save the FCS file and open it in FlowJo. In order to keep the file consistent (or correct) one has to modify the meta data as well (e.g. giving channel names and descriptions and so on). This appears rather tedious to me and it would probably take a bit of time to figure out the pitfalls of it.
I wonder if anyone could some code snippets for or a larger block of code to do this job. Alternatively, I am also happy to hear another approach of how to do this. Or, alternatively again, let me know if this idea does not make sense to you.
Chris.
use flowFrame constructor
see example https://github.com/RGLab/flowCore/blob/trunk/tests/testthat/test-IO.R#L268-L277
You will need the latest Bioc devel or github trunk version of flowCore.
Great, that seems indeed to be rather useful.
Is it also possible to remove or add columns / channels completely?
For an extensive example, take a look at the function cytof_addToFCS of cytofkit