library(flowCore)
library(flowWorkspace)
library(cytoqc)
# library(printr)
# library(DT)
path <- "~/remote/fh/fast/gottardo_r/mike_working/lyoplate_out/parsed"
centers <- c('BIIR','CIMR','Miami','NHLBI','Stanford','UCLA','Yale')
panel <- "tcell"
gslist <- sapply(centers, function(center) {
message("Center: ", center)
gs <- load_gs(file.path(path, center, panel))
})
cqc_data <- cqc_gs_list(gslist)
#group by gates
groups <- cqc_check(cqc_data, "gate")
groups
group\_id
nGatingSet
gate
2
5
4- 8+, 4- 8+/38- DR-, 4- 8+/38- DR+, 4- 8+/38+ DR-, 4- 8+/38+ DR+, 4-
8+/CCR7- 45RA-, 4- 8+/CCR7- 45RA+, 4- 8+/CCR7+ 45RA-, 4- 8+/CCR7+ 45RA+,
4+ 8-, 4+ 8-/38- DR-, 4+ 8-/38- DR+, 4+ 8-/38+ DR-, 4+ 8-/38+ DR+, 4+
8-/CCR7- 45RA-, 4+ 8-/CCR7- 45RA+, 4+ 8-/CCR7+ 45RA-, 4+ 8-/CCR7+ 45RA+,
CD3, DNT, DPT, LYM, not dead, root, singlets
1
2
4- 8+, 4- 8+/38- DR-, 4- 8+/38- DR+, 4- 8+/38+ DR-, 4- 8+/38+ DR+, 4-
8+/CCR7- 45RA-, 4- 8+/CCR7- 45RA+, 4- 8+/CCR7+ 45RA-, 4- 8+/CCR7+ 45RA+,
4+ 8-, 4+ 8-/38- DR-, 4+ 8-/38- DR+, 4+ 8-/38+ DR-, 4+ 8-/38+ DR+, 4+
8-/CCR7- 45RA-, 4+ 8-/CCR7- 45RA+, 4+ 8-/CCR7+ 45RA-, 4+ 8-/CCR7+ 45RA+,
CD3, DNT, DPT, LYM, not dead,
root
diff(groups)
group\_id
nGatingSet
gate
2
5
singlets
#vis the difference
# plot_diff(groups)
# match reference
match_result <- cqc_match(groups, ref = 1)
# match_result
cqc_fix(match_result)
cqc_check(cqc_data, "gate")
group\_id
nGatingSet
gate
1
7
4- 8+, 4- 8+/38- DR-, 4- 8+/38- DR+, 4- 8+/38+ DR-, 4- 8+/38+ DR+, 4-
8+/CCR7- 45RA-, 4- 8+/CCR7- 45RA+, 4- 8+/CCR7+ 45RA-, 4- 8+/CCR7+ 45RA+,
4+ 8-, 4+ 8-/38- DR-, 4+ 8-/38- DR+, 4+ 8-/38+ DR-, 4+ 8-/38+ DR+, 4+
8-/CCR7- 45RA-, 4+ 8-/CCR7- 45RA+, 4+ 8-/CCR7+ 45RA-, 4+ 8-/CCR7+ 45RA+,
CD3, DNT, DPT, LYM, not dead, root
groups <- cqc_check(cqc_data, "channel")
groups
group\_id
nGatingSet
channel
1
1
\, \, \, \, \, \, \, \, FSC-A, SSC-A,
Time
2
1
\, \, \, \, \,
\, \, \, FSC-A, FSC-H, FSC-W, SSC-A,
SSC-H, SSC-W, Time
3
1
\, \, \, \, \,
\, \, \, FSC-A, FSC-W, SSC-A,
SSC-W, Time
4
1
\, \, \, \, \,
\, \, \, FSC-A, SSC-A, Time
5
1
\, \, \, \,
\, \, \, \, FSC-A, FSC-H,
FSC-W, SSC-A, SSC-H, SSC-W, Time
6
1
\, \, \, \, \,
\, \, \, FSC-A, FSC-H, SSC-A, SSC-H,
Time
7
1
\, \, \, \, \, \,
\, \, FSC-A, FSC-H, FSC-W, SSC-A, SSC-H, SSC-W, Time
groups <- cqc_check(cqc_data, "marker")
groups
group\_id
nGatingSet
marker
6
2
CD197, CD3, CD38, CD4, CD45RA, CD8, HLA-DR, Live Green
1
1
CCR7 PE, CD3 V450, CD38 APC, CD4 PerCP-Cy55, CD45RA PE-Cy7, CD8 APC-H7,
HLA-DR V500, Live Dead FITC
2
1
CCR7, CD3, CD38, CD4, CD45RA, CD8, HLA DR, Live/Dead
3
1
CCR7, CD3, CD38, CD4, CD45RA, CD8, HLA-DR, LIVE
4
1
CCR7, CD3, CD38, CD4, CD45RA, CD8, HLADR, LIVE\_GREEN
5
1
CD197, CD3, CD38, CD4, CD45RA, CD8, HLA-DR, LIVE DEAD
res <- cqc_match(groups, ref = 3)
res
res <- cqc_match(groups, ref = 3, max.distance = 0.6)
res
res <- cqc_update_match(res, group = 1, map = c("CD4 PerCP-Cy55" = "CD4"
, "CD8 APC-H7" = "CD8"
, "Live Dead FITC" = "LIVE")
)
res
cqc_fix(res)
groups <- cqc_check(cqc_data, "marker")
groups
group\_id
nGatingSet
marker
1
7
CCR7, CD3, CD38, CD4, CD45RA, CD8, HLA-DR, LIVE
res <- cqc_check(cqc_data, "panel")
res
## # A tibble: 25 x 8
## channel `group 1(n=1)` `group 2(n=1)` `group 3(n=1)` `group 4(n=1)`
## <chr> <chr> <chr> <chr> <chr>
## 1 <Alexa… LIVE <NA> <NA> <NA>
## 2 <Am Cy… <NA> HLA-DR <NA> <NA>
## 3 <AmCya… HLA-DR <NA> HLA-DR <NA>
## 4 <APC-A> CD38 CD38 CD38 CD38
## 5 <APC-C… CD8 CD8 CD8 CD8
## 6 <APC-H… <NA> <NA> <NA> <NA>
## 7 <B515-… <NA> <NA> <NA> <NA>
## 8 <B710-… <NA> <NA> <NA> <NA>
## 9 <BD Ho… <NA> <NA> <NA> <NA>
## 10 <BD Ho… <NA> <NA> <NA> <NA>
## # … with 15 more rows, and 3 more variables: `group 5(n=1)` <chr>, `group
## # 6(n=1)` <chr>, `group 7(n=1)` <chr>
format(res, anchor = "marker")
## # A tibble: 8 x 8
## marker `group 1(n=1)` `group 2(n=1)` `group 3(n=1)` `group 4(n=1)`
## <chr> <chr> <chr> <chr> <chr>
## 1 CCR7 <PE YG-A> <PE-A> <PE-A> <PE-A>
## 2 CD3 <Pacific Blue… <Pacific Blue… <Pacific Blue… <V450-A>
## 3 CD38 <APC-A> <APC-A> <APC-A> <APC-A>
## 4 CD4 <PerCP-Cy5-5-… <PerCP-Cy5-5-… <PerCP-Cy5-5-… <PerCP-Cy5-5-…
## 5 CD45RA <PE-Cy7 YG-A> <PE-Cy7-A> <PE Cy7 YG-A> <PE-Cy7-A>
## 6 CD8 <APC-Cy7-A> <APC-Cy7-A> <APC-Cy7-A> <APC-Cy7-A>
## 7 HLA-DR <AmCyan-A> <Am Cyan-A> <AmCyan-A> <V500-A>
## 8 LIVE <Alexa Fluor … <FITC-A> <FITC-A> <FITC-A>
## # … with 3 more variables: `group 5(n=1)` <chr>, `group 6(n=1)` <chr>, `group
## # 7(n=1)` <chr>
cf <- gs_cyto_data(cqc_data[[1]])[[1]]
panel <- cf_get_panel(cf, skip_na = TRUE)
panel
## # A tibble: 8 x 2
## channel marker
## <I<chr>> <I<chr>>
## 1 <APC-A> CD38
## 2 <APC-H7-A> CD8
## 3 <FITC-A> LIVE
## 4 <PerCP-Cy5-5-A> CD4
## 5 <V450-A> CD3
## 6 <V500-A> HLA-DR
## 7 <PE-A> CCR7
## 8 <PE-Cy7-A> CD45RA
cqc_set_panel(cqc_data, panel, ref.col = "marker")
groups <- cqc_check(cqc_data, "panel")
groups
{"x":{"filter":"none","data":[["1","2","3","4","5","6","7","8"],["<APC-A>","<APC-H7-A>","<FITC-A>","<PE-A>","<PE-Cy7-A>","<PerCP-Cy5-5-A>","<V450-A>","<V500-A>"],["CD38","CD8","LIVE","CCR7","CD45RA","CD4","CD3","HLA-DR"]],"container":"<\/th>\n | channel<\/th>\n | group 1(n=7)<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"order":[],"autoWidth":false,"orderClasses":false,"columnDefs":[{"orderable":false,"targets":0}]}},"evals":[],"jsHooks":[]}
Refresh QC report
group\_id
nGatingSet
channel
1
3
\, \, \, \, \,
\, \, \, FSC-A, FSC-H, FSC-W, SSC-A,
SSC-H, SSC-W, Time
4
2
\, \, \, \, \,
\, \, \, FSC-A, SSC-A, Time
2
1
\, \, \, \, \,
\, \, \, FSC-A, FSC-H, SSC-A, SSC-H,
Time
3
1
\, \, \, \, \,
\, \, \, FSC-A, FSC-W, SSC-A, SSC-W,
Time
group\_id
nGatingSet
channel
1
3
FSC-H, FSC-W, SSC-H, SSC-W
2
1
FSC-H, SSC-H
3
1
FSC-W, SSC-W
Remove
|
---|