forked from PLN-team/PLNmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
121 lines (79 loc) · 4.49 KB
/
README.Rmd
File metadata and controls
121 lines (79 loc) · 4.49 KB
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
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
fig.path = "man/figures/"
)
```
# PLNmodels: Poisson lognormal models <img src="man/figures/logo.png" align="right" width="155" height="180"/>
<!-- badges: start -->
[](https://github.com/jchiquet/PLNmodels/actions)
[](https://codecov.io/github/jchiquet/PLNmodels?branch=master)
[](https://cran.r-project.org/package=PLNmodels)
[](https://www.tidyverse.org/lifecycle/#stable)
[](https://github.com/jchiquet/PLNmodels/commits/master)
<!-- badges: end -->
> The Poisson lognormal model and variants can be used for a variety of multivariate problems when count data are at play (including PCA, LDA and network inference for count data). This package implements efficient algorithms to fit such models accompanied with a set of functions for visualization and diagnostic.
## Installation
**PLNmodels** is available on [CRAN](https://cran.r-project.org/package=PLNmodels). The development version is available on [Github](https://github.com/jchiquet/PLNmodels).
### R Package installation
#### CRAN dependencies
**PLNmodels** needs the following CRAN R packages, so check that they are are installed on your computer.
```{r CRAN dependencies, eval = FALSE}
required_CRAN <- c("R6", "glassoFast", "Matrix", "Rcpp", "RcppArmadillo",
"nloptr", "igraph", "grid", "gridExtra", "dplyr",
"tidyr", "ggplot2", "corrplot", "magrittr", "devtools")
not_installed_CRAN <- setdiff(required_CRAN, rownames(installed.packages()))
if (length(not_installed_CRAN) > 0) install.packages(not_installed_CRAN)
```
#### Bioconductor dependencies
**PLNmodels** also needs two BioConductor packages
```{r Bioconductor dependencies, eval = FALSE}
required_BioC <- c("phyloseq", "biomformat")
not_installed_BioC <- setdiff(required_BioC, rownames(installed.packages()))
if (length(not_installed_BioC) > 0) BiocManager::install(not_installed_BioC)
```
#### Installing PLNmodels
- For the last stable version, use the CRAN version
```{r package CRAN, eval = FALSE}
install.packages("PLNmodels")
```
- For the development version, use the github install
```{r package github, eval = FALSE}
remotes::install_github("jchiquet/PLNmodels")
```
- For a specific tagged release, use
```{r package tag, eval = FALSE}
remotes::install_github("jchiquet/PLNmodels@tag_number")
```
## Usage and main fitting functions
The package comes with an ecological data set to present the functionality
```{r load PLNmodels, eval = FALSE}
library(PLNmodels)
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
```
The main fitting functions work with the usual `R formula` notations, with mutivariate responses on the left hand side. You probably want to start by one of them. Check the corresponding vignette and documentation page. There is a dedicated vignettes for each model in the package (See http://jchiquet.github.io/PLNmodels/articles/).
### Unpenalized Poisson lognormal model (aka PLN)
```{r PLN, eval = FALSE}
myPLN <- PLN(Abundance ~ 1, data = trichoptera)
```
### Rank Constrained Poisson lognormal for Poisson Principal Component Analysis (aka PLNPCA)
```{r PLNPCA, eval = FALSE}
myPCA <- PLNPCA(Abundance ~ 1, data = trichoptera, ranks = 1:8)
```
### Poisson lognormal discriminant analysis (aka PLNLDA)
```{r PLNLDA, eval = FALSE}
myLDA <- PLNLDA(Abundance ~ 1, grouping = Group, data = trichoptera)
```
### Sparse Poisson lognormal model for sparse covariance inference for counts (aka PLNnetwork)
```{r PLNnetwork, eval = FALSE}
myPLNnetwork <- PLNnetwork(Abundance ~ 1, data = trichoptera)
```
## References
Please cite our work using the following references:
- J. Chiquet, M. Mariadassou and S. Robin: Variational inference for probabilistic Poisson PCA, the Annals of Applied Statistics, 12: 2674–2698, 2018. [link](http://dx.doi.org/10.1214/18-AOAS1177)
- J. Chiquet, M. Mariadassou and S. Robin: Variational inference for sparse network reconstruction from count data, Proceedings of the 36th International Conference on Machine Learning (ICML), 2019.
[link](http://proceedings.mlr.press/v97/chiquet19a.html)