[BioC] Plot Multiple 'Backgates' Simultaneously flowViz

Aric Gregson a.gregson at ucla.edu
Thu Nov 24 03:14:09 CET 2011


Hello,

I'm wondering if there is a way to demonstrate multiple back-gated
populations within the same xyplot with smooth=F. 

For example, we create a gate based upon a previously defined
quadrantGate:

> rect.eff.cd8.gate <- rectangleGate("PerCP.Cy5.5.A"=c(0,
+ quadGate.memory.CD8 at boundary[[1]]), "PE.Cy7.A"=c(0,
+ quadGate.memory.CD8 at boundary[[2]]), filterId="CD8_EFFECTOR")

Using xyplot with smooth=FALSE and this gate as the filter, I can
create a backgate of sorts into another population as follows:

xyplot(`PE.A` ~ `Alexa.Fluor.700.A`,
        Data(wf[['CD8+']]),
        filter=rect.eff.cd8.gate,
        smooth=F,             
        par.strip.text=list(cex=0.7),
        par.settings= list(gate=list(col="purple", alpha=.3))
       )

which appears to overplot the gated cells in purple. This is a nice
feature to use once in a while. It would be even nicer if I could
overplot several different gates at the same time with different
colors. I have tried using the following function in a plot call: 

> my.panel <- function(x, y, ..., frame, my.filter)
+ { 
+  panel.xyplot(x, y, ...)
+  glpolygon(filter(frame, my.filter))
+ }

or the following which will plot multiple filters as long as all
channel names are the same, but complains that channel names do not
match when attempting the backgating:

> xyplot( `SSC-H` ~ `FSC-H` , data=GvHD[[1]],
+        panel = function(...) { 
+        panel.xyplot.flowset(...)
+        glpolygon( Filter1 )
+        glpolygon( Filter2 )
+        }
+        )

I have also tried to replace 'glpolygon' with 'gpoints' to no effect.
Using a filter.result does not change the situation either. 

I suspect this is possible to do if one has a better understanding of
lattice. Thanks in advance for any suggestions.

Aric



More information about the Bioconductor mailing list