[BioC] flowViz xyplot smooth=F gate outline ONLY

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Jun 26 23:40:58 CEST 2009


On Wed, Jun 24, 2009 at 4:15 PM, Aric Gregson<a.gregson at ucla.edu> wrote:
> Hello,
>
> I am trying to use code from a presentation of Deepayan that I found
> on the web. The code does a nice job a presenting density information in
> the flowViz xyplot utilizing a more traditional appearance as found in
> other flow software while still ploting all points. I would like to
> use this as an occasional alternative to relying upon the alpha setting
> to depict density. With this code, I would like to:
>
> 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))
}


xyplot(`FSC-H` ~ `SSC-H`, GvHD[[1]],
       my.filter = norm2Filter("SSC-H", "FSC-H"),
       pch = 21, cex = 0.3,
       panel = my.panel)


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]], ...)
       })

-Deepayan


>
> Any hints would be greatly appreciated.
>
> xyplot(`Indo.1..Violet..A` ~ `APC.H7.A`, Data(wf[["logicle"]])
> [[4]],
>       smooth=F,
>       pch=21,
>       cex=0.3,
>       aspect="iso",
>       panel = function(x, y, col, ...) {
>         cols <-
>           densCols(x, y,
>                 nbin=128,
>                 colramp = colori)
>         panel.xyplot(x, y, col = cols, ...)
>         panel.xyplot.flowframe(x, y, filter=livefilter, outline=TRUE,
>                names=TRUE, col="transparent", ...) },
>       par.settings=list(gate=list(col= cols, fill= cols, alpha=.9),
>         gate.text=list(col="black", alpha=0.7, cex=0.6)))
>
> Thanks in advance.
>
> Aric
> ============================
>
> R version 2.8.0 (2008-10-20)
> i386-pc-solaris2.11
>
> locale:
> C
>
> attached base packages:
> [1] tools     stats     graphics  grDevices utils     datasets
> methods [8] base
>
> other attached packages:
>  [1] geneplotter_1.20.0  annotate_1.20.1     xtable_1.5-4
>  [4] AnnotationDbi_1.4.1 colorspace_1.0-0    flowViz_1.7.10
>  [7] lattice_0.17-20     flowCore_1.9.18     rrcov_0.4-07
> [10] robustbase_0.4-3    Biobase_2.2.1       Hmisc_3.4-4
>
> loaded via a namespace (and not attached):
>  [1] DBI_0.2-4          KernSmooth_2.22-22 MASS_7.2-44
> RColorBrewer_1.0-2 [5] RSQLite_0.7-1      cluster_1.11.11
> feature_1.1-14     graph_1.20.0 [9] grid_2.8.0
> latticeExtra_0.5-4 stats4_2.8.0       tcltk_2.8.0
>
> _______________________________________________
> 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
>



More information about the Bioconductor mailing list