ggcyto

Visualize Cytometry data with ggplot2

https://github.com/rglab/ggcyto

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 22 committers (4.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary

Keywords from Contributors

bioconductor-package gene genomics human-cell-atlas single-cell-rna-seq proteomics metabolomics mass-spectrometry bioconductor feature-detection
Last synced: 10 months ago · JSON representation

Repository

Visualize Cytometry data with ggplot2

Basic Info
  • Host: GitHub
  • Owner: RGLab
  • License: mit
  • Language: HTML
  • Default Branch: devel
  • Size: 49.5 MB
Statistics
  • Stars: 59
  • Watchers: 12
  • Forks: 15
  • Open Issues: 22
  • Releases: 5
Created about 11 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.Rmd

---
title: 'ggcyto : Visualize `Cytometry` data with `ggplot`'
output:
  html_document:
    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)
```

```{r, include = FALSE}
knitr::opts_chunk$set(
  fig.path = "man/figures/"
)
```

`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_orig <- load_gs(list.files(dataDir, pattern = "gs_bcell_auto",full = TRUE))
gs <- gs_clone(gs_orig)
```

```{r echo=FALSE}
gs@transformation <- sapply(sampleNames(gs), function(sn)transformerList(colnames(gs)[-(1:2)], flowjo_biexp_trans()), simplify = F)
```

```{r}
#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 <- gs_pop_get_data(gs, "CD20") #extract the gated data as a flowSet
autoplot(fs, "CD20", "CD19") #plot 2D
```
```{r}
gs1 <- gs[1]
gs2 <- gs[2]
#construct the ggcyto object for gs1
p <- ggcyto(gs1, aes(cd24, cd38)) + geom_hex(bins = 128)
p <- p + geom_gate("Transitional") #add gate
#customize the stats layer
p <- p + geom_stats(type = "count", size = 6,  color = "red", fill = "green", adjust = 0.7)
#customize the layer
p <- p + labs_cyto("channel")
#customize the axis limits
p <- p + ggcyto_par_set(limits = "instrument")
#add another population as the overlay dots
p <- p + geom_overlay("IgD-CD27-", col = "black", size = 1.2, alpha = 0.4)
p

#replace the data with gs2 and see the same visual effect
p %+% gs2
```

```{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)
```

 
```{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 <- gs_get_pop_paths(gh)[c(3:9, 14)]
p <- autoplot(gh, nodes, bins = 64)
p
```

```{r fig.width=8, fig.height = 2}
#arrange it as one-row gtable object
gt <- ggcyto_arrange(p, nrow = 1)
plot(gt)
```



Owner

  • Name: RGLab
  • Login: RGLab
  • Kind: organization
  • Location: Seattle

Raphael Gottardo's Research Lab

GitHub Events

Total
  • Issues event: 2
  • Watch event: 4
  • Issue comment event: 2
  • Push event: 1
  • Pull request review event: 2
  • Pull request event: 1
  • Fork event: 2
Last Year
  • Issues event: 2
  • Watch event: 4
  • Issue comment event: 2
  • Push event: 1
  • Pull request review event: 2
  • Pull request event: 1
  • Fork event: 2

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 458
  • Total Committers: 22
  • Avg Commits per committer: 20.818
  • Development Distribution Score (DDS): 0.297
Past Year
  • Commits: 28
  • Committers: 4
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.286
Top Committers
Name Email Commits
mikejiang w****2@f****g 322
Jacob Wagner j****r@f****g 39
Nitesh Turaga n****a@g****m 22
mikejiang m****e@o****i 21
wjiang2 w****g@g****m 5
hpages@fhcrc.org h****s@f****g@b****8 5
Herve Pages h****s@f****g 5
Hervé Pagès h****s@f****g 5
Dan Tenenbaum d****a@f****g 4
Dillon Hammill d****l@o****m 4
vobencha v****a@g****m 4
Greg Finak g****k@g****m 4
vobencha v****n@r****g 4
m.jiang m****g@b****8 3
Kayla-Morrell k****l@r****g 2
J Wokaty j****y@s****u 2
J Wokaty j****y 2
Mike Jiang w****2@f****g 1
d.tenenbaum d****m@b****8 1
Jim Java j****a@r****g 1
Greg Finak g****k@f****g 1
j.java j****a@b****8 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 91
  • Total pull requests: 10
  • Average time to close issues: 5 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 46
  • Total pull request authors: 4
  • Average comments per issue: 3.51
  • Average comments per pull request: 1.2
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 2.67
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mikejiang (20)
  • r-cheologist (6)
  • jacobpwagner (6)
  • rwbaer (4)
  • malisas (4)
  • alexheubeck (4)
  • Close-your-eyes (3)
  • gfinak (3)
  • SamGG (2)
  • malcook (2)
  • FMKerckhof (2)
  • mfahlberg824 (1)
  • DavidRach (1)
  • GeroKn (1)
  • jchellmuth (1)
Pull Request Authors
  • djhammill (5)
  • mikejiang (3)
  • gfinak (1)
  • teunbrand (1)
Top Labels
Issue Labels
enhancement (2) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • bioconductor 145,758 total
  • Total dependent packages: 9
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
bioconductor.org: ggcyto

Visualize Cytometry data with ggplot

  • Versions: 6
  • Dependent Packages: 9
  • Dependent Repositories: 0
  • Downloads: 145,758 Total
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 3.8%
Downloads: 11.3%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • flowCore >= 1.41.5 depends
  • flowWorkspace >= 3.33.1 depends
  • ggplot2 >= 3.3.0 depends
  • methods * depends
  • ncdfFlow >= 2.17.1 depends
  • RColorBrewer * imports
  • data.table * imports
  • gridExtra * imports
  • hexbin * imports
  • plyr * imports
  • rlang * imports
  • scales * imports
  • flowStats * suggests
  • flowViz * suggests
  • flowWorkspaceData * suggests
  • ggridges * suggests
  • knitr * suggests
  • openCyto * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • vdiffr * suggests
.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite