Question: FlowViz plot gate (node) Names together with statistics
0
gravatar for y.klaver
2.3 years ago by
y.klaver0
y.klaver0 wrote:

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

ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by y.klaver0
Answer: FlowViz plot gate (node) Names together with statistics
1
gravatar for Jiang, Mike
2.3 years ago by
Jiang, Mike1.2k
(Private Address)
Jiang, Mike1.2k wrote:

With the latest development branch of `flowWorkspace`, you can show the gate name in strip, see https://github.com/RGLab/flowWorkspace/commit/ac3a52cf0c6348c28a48ec21867efdce3690fabf

e.g.

plotGate(x=gating_frames[[1]],y=getNodes(gating_frames, path = "full")[-c(1,4,6)],strip.text = "gate", ...)

 

Hope this helps.

ADD COMMENTlink written 2.3 years ago by Jiang, Mike1.2k
Answer: FlowViz plot gate (node) Names together with statistics
0
gravatar for y.klaver
2.3 years ago by
y.klaver0
y.klaver0 wrote:

Hi, Thanks for your help, but it is not exactly what I meant.

Basically, I now can plot 2 options: http://imgur.com/a/ECnWn --> (img 1 + 2)

  1. or the gate with gatename, or
  2. the gate with stats. 

What I want is the gatename + stats. (img 3) http://imgur.com/a/ECnWn

 

Is this possible?

 

grtz, Yarne

ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by y.klaver0
1

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')

ADD REPLYlink written 2.2 years ago by Jiang, Mike1.2k
Thx! I'll give it a try!
ADD REPLYlink written 2.2 years ago by y.klaver0

It works like a charm!

Thanks you're the best!

 

gr. 

Yarne

ADD REPLYlink written 2.2 years ago by y.klaver0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 328 users visited in the last hour