[BioC] flowViz xyplot smooth=F gate outline ONLY

Aric Gregson a.gregson at ucla.edu
Fri Jul 3 18:21:36 CEST 2009


--On June 26, 2009 2:40:58 PM -0700 Deepayan Sarkar 
<deepayan.sarkar at gmail.com> wrote:

> On Wed, Jun 24, 2009 at 4:15 PM, Aric Gregson<a.gregson at ucla.edu> wrote:
[snip]
>>
>> 1) ONLY outline the gated cells rather than color and outline the
>> cells. I have not found a way to do this. The best I have managed is in
>> the example below, which overdraws with a light rose color. Setting
>> fill = "transparent" appears to have no effect.
>>
>> 2) Apply this type of plot to a flowSet. I have not figured this out
>> yet either. Replacing panel.xyplot.flowframe with panel.xyplot.flowset
>> fails.
>
> Looks like you are calling panel.xyplot.flowframe() only to draw the
> gate. That's not necessary; you can call glpolygon() directly. For
> example,
>
> library(flowViz)
> data(GvHD)
>
> my.panel <- function(x, y, ..., frame, my.filter)
> {
>     cols <-
>         densCols(x, y, nbin=128,
>                  colramp = colorRampPalette(rainbow(7)))
>     panel.xyplot(x, y, col = cols, ...)
>     glpolygon(filter(frame, my.filter))
> }
[snip]

This works beautifully. Thank you.

> The details may need to be tweaked depending on your filter. This is
> harder to generalize for flowSets so that all kinds of filters are
> handled, but specific types are simple:
>
> xyplot(`FSC-H` ~ `SSC-H`, GvHD[1:4],
>        my.filter = norm2Filter("SSC-H", "FSC-H"),
>        pch = 21, cex = 0.3,
>        panel = function(x, frames, channel.x, channel.y, ...) {
>            nm <- as.character(x)
>            x <- flowViz:::evalInFlowFrame(channel.x, frames[[nm]])
>            y <- flowViz:::evalInFlowFrame(channel.y, frames[[nm]])
>            my.panel(x, y, frame = frames[[nm]], ...)
>        })

This also works very well so far. Thank you very much. I never would have 
figured out this syntax. Sorry for the delay in responding, but I had to 
update R, there seems to be trouble with the densCols function in earlier 
versions.

Thanks again!

Aric



More information about the Bioconductor mailing list