Load csf files with read.flowSet()
2
0
Entering edit mode
@marongiuluigi-7134
Last seen 9 months ago
European Union

Dear all,

I would like to learn how to use flowCore etc to analyze my flow cytometry data and I am currently using the "flowCore: data structures package for flow cytometry data" (20/5/14) [the 24/10/14 version seems more or less similar]. 

I used the read.flowSet() function as reported at page 11, but I got exactly the results from the vignette rather than from actual files, which means I am not reading from the working directory. I reckon I should use the 'files', 'name.keyword' and 'phenoData' arguments but I don't know how.

So far, what I have tried is:

    fs <- read.flowSet(
            path = system.file("extdata", "compdata", "data", package="flowCore"),
            name.keyword = "SAMPLE ID",
            phenoData = list(names = "SAMPLE ID", Filenames = "$FIL")
            )

    pData(phenoData(fs))  

which gives:

     name names  Filenames
NA     NA    NA 060909.001
fitc fitc  fitc 060909.002
pe     pe    pe 060909.003
apc   apc   apc 060909.004
7AAD 7AAD  7AAD 060909.005

 

and:

fcs.loc <- system.file("extdata",package="flowCore")
file.location <- paste(fcs.loc, dir(fcs.loc), sep="/")
samp <- read.flowSet(file.location[1:3])    
pData(phenoData(samp))    

Whose result is:

                         name
0877408774.B08 0877408774.B08
0877408774.E07 0877408774.E07
0877408774.F06 0877408774.F06

 

 

 

The name of the files I am using, present in the working directory, are:

sample.set <-c(
"Compensation Controls_HOE 405-450,2f,50 Stained Control_004.fcs",
"Compensation Controls_PY 488-575,2f,26 Stained Control_005.fcs",
"Compensation Controls_Unstained Control_003.fcs",
"samples_stimulated_001.fcs",
"Specimen_001_stim_002.fcs",
"Specimen_001_unstim_001.fcs"
)

Any hints?

Thank you.

Regards,

Luigi

 

read.flowSet() flowcore • 1.4k views
ADD COMMENT
0
Entering edit mode
Greg Finak ▴ 150
@greg-finak-4594
Last seen 3.3 years ago
(Private Address)

Hi, Luigi

The solution here is not as mysterious as it appears. You see that read.flowSet takes some parameters (the vector of fcs file names) and reads them in. In your case you are reading in the files stored `file.location` but you would like to read in the files stored in `sample.set`.

Simply pass `sample.set` to `read.flowSet`  

```

samp <- read.flowSet(sample.set)

```

As long as the files are accessible to R (they're in the working directory or use a full pathname) they'll be read in.

R has a great help system, by the way. If you want to know what read.flowSet, or another function does, type

?read.flowSet

 at the R prompt. The help describes the function and its arguments as well as providing examples.

 

Greg

ADD COMMENT
0
Entering edit mode
@marongiuluigi-7134
Last seen 9 months ago
European Union

Dear Greg,

thank you for the reply and sorry for the naivety. I ran the suggestion you gave me, and it does work indeed, although I obtained the error:

Warning messages:
In readBin(con = con, what = dattype, n = count, size = size, signed = signed,  :
  'signed = FALSE' is only valid for integers of sizes 1 and 2

for each of the experiments loaded. Am I missing something?

Regards

Luigi

ADD COMMENT
1
Entering edit mode

The latest flowCore release (1.32.2) should fix this warning.

ADD REPLY

Login before adding your answer.

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