Thank you Seth, Nolwenn, upgrading to the latest releases makes this script work exactly as I wanted it.

Nolwenn LeMeur <nlemeur@fhcrc.org> wrote:  
Hi Jab,

Thanks you for using rflowcyt. 

I have created the plotdensity.FCS function to perform some 
data quality assessment on 'raw' data but I believe you can use it on 
gated data. Depending on your gating approach, I think you can still read all your 
files at once with the read.series.FCS function, which only build a list 
of FCS.object.

Below are 2 dummy examples that, I think, do what you want:

library(rflowcyt)

if (require(rfcdmin)) {
##Obtain the location of the fcs files 
pathFiles<-system.file("bccrc", package="rfcdmin")
drugFiles<-dir(pathFiles)

## Read a serie of FCS files
drugData<-read.series.FCS(drugFiles,path=pathFiles,MY.DEBUG=FALSE)

}

##---- First method ------
##Gate your first sample
gate1.range.x <- c(200, 600)
gate1.range.y <- c(200, 600)
gateSample1 <- createGate(drugData[[1]], varpos = c(1, 2), gatingrange = 
c(gate1.range.x,
gate1.range.y), type = "bidcut", comment = "first gate")

##Gate your second
gate2.range.x <- c(300, 600)
gate2.range.y <- c(300, 600)
gateSample2 <- createGate(drugData[[2]], varpos = c(1, 2), gatingrange = 
c(gate2.range.x,
gate2.range.y), type = "bidcut", comment = "first gate")

##Extract data
gateS1 <- extractGatedData(gateSample1,gateNum=1,IndexValue.In=1)
gateS2 <- extractGatedData(gateSample2,gateNum=1,IndexValue.In=1)

##Combine in a list
foo <- list(gateS1,gateS2)

##Draw a density plot for the Foward SCatter parameter for the
##differents aliquots (of the same cell line) tested with different
##compounds.
plotdensity.FCS(foo,varpos=c(1),main="Gated FSC values",ylim=c(0,0.01),ylab="Density of cells")


##----------Second Method---------

##If the definition of your gate is the same for every sample

gate.range.x <- c(200, 600)
gate.range.y <- c(200, 600)

gatedDrugData <- lapply(drugData,function(x) createGate(x, varpos = c(1, 
2), gatingrange = c(gate.range.x,
gate.range.y), type = "bidcut", comment = "first gate"))

gatedData <- lapply(gatedDrugData,function(x) 
extractGatedData(x,gateNum=1,IndexValue.In=1))

plotdensity.FCS(gatedData,varpos=c(1),main="Gated FSC values",ylim=c(0,0.01),ylab="Density of cells")


Hope it helps,
Nolwenn


**************************************
Nolwenn Le Meur, PhD
Fred Hutchinson Cancer Research Center
Computational Biology
1100 Fairview Ave. N., M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

On Tue, 22 Aug 2006, Jabez Wilson wrote:

> Hi, I've been going through examples in the excellent "rflowcyt" package, and have a question about the read.series.FCS function.
> The RFlowCyt users guide gives a nice example of reading in 8 FCS files into a data series using read.series.FCS, and then printing them out on the same graph e.g.
> 
> plotdensity.FCS(drug.fluors, varpos = c(1), main = "FSC for aliquots \ntreated with different compounds", ylim = c(0, 0.005), ylab = "Density of cells").
> 
> What I would like to do would be to read in these files separately, perform gating and extract the gated data, and then combine the subsequent gated FCS objects into a data series and plot them on the same graph. Is there an easy way to do this? Is it something to do with the myFCSobj.name="" argument in read.FCS function. 
> Any help/guidance appreciated
> Jab
> 
> 
> ---------------------------------
> 
> [[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
> 


 		
---------------------------------

	[[alternative HTML version deleted]]

