-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
57 lines (43 loc) · 2.15 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
pagetitle: "cytofan"
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# cytofan
[![Travis-CI Build Status](https://travis-ci.org/yannabraham/cytofan.svg?branch=master)](https://travis-ci.org/yannabraham/cytofan)
[![CRAN_Release_Badge](http://www.r-pkg.org/badges/version-ago/cytofan)](https://CRAN.R-project.org/package=cytofan)
[![CRAN_Download_Badge](http://cranlogs.r-pkg.org/badges/cytofan)](https://CRAN.R-project.org/package=cytofan)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3557320.svg)](https://doi.org/10.5281/zenodo.3557320)
`cytofan` implements the concept of fan plots ([Britton, E.; Fisher, P. & J. Whitley (1998) The Inflation Report Projections: Understanding the Fan Chart](https://www.bankofengland.co.uk/quarterly-bulletin/1998/q1/the-inflation-report-projections-understanding-the-fan-chart)) for cytometry data in ggplot2.
The `cytofan` package was implemented following up on a [gist](https://gist.github.com/yannabraham/6f8474ab32e8eec63c2e) written shortly after the [fanplot](https://cran.r-project.org/web/packages/fanplot/index.html) package was released. Compared to [ggfan](https://cran.r-project.org/web/packages/ggfan/index.html), `cytofan` uses categorical data as input on the x axis.
## Installation
You can install cytofan from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("yannabraham/cytofan")
```
## Example
`cytofan` can be used to visualize differences between populations identifed using [mass cytometry](http://www.nature.com/nbt/journal/v30/n9/full/nbt.2317.html):
```{r example,fig.height=8,fig.width=6,warning=FALSE}
library(cytofan)
library(bodenmiller)
library(dplyr)
library(reshape2)
data("refPhenoMat")
data("refAnnots")
bind_cols(refAnnots,
as.data.frame(refPhenoMat)) %>%
melt(.,measure.vars=colnames(refPhenoMat),
variable.name='Channel') %>%
filter(Cells %in% c('cd4+','cd8+','igm+','igm-')) %>%
ggplot(aes(x=Channel,y=value))+
geom_fan()+
facet_grid(Cells~.)
```