-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
92 lines (60 loc) · 2.17 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# RaJIVE
<!-- badges: start -->
<!-- badges: end -->
RaJIVE (Robust Angle based Joint and Individual Variation Explained) is a robust alternative to the aJIVE method for the estimation of joint and individual components in the presence of outliers in multi-source data. It decomposes the multi-source data into joint, individual and residual (noise) contributions. The decomposition is robust with respect to outliers and other types of noises present in the data.
## Installation
You can install the released version of RaJIVE from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("RaJIVE")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ericaponzi/RaJIVE")
```
## Example
This is a basic example which shows how to use RaJIVE on simple simulated data:
### Running robust aJIVE
```{r example}
library(RaJIVE)
## basic example code
n <- 50
pks <- c(100, 80, 50)
Y <- ajive.data.sim(K =3, rankJ = 3, rankA = c(7, 6, 4), n = n,
pks = pks, dist.type = 1)
initial_signal_ranks <- c(7, 6, 4)
data.ajive <- list((Y$sim_data[[1]]), (Y$sim_data[[2]]), (Y$sim_data[[3]]))
ajive.results.robust <- Rajive(data.ajive, initial_signal_ranks)
```
The function returns a list containing the aJIVE decomposition, with the joint component (shared across data sources), individual component (data source specific) and residual component for each data source.
### Visualizing results:
- Joint rank:
```{r ranks}
get_joint_rank(ajive.results.robust)
```
- Individual ranks:
```{r}
get_individual_rank(ajive.results.robust, 1)
get_individual_rank(ajive.results.robust, 2)
get_individual_rank(ajive.results.robust, 3)
```
- Heatmap decomposition:
```{r}
decomposition_heatmaps_robustH(data.ajive, ajive.results.robust)
```
- Proportion of variance explained:
```{r}
showVarExplained_robust(ajive.results.robust, data.ajive)
```