Modifying or writing a FCS file in R using the FlowCore package
0
1
Entering edit mode
vonskopnik ▴ 10
@vonskopnik-17182
Last seen 6.0 years ago

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.

FCS flowframe flowcore flow cytometry • 3.9k views
ADD COMMENT
2
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Great, that seems indeed to be rather useful.

Is it also possible to remove or add columns / channels completely?

ADD REPLY
0
Entering edit mode

For an extensive example, take a look at the function cytof_addToFCS of cytofkit

ADD REPLY

Login before adding your answer.

Traffic: 824 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