Hi everyone,
Just a small question concerning the visualisation of my gating strategy. I would like to add the gatename to the plotted gates and additionally the statistics.
I used the following script, but I can only get the gate names (names=T, stats=F) or the stats (names=F, stats=T).
#### load flowSet
frames_raw <- lapply(files, full.names=TRUE, alter.names=T, read.FCS)
frames_raw <- as(frames_raw, "flowSet")
keyword(frames_raw[[1]],c("$FIL"))
read.flowSet(files = files, name.keyword = c("$FIL"),alter.names = T)
####transform raw df
tf <- transformList(colnames(frames_raw)[5:15], tfun = log10, transformationId = "log")
tf
frames <- transform(frames_raw, tf)
phenoData(frames)
phenoData(frames)$Filename <- c("Pt1","Pt2") #fsApply(frames,keyword, "$FIL")
pData(frames)
############## gatingset ############
gating_frames <- GatingSet(frames)
gating_frames
getNodes(gating_frames[[1]]) #only contains root node
#add first gate
CD3 <- rectangleGate("FITC.A"=c(1.5, 3.5), "SSC.H"=c(0,250), filterId="CD3")
nodeID <- add(gating_frames, CD3) #it is added to root node by default if parent is not specified
getNodes(gating_frames[[1]]) #the second population is named after filterId of the gate
#add a quadGate
CD4_CD8 <- quadGate("PE.Cy7.A"=2, "APC.Cy7.A"=2)
nodeIDs <- add(gating_frames, CD4_CD8, parent="CD3", names = c("CD8", "DPT", "CD4", "DNT"))
nodeIDs #quadGate produces four population nodes
getNodes(gating_frames[[1]]) #population names are named after dimensions of gate if not specified
recompute(gating_frames)
#plot gates
plotGate(x=gating_frames[[1]],y=getNodes(gating_frames)[-c(1,4,6)],
names=T,
stats=T,
gpar = c(nrow = 1),
xbin=0,
path="full",
pos=c(0.6,0.9),
overlayNode=CD3,
par.settings=list(gate=list(fill="red", alpha=.2, col="black"), #fill="red
gate.text=list(col="black", alpha=0.7, cex=1, lineheight=5),
panel.background = list(col = "white"),
add.text = list(col="black", alpha=0.7, cex=1, padding=3))
)
how can I fix this? It drives me mad!
Thanks in advance!
Kind Regards
Yarne
I've pushed the fix to 'flowViz 1.39.1', which shows both `gate name` and `stats` when you set 'names = TRUE' (btw, no need to set 'stats' when you are plotting gates from 'GatingSet')
It works like a charm!
Thanks you're the best!
gr.
Yarne