Search
Question: How to edit parameters and description of fcs file
0
gravatar for crysis405
2.2 years ago by
crysis40510
crysis40510 wrote:

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.

 

 

ADD COMMENTlink modified 2.2 years ago by Jiang, Mike1.1k • written 2.2 years ago by crysis40510
2
gravatar for Jiang, Mike
2.2 years ago by
Jiang, Mike1.1k
(Private Address)
Jiang, Mike1.1k wrote:

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 COMMENTlink written 2.2 years ago by Jiang, Mike1.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 317 users visited in the last hour