How to edit parameters and description of fcs file
1
0
Entering edit mode
crysis405 ▴ 10
@crysis405-10875
Last seen 6.0 years ago

I would like to edit my fcs file just like its possible in fcsexpress (image bellow). I have attempted the following:

 

fcs_hq <-flowCore::read.FCS(PT1, transformation = FALSE)
params <- flowCore::parameters(fcs_hq)
desc <- flowCore::description(fcs_hq)

#Adding a new column
fnames <- c(featureNames(params), "$P17")

out_data <- flowCore::flowFrame(all_data)

new_params <- flowCore::parameters(out_data)
flowCore::description(out_data) <- setNames(as.list((new_params)$desc), featureNames(new_params))
Biobase::featureNames(new_params) <- fnames

 

https://www.denovosoftware.com/site/manual/index.html?viewing_and_changing_fcs_file_.htm


 

But whenever I import it with

fcsparser-0.1.2-py3.5

 

I get this error:

UserWarning: The default channel names (defined by the $PnS parameter in the FCS file) were not unique. To avoid problems in downstream analysis, the channel names have been switched to the alternate channel names defined in the FCS file. To avoid seeing this warning message, explicitly instruct the FCS parser to use the alternate channel names by specifying the channel_naming parameter.

 

 

flowcore • 6.1k views
ADD COMMENT
2
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.2 years ago
(Private Address)

I am not sure what your 'all_data' is. To add new columns, you can use 'rbind2' method

library(flowCore)
data("GvHD")
fr <- GvHD[[1]]
#dummy column
new_col <- matrix(1:nrow(fr), nrow = nrow(fr), ncol = 1, dimnames = list(NULL, "new_col"))
fr <- cbind2(fr, new_col)

And then you need to modify the 'phenoData' and 'descriptions' accordingly

> params <- parameters(fr)
> pData(params)
           name              desc range minRange maxRange
$P1       FSC-H        FSC-Height  1024        0     1023
$P2       SSC-H        SSC-Height  1024        0     1023
$P3       FL1-H         CD15 FITC  1024        1    10000
$P4       FL2-H           CD45 PE  1024        1    10000
$P5       FL3-H        CD14 PerCP  1024        1    10000
$P6       FL2-A              <NA>  1024        0     1023
$P7       FL4-H          CD33 APC  1024        1    10000
$P8        Time Time (51.20 sec.)  1024        0     1023
new_col new_col              <NA>    NA        1     3420

As you see, `pData` is a data.frame, it is easy to change the rownames 

and fcs keywords are stored in description, 

desc <- description(fr)

you can modify it as you need

 

 

ADD COMMENT

Login before adding your answer.

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