unable to read FCS: expecting the bitwidth to be the same for all parameters
1
0
Entering edit mode
@michaelgaspar-8649
Last seen 8.5 years ago
European Union

Hello!

As the title states already I am trying to read FCS files generated with Partec CyFlow Cube 6 with read.FCS from the flowCore package (version 1.34.9, R version 3.2.2) and get

> library("flowCore")
> data <- read.FCS("~/flow_cytometry/pnk63/no_stain/2015_08_18_15_53_55__98_pnk63-H31.fcs")
the text section does not end with delimiter: /. The last keyword is dropped.
the text section does not end with delimiter: /. The last keyword is dropped.
Error in readFCSdata(con, offsets, txt, transformation, which.lines, scale,  :
  Sorry, I am expecting the bitwidth to be the same for all parameters
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] flowCore_1.34.9

loaded via a namespace (and not attached):
 [1] DEoptimR_1.0-3      rrcov_1.3-8         corpcor_1.6.8      
 [4] tools_3.2.2         parallel_3.2.2      Rcpp_0.12.0        
 [7] Biobase_2.28.0      mvtnorm_1.0-3       robustbase_0.92-5  
[10] grid_3.2.2          pcaPP_1.9-60        BiocGenerics_0.14.0
[13] stats4_3.2.2        cluster_2.0.3       lattice_0.20-33    
[16] graph_1.46.0       

What's wrong? The manufacturer's documentation states that the device outputs FCS version 3.0.

Best,

Micha

 

flowcore read.fcs • 2.3k views
ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.6 years ago
(Private Address)

As the error message tells, flowCore is expecting the same bitwidth (i.e. $PnB parameter defined in the FCS TEXT segment) for all channels. You can confirm the cause by running the script below:

 

kw <- as.list(read.FCSheader("~/flow_cytometry/pnk63/no_stain/2015_08_18_15_53_55__98_pnk63-H31.fcs")[[1]])

kw[grep("P[0-9]*B", names(kw))]

 

ADD COMMENT
0
Entering edit mode

Dear Mike,

thank you for the immediate answer! Obviously this is the case:

> kw <- as.list(read.FCSheader("~/flow_cytometry/pnk63/no_stain/2015_08_18_15_53_55__98_pnk63-H31.fcs")[[1]])
the text section does not end with delimiter: /. The last keyword is dropped.
> kw[grep("P[0-9]*B", names(kw))]
$`$P1B`
[1] "16"

$`$P2B`
[1] "16"

$`$P3B`
[1] "16"

$`$P4B`
[1] "16"

$`$P5B`
[1] "16"

$`$P6B`
[1] "16"

$`$P7B`
[1] "32"

$`$P8B`
[1] "8"

The device should have 6 channels only (FSC, SSC, FL1-4), what are the other 2 supposed to be?

However, I don't need all the channels, only FSC, SSC, FL1 and FL3. Is there a way to read them selectively?

Best,

Micha

ADD REPLY
0
Entering edit mode

The other 2 could be `height` instead of `Area`. To print all the channel names

kw[grep("P[0-9]*N", names(kw))]

To selectively read channel in, specify 'regular expression' through 'column.pattern' argument.

read.FCS("~/flow_cytometry/pnk63/no_stain/2015_08_18_15_53_55__98_pnk63-H31.fcs", column.pattern = "([FS]SC-H)|(FL[1-4]-H)")

 

ADD REPLY
0
Entering edit mode
> kw[grep("P[0-9]*N", names(kw))]
$`$P1N`
[1] "FSC"

$`$P2N`
[1] "SSC"

$`$P3N`
[1] "FL1"

$`$P4N`
[1] "FL2"

$`$P5N`
[1] "FL3"

$`$P6N`
[1] "FL4"

$`$P7N`
[1] "TIME"

$`$P8N`
[1] "DOUBLET"

I adjusted the regex (I already have tried column.pattern before), but nothing :(

> read.FCS("~/flow_cytometry/pnk63/no_stain/2015_08_18_15_53_55__98_pnk63-H31.fcs", column.pattern = "([FS]SC)|(FL[1-4])")
the text section does not end with delimiter: /. The last keyword is dropped.
the text section does not end with delimiter: /. The last keyword is dropped.
Error in readFCSdata(con, offsets, txt, transformation, which.lines, scale,  :
  Sorry, I am expecting the bitwidth to be the same for all parameters

The error recurs, even if I use a single channel (i.e. column.pattern = "FSC") or "nonsense" pattern which should output zero channels.

ADD REPLY
0
Entering edit mode

Right, the channel filtering happens after the entire data section is parsed. Looks like we may need to think about making changes to the current API so that it would allow different bitwdiths across channels. 

ADD REPLY
0
Entering edit mode

I tried to fiddle with the code (IO.R) but it's too complex for a beginner like me. Is there another way to get past this problem?

ADD REPLY
0
Entering edit mode

Can you post a feature request here https://github.com/RGLab/flowCore/issues?

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

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