flowCore question regarding to the data range
4
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.5 years ago
(Private Address)

'4096' is the value stored in '$PnR' keyword from `FCS TEXT` segment. In order to find out why it is this value, you need to go back to the instrument where the FCS is generated. In terms of actual data value, I don't see any problem with it.

> library(flowCore)

> fr <- read.FCS("~/20150713_R1_CyFlow.fcs")
> fr
flowFrame object '20150713_R1_CyFlow.fcs'
with 1107833 cells and 4 observables:
    name   desc range minRange maxRange
$P1  FSC FSC-UV  4096 1.000225    10000
$P2  SSC SSC-UV  4096 1.000225    10000
$P3  FL1 FL4-UV  4096 1.000225    10000
$P4 Time      -  4096 0.000000     4095
107 keywords are stored in the 'description' slot
> apply(exprs(fr),2, range)
          FSC      SSC      FL1 Time
[1,]    1.000    1.000    1.000    0
[2,] 9977.539 9977.539 9977.539 4095

On 07/29/2016 03:47 AM, Joachim Schumann wrote:

Hi Mike,

just one question concerning the read.FCS method. I think that the method is not showing the real raw fcs data, the measured value of all channels for each cell, because the range is from 0-4095. But at the Software Summit the scale ranges from 10^0 to 10^4 which is 1-10.000. Is there any way to extract the real raw data of the fcs file? Or are the values given by the read.FCS method the real ones?

I used he following code:

f<-read.FCS("20150713_R1_CyFlow.fcs",transformation=F,alter.names=T)


Best,
Joachim

-- 
M. Sc. Joachim Schumann
PhD Student
Department of Environmental Microbiology
AG Flow Cytometry
Helmholtz Centre for Environmental Research - UFZ
Permoserstraße 15, 04318 Leipzig
Tel.: 0049-341-235-1330
E-Mail: joachim.schumann@ufz.de 
http://www.ufz.de 

 

flowcore flow cytometry • 1.7k views
ADD COMMENT
0
Entering edit mode
@joachimschumann-8133
Last seen 7.7 years ago
European Union

Thanks, my problem was the parameter transformation=F. But now if I want to do the xyplot there comes an error.

xyplot(FL1 ~ FSC, fr)

Warning message:
In KernSmooth::bkde2D(x, gridsize = nbin, bandwidth = bandwidth,  :
  Binning grid too coarse for current (small) bandwidth: consider increasing 'gridsize'

The method densityplot() of the flowViz package also does not work, better said the plot is wrong.

densityplot(~ FSC,fr)

Maybe the problem is that the range of 4096 is saved within the fcs file but the data range is from 1-10.000?

ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.5 years ago
(Private Address)

Yes, it is because flowViz uses the range of `4096` recorded in `$PnR` keyword by default. As I said, you may want to find out why it was set that way in the first place when FCS was generated.

Secondly, I'd recommend you switch to 'ggcyto' (eventually will deprecate ''flowViz'), by which you can easily customize the limits.e.g

 library(ggcyto)
 autoplot(fr, "FL1", "FSC") # default limit is data range
 autoplot(fr, "FL1", "FSC") + ggcyto_par_set(limits = "instrument") # switch to instrument range
 autoplot(fr, "FSC") # 1d density

 

ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.5 years ago
(Private Address)

Setting 'what' argument to 'integer' will do. e.g.

 write.FCS(fr, filename = tmp, what = "integer")

 

On 08/04/2016 03:55 AM, Joachim Schumann wrote:

Hi Mike,

I have another question. The write.FCS method produces fcs files with 32bit float values. But our software does not read 32bit values, it is limited to 16bit integer. Is there a way to write an own method with this change based on your method?

Best,
Joachim
 

 

ADD COMMENT
0
Entering edit mode
@joachimschumann-8133
Last seen 7.7 years ago
European Union

I tried setting the "what" argument to integer. I was wondering why the minRange values are changing. 

 

fr<-read.FCS("20150713_R1_CyFlow.fcs")

fr

flowFrame object '20150713_R1_CyFlow.fcs'

with 1107833 cells and 4 observables:
    name   desc range minRange maxRange
$P1  FSC FSC-UV  4096 1.000225    10000
$P2  SSC SSC-UV  4096 1.000225    10000
$P3  FL1 FL4-UV  4096 1.000225    10000
$P4 Time      -  4096 0.000000     4095
107 keywords are stored in the 'description' slot

write.FCS(fr,"test16.fcs",what="integer")

fr2<-read.FCS("test16.fcs")

fr2

flowFrame object '20150713_R1_CyFlow.fcs'
with 1107833 cells and 4 observables:
    name   desc range minRange maxRange
$P1  FSC FSC-UV  4096        0    10000
$P2  SSC SSC-UV  4096        0    10000
$P3  FL1 FL4-UV  4096        0    10000
$P4 Time      -  4096        0     4095
110 keywords are stored in the 'description' slot

The range of 4096 is (in my opinion) not the actual data range but the number of channels (bins) per parameter (e.g. FSC). 

Now, when opening these 2 files with Summit, the histograms look completely different and also the scale is different (I attached two screenshots to my EMail).

 

ADD COMMENT

Login before adding your answer.

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