-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
117 lines (81 loc) · 4.61 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
output:
github_document:
editor_options:
chunk_output_type: console
markdown:
wrap: 80
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "inst/figures/README-",
out.width = "100%"
)
```
# planet <img src="man/figures/logo.png" align="right" height = "100px" style="float:right; height:100px;"/>
<!-- badges: start -->
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4321633.svg)](https://doi.org/10.5281/zenodo.4321633) `r badger::badge_last_commit("GuangchuangYu/badger")`
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![R-CMD-check](https://github.com/wvictor14/planet/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wvictor14/planet/actions/workflows/R-CMD-check.yaml)
[![Bioc release status](http://www.bioconductor.org/shields/build/release/bioc/planet.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/planet)
[![Bioc devel status](http://www.bioconductor.org/shields/build/devel/bioc/planet.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/planet)
[![Bioc downloads rank](https://bioconductor.org/shields/downloads/release/planet.svg)](http://bioconductor.org/packages/stats/bioc/planet/)
[![Bioc history](https://bioconductor.org/shields/years-in-bioc/planet.svg)](https://bioconductor.org/packages/release/bioc/html/planet.html#since)
[![Bioc last commit](https://bioconductor.org/shields/lastcommit/devel/bioc/planet.svg)](http://bioconductor.org/checkResults/devel/bioc-LATEST/planet/)
[![Bioc dependencies](https://bioconductor.org/shields/dependencies/release/planet.svg)](https://bioconductor.org/packages/release/bioc/html/planet.html#since)
<!-- badges: end -->
`planet` is an R package for inferring **ethnicity** (1), **gestational age** (2), and **cell composition** (3) from placental DNA methylation data.
See full documentation at <https://victor.rbind.io/planet>
### Installation
Latest Bioconductor release
```{r eval = FALSE}
if(!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("planet")
```
Or the development version of `planet`:
```{r eval = FALSE}
devtools::install_github('wvictor14/planet')
```
### Usage
See [vignettes](https://victor.rbind.io/planet/articles) for more detailed usage.
#### Example Data
All functions in this package take as input DNAm data the 450k and EPIC DNAm microarray. For best performance I suggest providing unfiltered data normalized with noob and BMIQ. A processed example dataset, `plBetas`, is provided to show the format that this data should be in. The output of all `planet` functions is a `data.frame`.
A quick example of each major function is illustrated with this example data:
```{r, message = F, warning = F}
library(minfi)
library(planet)
#load example data
data(plBetas)
data(plPhenoData) # sample information
```
#### Predict Ethnicity
```{r}
predictEthnicity(plBetas) %>%
head()
```
#### Predict Gestational Age
There are 3 gestational age clocks for placental DNA methylation data from Lee
Y. et al. 2019 (2). To use a specific one, we can use the `type` argument in `predictAge`:
```{r predictAge, dpi = 200}
predictAge(plBetas, type = 'RPC') %>%
head()
```
#### Predict Cell Composition
Reference data to infer cell composition on placental villi DNAm samples (3) can be used with cell deconvolution from minfi or EpiDISH. These are provided in this package as `plCellCpGsThird` and `plCellCpGsFirst` for third trimester (term) and first trimester samples, respectively.
```{r}
data('plCellCpGsThird')
minfi:::projectCellType(
# subset your data to cell cpgs
plBetas[rownames(plCellCpGsThird),],
# input the reference cpg matrix
plCellCpGsThird,
lessThanOne = FALSE) %>%
head()
```
### References
1. [**Yuan V**, Price EM, Del Gobbo G, Mostafavi S, Cox B, Binder AM, et al. Accurate ethnicity prediction from placental DNA methylation data. Epigenetics & Chromatin. 2019 Aug 9;12(1):51.](https://epigeneticsandchromatin.biomedcentral.com/articles/10.1186/s13072-019-0296-3)
2. [Lee Y, Choufani S, Weksberg R, Wilson SL, **Yuan V**, et al. Placental epigenetic clocks: estimating gestational age using placental DNA methylation levels. Aging (Albany NY). 2019;11(12):4238–4253. doi:10.18632/aging.102049](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6628997/)
3. [**Yuan V**, Hui D, Yin Y, Peñaherrera MS, Beristain AG, Robinson WP. Cell-specific characterization of the placental methylome. BMC Genomics. 2021 Jan 6;22(1):6.](https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-020-07186-6)