diff --git a/README.Rmd b/README.Rmd index f46e41a..6886246 100644 --- a/README.Rmd +++ b/README.Rmd @@ -2,68 +2,101 @@ title: 'ggcyto : Visualize `Cytometry` data with `ggplot`' output: html_document: - fig_height: 2 - fig_width: 2 + fig_height: 1 + fig_width: 1 keep_md: yes +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Feature summary of ggcyto} --- ```{r, echo=FALSE} library(knitr) opts_chunk$set(message = FALSE, warning = FALSE, fig.height= 3, fig.width= 5) ``` +`ggcyto` is a cytometry data visualization tool built around ggplot and the grammar of graphics paradigm. The software extends the popular ggplot2 framework, already familiar to many data scientists, enabling it to recog-nize the core Bioconductor flow cytometry data structures for gated and annotated cytometry data. It simplifies visualization and plotting of flow data for publication quality graphics. -### Overloaded `fortify` S3 method makes `Cytometry` data to be fully compatible with `ggplot`. + +There are three ways to construct the `ggcyto` plots. Each represents a different level of complexity and flexibility. They meet the needs of various plot applications and thus are suitable for users at different levels of coding skills. + +# Quick plot + +This inherits the spirit from ggplot's `Quick plot`, which simplies the plotting job by hiding more details from users and taking more assumptions for the plot. + +* see [autoplot](vignettes/autoplot.md) + +# More flexibility with **ggcyto** wrapper + +`ggcyto` constructor along with overloaded `+` operator gives user more flexibility to fine-tune the plot yet still encapsulates lots of details that might be tedious and intimidating for many users. + +See more examples of `ggcyto` constructor here: + +* [ggcyto + flowSet](vignettes/ggcyto.flowSet.md) +* [ggcyto + GatingSet](vignettes/ggcyto.GatingSet.md) + +# Use `ggplot` directly to have more controls. +The package overloads ggplot's `fortify` S3 method so that `Cytometry` data structures (e.g. `flowSet/flowFrame`) are fully compatible with `ggplot`. More examples of using `ggplot` directly on `flowSet`: + +* [ggplot + flowSet1d](vignettes/advanced/ggplot.flowSet.1d.md) +* [ggplot + flowSet2d](vignettes/advanced/ggplot.flowSet.2d.md) +* [ggplot + flowSet + gate](vignettes/advanced/ggplot.flowSet.gate.md) +* [ggplot + flowSet + overlay](vignettes/advanced/ggplot.flowSet.overlay.md) + +# quick demos of some most used features ```{r} library(ggcyto) dataDir <- system.file("extdata",package="flowWorkspaceData") -gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE)) -fs <- getData(gs, "CD3+") +gs <- load_gs(list.files(dataDir, pattern = "gs_bcell_auto",full = TRUE)) ``` -### Quick plot with [autoplot](vignettes/autoplot.md) -```{r} -#1d -autoplot(fs, "CD4") -#2d -autoplot(fs, "CD4", "CD8", bins = 64) - -autoplot(gs, c("CD4", "CD8"), bins = 64) -#plot all channels -autoplot(fs[[1]]) + labs_cyto("marker") +```{r echo=FALSE} +gs@transformation <- transformerList(colnames(gs)[-(1:2)], flowJo_biexp_trans()) ``` -### More flexibility with **ggcyto** wrapper - -#### [ggcyto + flowSet](vignettes/ggcyto.flowSet.md) ```{r} -# support fuzzy-matching of aes to the data -# with flowJo-type of default color fills -# facet on `name` by default -ggcyto(fs,aes(x = CD4, y = CD8)) + geom_hex(bins = 64) + xlim(0, 3600) +#plot a gate by specifying the population node name (here it is 'CD3') +autoplot(gs, "CD3") +#change the resolution +p <- autoplot(gs, "CD3", bins = 64) +p +#display the transformed value at breaks label by turning off the inverse transform +autoplot(gs, "CD3", axis_inverse_trans = FALSE) +#you can switch the limits from default `instrument` to the actual `data` range +p + ggcyto_par_set(limits = "data") +# Choose between `marker` and `channel` names for axis label text +p + labs_cyto("channel") #default is "both" +# overlay another population 'IgD-CD27-' as dots on top of the existing plot +p + geom_overlay("IgD-CD27-", alpha = 0.5, size = 0.1, color = "purple") +# plot a population without gate +fs <- getData(gs, "CD20") #extract the gated data as a flowSet +autoplot(fs, "CD20", "CD19") #plot 2D ``` -#### [ggcyto + GatingSet](vignettes/ggcyto.GatingSet.md) -```{r} -ggcyto(gs,aes(x = CCR7, y = CD45RA), subset = "CD4") + geom_hex(bins = 64) + geom_gate("CD4/CCR7+ 45RA+") + geom_stats(fill = "yellow", size = 4) +```{r fig.height = 1} +autoplot(fs, "CD20") #1d density +``` +```{r fig.height = 4} +#extract one sample as a flowFrame +fr <- fs[[1]] +#plot 1d density on all available channels +autoplot(fr) ``` -### Use `ggplot` directly to have more controls. -```{r} -# 1d -p <- ggplot(fs, aes(x = ``)) + facet_wrap(~name) -#histogram plot -p + geom_histogram(colour = "white") -#density plot -p + geom_density(fill = "black") - -# 2d hexbin -ggplot(fs, aes(x = ``, y = ``)) + facet_wrap(~name) + geom_hex(bins = 64) + +```{r fig.height = 4} +gh <- gs[[1]] # extract a `GatingHierarchy` object for one sample +# layout multiple cell populations with their asssociated gates in the same plot. +nodes <- getNodes(gh)[c(3:9, 14)] +p <- autoplot(gh, nodes, bins = 64) +p ``` -More examples of using `ggplot` directly on `flowSet`: +```{r fig.width=8, fig.height = 2} +#arrange it as one-row gtable object +gt <- ggcyto_arrange(p, nrow = 1) +plot(gt) +``` + + -* [ggplot + flowSet1d](vignettes/advanced/ggplot.flowSet.1d.md) -* [ggplot + flowSet2d](vignettes/advanced/ggplot.flowSet.2d.md) -* [ggplot + flowSet + gate](vignettes/advanced/ggplot.flowSet.gate.md) -* [ggplot + flowSet + overlay](vignettes/advanced/ggplot.flowSet.overlay.md) diff --git a/README.md b/README.md index 40e50f9..d6de366 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,134 @@ -# ggcyto : Visualize `Cytometry` data with `ggplot` +# ggcyto : Visualize `Cytometry` data with `ggplot`' -### Overloaded `fortify` S3 method makes `Cytometry` data to be fully compatible with `ggplot`. +`ggcyto` is a cytometry data visualization tool built around ggplot and the grammar of graphics paradigm. The software extends the popular ggplot2 framework, already familiar to many data scientists, enabling it to recog-nize the core Bioconductor flow cytometry data structures for gated and annotated cytometry data. It simplifies visualization and plotting of flow data for publication quality graphics. + + +There are three ways to construct the `ggcyto` plots. Each represents a different level of complexity and flexibility. They meet the needs of various plot applications and thus are suitable for users at different levels of coding skills. + +# Quick plot + +This inherits the spirit from ggplot's `Quick plot`, which simplies the plotting job by hiding more details from users and taking more assumptions for the plot. + +* see [autoplot](vignettes/autoplot.md) + +# More flexibility with **ggcyto** wrapper + +`ggcyto` constructor along with overloaded `+` operator gives user more flexibility to fine-tune the plot yet still encapsulates lots of details that might be tedious and intimidating for many users. + +See more examples of `ggcyto` constructor here: + +* [ggcyto + flowSet](vignettes/ggcyto.flowSet.md) +* [ggcyto + GatingSet](vignettes/ggcyto.GatingSet.md) + +# Use `ggplot` directly to have more controls. +The package overloads ggplot's `fortify` S3 method so that `Cytometry` data structures (e.g. `flowSet/flowFrame`) are fully compatible with `ggplot`. More examples of using `ggplot` directly on `flowSet`: + +* [ggplot + flowSet1d](vignettes/advanced/ggplot.flowSet.1d.md) +* [ggplot + flowSet2d](vignettes/advanced/ggplot.flowSet.2d.md) +* [ggplot + flowSet + gate](vignettes/advanced/ggplot.flowSet.gate.md) +* [ggplot + flowSet + overlay](vignettes/advanced/ggplot.flowSet.overlay.md) + +# quick demos of some most used features ```r library(ggcyto) dataDir <- system.file("extdata",package="flowWorkspaceData") -gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE)) -fs <- getData(gs, "CD3+") +gs <- load_gs(list.files(dataDir, pattern = "gs_bcell_auto",full = TRUE)) +``` + + + + +```r +#plot a gate by specifying the population node name (here it is 'CD3') +autoplot(gs, "CD3") ``` -### Quick plot with [autoplot](vignettes/autoplot.md) +![](README_files/figure-html/unnamed-chunk-4-1.png) ```r -#1d -autoplot(fs, "CD4") +#change the resolution +p <- autoplot(gs, "CD3", bins = 64) +p ``` -![](README_files/figure-html/unnamed-chunk-3-1.png) +![](README_files/figure-html/unnamed-chunk-4-2.png) ```r -#2d -autoplot(fs, "CD4", "CD8", bins = 64) +#display the transformed value at breaks label by turning off the inverse transform +autoplot(gs, "CD3", axis_inverse_trans = FALSE) ``` -![](README_files/figure-html/unnamed-chunk-3-2.png) +![](README_files/figure-html/unnamed-chunk-4-3.png) ```r -autoplot(gs, c("CD4", "CD8"), bins = 64) +#you can switch the limits from default `instrument` to the actual `data` range +p + ggcyto_par_set(limits = "data") ``` -![](README_files/figure-html/unnamed-chunk-3-3.png) +![](README_files/figure-html/unnamed-chunk-4-4.png) ```r -#plot all channels -autoplot(fs[[1]]) + labs_cyto("marker") +# Choose between `marker` and `channel` names for axis label text +p + labs_cyto("channel") #default is "both" ``` -![](README_files/figure-html/unnamed-chunk-3-4.png) +![](README_files/figure-html/unnamed-chunk-4-5.png) -### More flexibility with **ggcyto** wrapper +```r +# overlay another population 'IgD-CD27-' as dots on top of the existing plot +p + geom_overlay("IgD-CD27-", alpha = 0.5, size = 0.1, color = "purple") +``` -#### [ggcyto + flowSet](vignettes/ggcyto.flowSet.md) +![](README_files/figure-html/unnamed-chunk-4-6.png) ```r -# support fuzzy-matching of aes to the data -# with flowJo-type of default color fills -# facet on `name` by default -ggcyto(fs,aes(x = CD4, y = CD8)) + geom_hex(bins = 64) + xlim(0, 3600) +# plot a population without gate +fs <- getData(gs, "CD20") #extract the gated data as a flowSet +autoplot(fs, "CD20", "CD19") #plot 2D ``` -![](README_files/figure-html/unnamed-chunk-4-1.png) +![](README_files/figure-html/unnamed-chunk-4-7.png) -#### [ggcyto + GatingSet](vignettes/ggcyto.GatingSet.md) ```r -ggcyto(gs,aes(x = CCR7, y = CD45RA), subset = "CD4") + geom_hex(bins = 64) + geom_gate("CD4/CCR7+ 45RA+") + geom_stats(fill = "yellow", size = 4) +autoplot(fs, "CD20") #1d density ``` ![](README_files/figure-html/unnamed-chunk-5-1.png) -### Use `ggplot` directly to have more controls. - ```r -# 1d -p <- ggplot(fs, aes(x = ``)) + facet_wrap(~name) -#histogram plot -p + geom_histogram(colour = "white") +#extract one sample as a flowFrame +fr <- fs[[1]] +#plot 1d density on all available channels +autoplot(fr) ``` ![](README_files/figure-html/unnamed-chunk-6-1.png) + + ```r -#density plot -p + geom_density(fill = "black") +gh <- gs[[1]] # extract a `GatingHierarchy` object for one sample +# layout multiple cell populations with their asssociated gates in the same plot. +nodes <- getNodes(gh)[c(3:9, 14)] +p <- autoplot(gh, nodes, bins = 64) +p ``` -![](README_files/figure-html/unnamed-chunk-6-2.png) +![](README_files/figure-html/unnamed-chunk-7-1.png) + ```r -# 2d hexbin -ggplot(fs, aes(x = ``, y = ``)) + facet_wrap(~name) + geom_hex(bins = 64) +#arrange it as one-row gtable object +gt <- ggcyto_arrange(p, nrow = 1) +plot(gt) ``` -![](README_files/figure-html/unnamed-chunk-6-3.png) +![](README_files/figure-html/unnamed-chunk-8-1.png) + -More examples of using `ggplot` directly on `flowSet`: -* [ggplot + flowSet1d](vignettes/advanced/ggplot.flowSet.1d.md) -* [ggplot + flowSet2d](vignettes/advanced/ggplot.flowSet.2d.md) -* [ggplot + flowSet + gate](vignettes/advanced/ggplot.flowSet.gate.md) -* [ggplot + flowSet + overlay](vignettes/advanced/ggplot.flowSet.overlay.md) diff --git a/README_files/figure-html/unnamed-chunk-3-1.png b/README_files/figure-html/unnamed-chunk-3-1.png deleted file mode 100644 index 34f4b3d..0000000 Binary files a/README_files/figure-html/unnamed-chunk-3-1.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-3-2.png b/README_files/figure-html/unnamed-chunk-3-2.png deleted file mode 100644 index 57cdbb5..0000000 Binary files a/README_files/figure-html/unnamed-chunk-3-2.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-3-3.png b/README_files/figure-html/unnamed-chunk-3-3.png deleted file mode 100644 index 20b18c7..0000000 Binary files a/README_files/figure-html/unnamed-chunk-3-3.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-3-4.png b/README_files/figure-html/unnamed-chunk-3-4.png deleted file mode 100644 index f14d1d9..0000000 Binary files a/README_files/figure-html/unnamed-chunk-3-4.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-4-1.png b/README_files/figure-html/unnamed-chunk-4-1.png old mode 100644 new mode 100755 index 9c63c0c..840ca0a Binary files a/README_files/figure-html/unnamed-chunk-4-1.png and b/README_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-2.png b/README_files/figure-html/unnamed-chunk-4-2.png new file mode 100755 index 0000000..3393e86 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-2.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-3.png b/README_files/figure-html/unnamed-chunk-4-3.png new file mode 100755 index 0000000..c050322 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-3.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-4.png b/README_files/figure-html/unnamed-chunk-4-4.png new file mode 100755 index 0000000..87ea5e3 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-4.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-5.png b/README_files/figure-html/unnamed-chunk-4-5.png new file mode 100755 index 0000000..3205f5f Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-5.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-6.png b/README_files/figure-html/unnamed-chunk-4-6.png new file mode 100755 index 0000000..2e7ef9d Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-6.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-7.png b/README_files/figure-html/unnamed-chunk-4-7.png new file mode 100755 index 0000000..a1c5e81 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-7.png differ diff --git a/README_files/figure-html/unnamed-chunk-4-8.png b/README_files/figure-html/unnamed-chunk-4-8.png new file mode 100755 index 0000000..5cb658a Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-4-8.png differ diff --git a/README_files/figure-html/unnamed-chunk-5-1.png b/README_files/figure-html/unnamed-chunk-5-1.png old mode 100644 new mode 100755 index a46994c..291f05e Binary files a/README_files/figure-html/unnamed-chunk-5-1.png and b/README_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/README_files/figure-html/unnamed-chunk-5-2.png b/README_files/figure-html/unnamed-chunk-5-2.png deleted file mode 100644 index d910867..0000000 Binary files a/README_files/figure-html/unnamed-chunk-5-2.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-5-3.png b/README_files/figure-html/unnamed-chunk-5-3.png deleted file mode 100644 index 08fc8dd..0000000 Binary files a/README_files/figure-html/unnamed-chunk-5-3.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-6-1.png b/README_files/figure-html/unnamed-chunk-6-1.png old mode 100644 new mode 100755 index 7480640..fd7727f Binary files a/README_files/figure-html/unnamed-chunk-6-1.png and b/README_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/README_files/figure-html/unnamed-chunk-6-2.png b/README_files/figure-html/unnamed-chunk-6-2.png deleted file mode 100644 index 7d50df0..0000000 Binary files a/README_files/figure-html/unnamed-chunk-6-2.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-6-3.png b/README_files/figure-html/unnamed-chunk-6-3.png deleted file mode 100644 index 251ecbe..0000000 Binary files a/README_files/figure-html/unnamed-chunk-6-3.png and /dev/null differ diff --git a/README_files/figure-html/unnamed-chunk-7-1.png b/README_files/figure-html/unnamed-chunk-7-1.png new file mode 100755 index 0000000..f050353 Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/README_files/figure-html/unnamed-chunk-8-1.png b/README_files/figure-html/unnamed-chunk-8-1.png new file mode 100755 index 0000000..f7ac9ac Binary files /dev/null and b/README_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/vignettes/Top_features_of_ggcyto.md b/vignettes/Top_features_of_ggcyto.md deleted file mode 100644 index 2c09a4e..0000000 --- a/vignettes/Top_features_of_ggcyto.md +++ /dev/null @@ -1,295 +0,0 @@ -# ggcyto : Visualize `Cytometry` data with `ggplot` - - - - -```r -library(ggcyto) -dataDir <- system.file("extdata",package="flowWorkspaceData") -``` - -## 1: suppoort `3` types of plot constructor - -* represent different levels of complexity and flexibility -* meet the needs of various plot applications -* suitable for users at different levels of coding skills. - -### low level: `ggplot` - -The overloaded `fority` methods empower `ggplot` to work with all the major Cytometry data structures right away, which allows users to do all kinds of highly customized and versitled plots. - -#### `GatingSet` - -```r -gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE)) -attr(gs, "subset") <- "CD3+" -ggplot(gs, aes(x = ``, y = ``)) + geom_hex(bins = 128) + scale_fill_gradientn(colours = gray.colors(9)) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-3-1.png) - -#### `flowSet/ncdfFlowSet/flowFrame` - -```r -fs <- getData(gs, "CD3+") -ggplot(fs, aes(x = ``)) + geom_density(fill = "blue", alpha= 0.5) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-4-1.png) - -#### `gates` - -```r -gates <- filterList(getGate(gs, "CD8")) -ggplot(gs, aes(x = ``, y = ``)) + geom_hex(bins = 128) + geom_polygon(data = gates, fill = "transparent", col = "purple") -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-5-1.png) - -### medium level: `ggcyto` - -`ggcyto` constructor along with overloaded `+` operator encapsulate lots of details that might be tedious and intimidating for many users. - - -```r -ggcyto(gs, aes(x = CD4, y = CD8)) + geom_hex(bins = 128) + geom_gate("CD8") -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-6-1.png) - -It simplies the plotting by: -* add a default scale_fill_gradientn for you -* fuzzy-matching in `aes` by either detector or fluorochromes names -* determine the `parent` popoulation automatically -* exact and plot the gate object by simply referring to the `child` population name - -### top level: `autoplot` -Inheriting the spirit from ggplot's `Quick plot`, it further simply the plotting job by hiding more details from users and taking more assumptions for the plot. - -* when plotting `flowSet`, it determines `geom` type automatically by the number of `dim` supplied -* for `GatingSet`, it further skip the need of `dim` by guessing it from the `children` gate - - -```r -#1d -autoplot(fs, "CD4") -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-1.png) - -```r -#2d -autoplot(fs, "CD4", "CD8", bins = 64) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-2.png) - -```r -autoplot(gs, c("CD4", "CD8"), bins = 64) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-3.png) - -## 2: in-line transformation -It is done by different `scales` layers speically designed for `cytometry` - -```r -data(GvHD) -fr <- GvHD[[1]] -p <- autoplot(fr, "FL1-H") -p #raw scale -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-1.png) - -```r -p + scale_x_logicle() #flowCore logicle scale -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-2.png) - -```r -p + scale_x_flowJo_fasinh() # flowJo fasinh -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-3.png) - -```r -p + scale_x_flowJo_biexp() # flowJo biexponential -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-4.png) - -## 3: generic `geom_gate` layer -It hides the complex details pf plotting different geometric shapes - - -```r -fr <- fs[[1]] -p <- autoplot(fr,"CD4", "CD8") + ggcyto_par_set(limits = "instrument") -#1d gate vertical -gate_1d_v <- openCyto::gate_mindensity(fr, "") -p + geom_gate(gate_1d_v) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-1.png) - -```r -#1d gate horizontal -gate_1d_h <- openCyto::gate_mindensity(fr, "") -p + geom_gate(gate_1d_h) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-2.png) - -```r -#2d rectangle gate -gate_rect <- rectangleGate("" = c(gate_1d_v@min, 4e3), "" = c(gate_1d_h@min, 4e3)) -p + geom_gate(gate_rect) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-3.png) - -```r -#ellipsoid Gate -gate_ellip <- getGate(gs[[1]], "CD4") -class(gate_ellip) -``` - -``` -## [1] "ellipsoidGate" -## attr(,"package") -## [1] "flowCore" -``` - -```r -p + geom_gate(gate_ellip) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-4.png) - - - -## 4: `geom_stats` - -```r -p <- ggcyto(gs, aes(x = "CD4", y = "CD8"), subset = "CD3+") + geom_hex() -p + geom_gate("CD4") + geom_stats() -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-1.png) - -```r -p + geom_gate("CD4") + geom_stats(type = "count") #display cell counts -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-2.png) - - -## 5: `axis_inverse_trans` -It can display the `log` scaled data in the original value - -```r -p # axis display the transformed values -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-1.png) - -```r -p + axis_x_inverse_trans() # restore the x axis to the raw values -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-2.png) - -It currently only works with `GatingSet`. - -## 6: auto limits -Optionally you can set limits by `instrument` or `data` range - -```r -p <- p + ggcyto_par_set(limits = "instrument") -p -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-12-1.png) - -## 7: labs_cyto -You can choose between `marker` and `channel` names (or `both` by default) - -```r -p + labs_cyto("markers") -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-13-1.png) - - -## 8: `ggcyto_par_set` -It aggregates the different settings in one layer - -```r -#put all the customized settings in one layer -mySettings <- ggcyto_par_set(limits = "instrument" - , facet = facet_wrap("name") - , hex_fill = scale_fill_gradientn(colours = rev(RColorBrewer::brewer.pal(11, "Spectral"))) - , lab = labs_cyto("marker") - ) -# and use it repeatly in the plots later (similar to the `theme` concept) -p + mySettings -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-14-1.png) - -Currently we only support `4` settings, but will add more in future. - -## 9: `as.ggplot` -It allows user to convert `ggcyto` objects to pure `ggplot` objects for further the manipulating jobs that can not be done within `ggcyto` framework. - -```r -class(p) # may not fully compatile with all the `ggplot` functions -``` - -``` -## [1] "ggcyto_GatingSet" -## attr(,"package") -## [1] "ggcyto" -``` - -```r -p1 <- as.ggplot(p) -class(p1) # a pure ggplot object, thus can work with all the `ggplot` features -``` - -``` -## [1] "gg" "ggplot" -``` - -## 10: ggcyto_layout - -Layout many gate plots on the same page - -When plooting a `GatingHierarchy`, multiple cell populations with their asssociated gates can be plotted in different panels of the same plot. - -```r -gh <- gs[[1]] -nodes <- getNodes(gh, path = "auto")[c(3:9, 14)] -nodes -``` - -``` -## [1] "singlets" "CD3+" "CD4" "CD4/38- DR+" "CD4/38+ DR+" -## [6] "CD4/38+ DR-" "CD4/38- DR-" "CD8" -``` - -```r -autoplot(gh, nodes, bins = 64) -``` - -![](Top_features_of_ggcyto_files/figure-html/unnamed-chunk-16-1.png) - - -More examples: - -* [ggplot + flowSet1d](vignettes/advanced/ggplot.flowSet.1d.md) -* [ggplot + flowSet2d](vignettes/advanced/ggplot.flowSet.2d.md) -* [ggplot + flowSet + gate](vignettes/advanced/ggplot.flowSet.gate.md) -* [ggplot + flowSet + overlay](vignettes/advanced/ggplot.flowSet.overlay.md) diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-1.png deleted file mode 100644 index 24c5c02..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-2.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-2.png deleted file mode 100644 index bcb0307..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-10-2.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-1.png deleted file mode 100644 index 181cf51..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-2.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-2.png deleted file mode 100644 index 3f9d960..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-11-2.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-12-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-12-1.png deleted file mode 100644 index f75a5c6..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-12-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-13-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-13-1.png deleted file mode 100644 index f75a5c6..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-13-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-14-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-14-1.png deleted file mode 100644 index 81e23d9..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-14-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-16-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index 75e8832..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-3-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-3-1.png deleted file mode 100644 index 4b42769..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-3-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-4-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-4-1.png deleted file mode 100644 index 1343ec2..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-4-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-5-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-5-1.png deleted file mode 100644 index 1f9f52a..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-5-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-6-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-6-1.png deleted file mode 100644 index 80175b2..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-6-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-1.png deleted file mode 100644 index 9fc0e88..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-2.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-2.png deleted file mode 100644 index 07fb587..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-2.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-3.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-3.png deleted file mode 100644 index 54fc360..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-7-3.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-1.png deleted file mode 100644 index 051562d..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-2.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-2.png deleted file mode 100644 index ac3bf6f..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-2.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-3.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-3.png deleted file mode 100644 index da6835d..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-3.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-4.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-4.png deleted file mode 100644 index 8b459c0..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-8-4.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-1.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-1.png deleted file mode 100644 index 9895ef0..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-1.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-2.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-2.png deleted file mode 100644 index 7e5744a..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-2.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-3.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-3.png deleted file mode 100644 index a655bf3..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-3.png and /dev/null differ diff --git a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-4.png b/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-4.png deleted file mode 100644 index 1c6250a..0000000 Binary files a/vignettes/Top_features_of_ggcyto_files/figure-html/unnamed-chunk-9-4.png and /dev/null differ