[BioC] Overlay Density Plot for FlowSet

Aric Gregson a.gregson at ucla.edu
Sat Oct 4 04:08:35 CEST 2008


Florian,

Sorry about the poor explanation and thanks very much for your help. I
keep rereading everything I can find on flowCore/Viz and continue to
figure out more details as I go.

On Fri, 03 Oct 2008 13:31:57 -0700
Florian Hahne <fhahne at fhcrc.org> wrote:

> Is your data one-dimensional, i.e., do you want to compare the
> densities (or histograms) of a single fluorescence parameter for
> several tubes?

That is exactly what I want to do. Your densityplot example works
just fine, I am not sure why I didn't try that combination before
(never tried the 'name' part). I just have to figure out how to
annotate it and get the y-axis to have labels.

densityplot(name[order(c(5,4))] ~ `FL2.W`, CD3.4.fp3Live.subset[c
(5,4)], overlap=10, alpha=0.7, filter= rectCCR7.filter)

However, I cannot seem to get the gate to display on this plot. I
have tried adding filterResult with no effect. The gate is defined as:

= rectCCR7.filter
Rectangular gate with dimensions:
	FL2.W: (480,600)

which should give me a one-dimensional gate on FL2.W only. I have made
results and subsets of this gate from the CD3.4.fp3Live.subset above,
in case they have to be made prior to the gate being plotted. The
starting subsets, both before and after the single fluorescence
parameter gate is applied, have cells within the FL2.W channel: 

= CD3.4.fp3Live.subset[[7]]$`FL2.W`
flowFrame object '334-p1.000'
with 1529 cells and 1 observables:
     name     desc range minRange maxRange
$P7 FL2.W FL4-CCR7  1024        0     1023

= CD3.4.fp3Live.subset[[8]]$`FL2.W`
flowFrame object '334-p2.000'
with 1706 cells and 1 observables:
     name     desc range minRange maxRange
$P7 FL2.W FL4-Open  1024        0     1023

= CD3.4.fp3.ccr7.subset[[4]]$`FL2.W`
flowFrame object '334-p1.000'
with 21 cells and 1 observables:
     name     desc range minRange maxRange
$P7 FL2.W FL4-CCR7  1024        0     1023

= CD3.4.fp3.ccr7.subset[[5]]$`FL2.W`
flowFrame object '334-p2.000'
with 4 cells and 1 observables:
     name     desc range minRange maxRange
$P7 FL2.W FL4-Open  1024        0     1023

The flowFrames have different numbers because not all could be filtered
through the CCR7 gate (lacked cells).

> In the 2D situation you can't easily overlay xyplots, but  you can
> plot them in a trellis layout adding the gate as argument "filter"
> similar to the previous densityplot example. 

This I was able to do. I like this look, but others do not. Hence, my
histogram question.

> However, you can overlay contour plots:
> 
> cols <- rainbow(3, alpha=0.1)
> contour(CD3.4.fp3Live[c(1,5)], col=cols, fill=cols)

I cannot get the contour plots to work for me at all, I have been
trying for a while. I am clearly missing something. 

contour(fset1[c(7,8)], c("FL2.W", "FL1.H"), col=cols, fill=cols)
Error in r[i1] - r[-length(r):-(length(r) - lag + 1)] : 
  non-numeric argument to binary operator

contour(CD3.4.fp3Live.subset[c(7,8)], "FL2.W", col=cols, fill=cols)
Error in contour.default(CD3.4.fp3Live.subset[c(7, 8)], "FL2.W", col =
cols,  : no proper 'z' matrix specified

contour(CD3.4.fp3Live.subset[c(7,8)], col=cols, fill=cols)
Error in ceiling(length.out) : 
  Non-numeric argument to mathematical function

> Also please provide the output of sessionInfo() in future posts

Sorry about that, here it is:

= sessionInfo()
R version 2.7.0 (2008-04-22) 
i386-pc-solaris2.11 

locale:
C

attached base packages:
[1] tools     stats     graphics  grDevices utils     datasets
methods [8] base     

other attached packages:
 [1] flowViz_1.3.8      latticeExtra_0.3-1 lattice_0.17-6
RColorBrewer_1.0-2 [5] flowCore_1.5.21    Biobase_1.99.10
feature_1.1-13     KernSmooth_2.22-22 [9] rrcov_0.4-05
robustbase_0.2-8  

loaded via a namespace (and not attached):
[1] AnnotationDbi_1.1.35 DBI_0.2-4            MASS_7.2-41         
[4] RSQLite_0.6-8        geneplotter_1.17.8   grid_2.7.0          
[7] stats4_2.7.0         tcltk_2.7.0     

-- 
Aric Gregson <a.gregson at ucla.edu>



More information about the Bioconductor mailing list