modpcomp: modpcomp

Description Usage Arguments Author(s) Examples

View source: R/modulefunction.R View source: R/DEPextract.R

Description

extract module pca component

Usage

1
2
modpcomp(data, colors, nPC = 2,
         plot = FALSE, filename = NULL, group = NULL)

Arguments

data

protein quantification data. column is sample. row is protein ID.

colors

protein and module information. which is calculated in WGCNA package.

nPC

how many PCA component will saved.

plot

a logical value indicating whether draw PCA plot. This function need load ggfortify first.

filename

The filename of plot. The default value is NULL which means no file saving. The plot will be saved to "plot" folder and saved in pdf format.

group

sample group information.

Author(s)

Kefu Liu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(net)
data(imputedData)
data <- imputedData
logD <- data$log2_value
rownames(logD) <- data$inf$ori.ID
Module_PCA <- modpcomp(logD, net$colors)

# if plot PCA and plot module 6 PCA
group <- gsub("[0-9]+", "", colnames(logD))
pos <- which(net$colors == 6)
if (requireNamespace("ggfortify", quietly = TRUE)){
require("ggfortify")
Module_PCA <- modpcomp(logD[pos,], net$colors[pos], plot = TRUE, group = group)
}

liukf10/DDPNA documentation built on Sept. 29, 2021, 1:35 a.m.