[BioC] Help with flowCore Package: Working through the HowTo

Byron Ellis byron.ellis at gmail.com
Tue Jun 19 00:32:37 CEST 2007

On 6/18/07, M. Jankowski <mjankowski at gmail.com> wrote:
> Hi all,
> As you can see, I have some pretty far outliers in all the data sets.
> What procedure would I follow to gate the data to less than 800 for
> "FSC.H" and "SSC.H"? Further, how would I plot the result of the gated
> data? In the context of the HowTo I would call my question "2.1.4:
> Gating and Plotting a flowFrame"

Section 4 of the How To is entirely about filtering/gating with 4.3
being the section relevant to your question. In your case you probably
want a rectangleGate of some sort. For example,


would cut your frame down to size. As for plotting, this is somewhat
more difficult. The flowViz package has some facilities for plotting a
gate onto a plot of the data, but you'd have to ask Deepayan about
that---I've never actually used it.

> The flowSet discussion in the HowTo does cover filtering and gating.
> When I attempt to read my file in as a flowset I get errors.
> Section 2.2.1 give the instruction:
> > frames <- lapply(dir(system.file("extdata", "compdata", "data",
> +     package = "flowCore"), full.names = TRUE), read.FCS)
> > as(frames, "flowSet")

When reading from files it is almost always best to use read.flowSet,
which automates much of this process.

> I'm not certain how to put my "/home/mdj/Rdata/" directory into the
> context of the system.file function. Here is my best attempt:
> > frames <= lapply("/home/mdj/data/Rdata/", readFCS)

Your example differs from the example in the How To in two ways.
First, the lapply() is actually performed on the directory listing.
For example,


is more likely to do what you want. The inclusion of a pattern ensures
that only things with the "fcs" extension will be used. However, it
mostly serves as an example by way of construction so you shouldn't
need to use it unless you need to do something that read.flowSet
cannot (like grab the FCS files from URLS or something).

Also, you have <= instead of <-. <= is an inequality. Personally, I
hate <- with a passion (b[b<-1] = 0. Whoops.) and thus tend to use
just =, unless it is impossible for some reason (very rarely).

> Error: object "frames" not found
> When I attempt "read.flowSet":
> > read.flowSet("/home/mdj/Rdata/")

This is because the first parameter of read.flowSet is actually a
pattern not a path (I know, the opposite of dir... but this is the way
things go). This is because you're usually in the same directory as
your FCS files. You actually want:


or something similar.

> These errors have me stumped. I think the organization of this library
> is quite keen. I like the flowFrame object in what I think of as a
> flowSet vector (with nice header). Would someone show me how to:
> 1) gate my data for the 'flowFrame' object and then plot the gated data?

> 2) work my way through creating a flowSet object? I think my main
> problem is that I am clumsy with the system.file syntax.
> My apologies if these questions are answered elsewhere. If this is the
> case please point me in the right direction.
> Any and all help is appreciated. Thanks!

Hope that helps.

> Matt
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

Byron Ellis (byron.ellis at gmail.com)
"Oook" -- The Librarian

More information about the Bioconductor mailing list