Last data update: 2014.03.03
R: Class GatingHierarchy
GatingHierarchy-class R Documentation
Class GatingHierarchy
Description
GatingHierarchy is a class for representing the gating hierarchy,which can be either imported from a flowJo workspace or constructed in R.
Details
There is a one-to-one correspondence between GatingHierarchy objects and FCS files in the flowJo workspace.
Each sample (FCS file) is associated with it's own GatingHierarchy. It is also more space efficient by storing gating results as logical/bit vector instead of copying the raw data.
Given a GatingHierarchy, one can extract the data associated with any subpopulation, extract gates, plot gates, and extract population proportions. This facilitates the comparison of manual gating methods with automated gating algorithms.
See Also
GatingSet
Examples
require(flowWorkspaceData)
d<-system.file("extdata",package="flowWorkspaceData")
wsfile<-list.files(d,pattern="A2004Analysis.xml",full=TRUE)
ws <- openWorkspace(wsfile);
G<-try(parseWorkspace(ws,path=d,name=1));
gh <- G[[1]]
getPopStats(gh);
plotPopCV(gh)
nodes <- getNodes(gh)
thisNode <- nodes[4]
plotGate(gh,thisNode);
getGate(gh,thisNode);
getData(gh,thisNode)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(flowWorkspace)
Loading required package: flowCore
Loading required package: flowViz
Loading required package: lattice
Loading required package: ncdfFlow
Loading required package: RcppArmadillo
Loading required package: BH
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/flowWorkspace/GatingHierarchy-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GatingHierarchy-class
> ### Title: Class GatingHierarchy
> ### Aliases: GatingHierarchy-class show,GatingHierarchy-method
>
> ### ** Examples
>
> require(flowWorkspaceData)
Loading required package: flowWorkspaceData
> d<-system.file("extdata",package="flowWorkspaceData")
> wsfile<-list.files(d,pattern="A2004Analysis.xml",full=TRUE)
> ws <- openWorkspace(wsfile);
> G<-try(parseWorkspace(ws,path=d,name=1));
Parsing 2 samples
mac version of flowJo workspace recognized.
Creating ncdfFlowSet...
All FCS files have the same following channels:
FSC-A
FSC-H
FSC-W
SSC-A
SSC-H
SSC-W
Am Cyan-A
Am Cyan-H
Pacific Blue-A
Pacific Blue-H
APC-A
APC-H
APC-CY7-A
APC-CY7-H
Alexa 700-A
Alexa 700-H
FITC-A
FITC-H
PerCP-CY5-5-A
PerCP-CY5-5-H
PE-CY7-A
PE-CY7-H
Time
done!
loading data: /home/ddbj/local/lib64/R/library/flowWorkspaceData/extdata/a2004_O1T2pb05i_A1_A01.fcs
Compensating
gating ...
write a2004_O1T2pb05i_A1_A01.fcs_61832 to empty cdf slot...
loading data: /home/ddbj/local/lib64/R/library/flowWorkspaceData/extdata/a2004_O1T2pb05i_A2_A02.fcs
Compensating
gating ...
write a2004_O1T2pb05i_A2_A02.fcs_45363 to empty cdf slot...
done!
> gh <- G[[1]]
> getPopStats(gh);
flowCore.freq flowJo.freq flowJo.count flowCore.count node
1: 1.000000000 1.000000000 61832 61832 root
2: 0.800297581 0.801235606 49542 49484 Live
3: 0.084027160 0.083585645 4141 4158 APC
4: 0.592352092 0.548418256 2271 2463 B Cell
5: 0.123376623 0.121226757 502 513 mDC
6: 0.005847953 0.003984064 2 3 mDC/IFNa+
7: 0.042884990 0.043824701 22 22 mDC/IL-6+
8: 0.005847953 0.003984064 2 3 mDC/IL-12+
9: 0.140350877 0.141434263 71 72 mDC/TNFa+
10: 0.107984608 0.107703453 446 449 pDC
11: 0.002227171 0.002242152 1 1 pDC/IFNa+
12: 0.000000000 0.000000000 0 0 pDC/IL-6+
13: 0.561247216 0.560538117 250 252 pDC/IL-12+
14: 0.000000000 0.000000000 0 0 pDC/TNFa+
15: 0.544074852 0.540854225 26795 26923 CD14-MHC2-
16: 0.058928138 0.059161923 2931 2916 Monocytes
17: 0.003772291 0.004435346 13 11 Monocytes/IFNa+
18: 0.237654321 0.236779256 694 693 Monocytes/IL-6+
19: 0.047325103 0.049812351 146 138 Monocytes/IL-12+
20: 0.250685871 0.257250085 754 731 Monocytes/TNFa+
> plotPopCV(gh)
> nodes <- getNodes(gh)
> thisNode <- nodes[4]
> plotGate(gh,thisNode);
> getGate(gh,thisNode);
Polygonal gate 'B Cell' with 24 vertices in dimensions <Am Cyan-A> and <APC-A>
> getData(gh,thisNode)
flowFrame object '1be493f5-51dd-4359-b2ed-524cd104eb5f'
with 2463 cells and 23 observables:
name desc range minRange maxRange
$P1 FSC-A <NA> 262254.000 -111.00000 262143.000
$P2 FSC-H <NA> 262143.000 0.00000 262143.000
$P3 FSC-W <NA> 262143.000 0.00000 262143.000
$P4 SSC-A <NA> 262254.000 -111.00000 262143.000
$P5 SSC-H <NA> 262143.000 0.00000 262143.000
$P6 SSC-W <NA> 262143.000 0.00000 262143.000
$P7 <Am Cyan-A> CD123 3661.959 435.34379 4097.303
$P8 Am Cyan-H CD123 3641.837 455.00000 4096.837
$P9 <Pacific Blue-A> IL-12 3927.974 169.60860 4097.582
$P10 Pacific Blue-H IL-12 3641.837 455.00000 4096.837
$P11 <APC-A> CD11c 4405.818 -308.01302 4097.805
$P12 APC-H CD11c 3641.837 455.00000 4096.837
$P13 <APC-CY7-A> IL-6 3714.446 382.93207 4097.378
$P14 APC-CY7-H IL-6 3641.837 455.00000 4096.837
$P15 <Alexa 700-A> TNFa 3712.753 384.62271 4097.376
$P16 Alexa 700-H TNFa 3641.837 455.00000 4096.837
$P17 <FITC-A> IFNa 4180.519 -82.81306 4097.706
$P18 FITC-H IFNa 3641.837 455.00000 4096.837
$P19 <PerCP-CY5-5-A> MHCII 4942.398 -844.59317 4097.805
$P20 PerCP-CY5-5-H MHCII 3641.837 455.00000 4096.837
$P21 <PE-CY7-A> CD14 4942.398 -844.59317 4097.805
$P22 PE-CY7-H CD14 3641.837 455.00000 4096.837
$P23 Time <NA> 99.184 0.89000 100.074
322 keywords are stored in the 'description' slot
>
>
>
>
>
> dev.off()
null device
1
>