PVCA: Principal Variance Component Analysis (PVCA)

Description Usage Arguments Value Author(s) Examples

View source: R/statVisual.R

Description

Plot of weighted average proportion variance versus effects in principal variance component analysis (PVCA).

Usage

1
2
3
4
5
6
7
8
9
PVCA(
    clin_data, 
    clin_subjid, 
    gene_data, 
    pct_threshold = 0.8, 
    batch.factors, 
    theme_classic = FALSE, 
    addThemeFlag = TRUE,
    ...)

Arguments

clin_data

A data frame containing clinical information, including an id variable that corresponds to rownames of gene_data

clin_subjid

character. The column name of clin_data that indicates subject id. It corresponds to the rowname of gene_data.

gene_data

A data frame with genes as rows and subjects as columns.

pct_threshold

numeric. The percentile value of the minimum amount of the variabilities that the selected principal components need to explain

batch.factors

character. A vector of factors that the mixed linear model will be fit on.

theme_classic

logical. Use classic background without grids (default: TRUE).

addThemeFlag

logical. Indicates if light blue background and white grid should be added to the figure.

...

other input parameters for facet & theme

Value

A list with 9 elements. data, layers, scales, mapping, theme, coordinates, facet, plot_env, and labels.

Author(s)

Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>

Examples

 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
library(pvca)


data(esSim)
print(esSim)

# expression data
dat = exprs(esSim)
print(dim(dat))
print(dat[1:2,])

# create a fake Batch variable
esSim$Batch=c(rep("A", 4), rep("B", 6), rep("C", 10))
# phenotype data
pDat = pData(esSim)
print(dim(pDat))
print(pDat[1:2,])


# feature data
fDat = fData(esSim)
print(dim(fDat))
print(fDat[1:2,])


statVisual(type = 'PVCA',
           clin_data = pData(esSim), 
           clin_subjid = "sid", 
           gene_data = exprs(esSim), 
           batch.factors = c("grp", "Batch"))

PVCA( 
     clin_data = pData(esSim), 
     clin_subjid = "sid", 
     gene_data = exprs(esSim), 
     batch.factors = c("grp", "Batch"))

statVisual documentation built on Feb. 21, 2020, 1:08 a.m.