FlowViz plot gate (node) Names together with statistics
2
0
Entering edit mode
y.klaver • 0
@yklaver-12027
Last seen 7.1 years ago

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

bioconductor flowcore flowviz flowstats • 1.9k views
ADD COMMENT
1
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.2 years ago
(Private Address)

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 COMMENT
0
Entering edit mode
y.klaver • 0
@yklaver-12027
Last seen 7.1 years ago

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 COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode
Thx! I'll give it a try!
ADD REPLY
0
Entering edit mode

It works like a charm!

Thanks you're the best!

 

gr. 

Yarne

ADD REPLY

Login before adding your answer.

Traffic: 533 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6