Last data update: 2014.03.03

R: Plot PCA figure
plotPCAR Documentation

Plot PCA figure

Description

Plot PCA figure

Usage

plotPCA(para, pcaMethod = "svdImpute", valueID = "valueNorm",
  label = "order", rmQC = TRUE, batch = FALSE, scale = "none",
  center = FALSE, saveRds = TRUE, ...)

Arguments

para

A metaXpara object

pcaMethod

See pca in pcaMethods

valueID

The name of the column which will be used

label

The label used for plot PCA figure, default is "order"

rmQC

A logical indicates whether remove QC data

batch

A logical indicates whether output batch information

scale

Scaling, see pca in pcaMethods

center

Centering, see pca in pcaMethods

saveRds

Boolean, setting the argument to TRUE to save some objects to disk for debug. Only useful for developer. Default is TRUE.

...

Additional parameter

Value

none

Author(s)

Bo Wen wenbo@genomics.cn

Examples

para <- new("metaXpara")
pfile <- system.file("extdata/MTBLS79.txt",package = "metaX")
sfile <- system.file("extdata/MTBLS79_sampleList.txt",package = "metaX")
rawPeaks(para) <- read.delim(pfile,check.names = FALSE)
sampleListFile(para) <- sfile
para <- reSetPeaksData(para)
para <- missingValueImpute(para)
para <- transformation(para,valueID = "value")
metaX::plotPCA(para,valueID="value",scale="uv",center=TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(metaX)
Loading required package: VennDiagram
Loading required package: grid
Loading required package: futile.logger
Loading required package: pROC
Type 'citation("pROC")' for a citation.

Attaching package: 'pROC'

The following objects are masked from 'package:stats':

    cov, smooth, var

Loading required package: SSPA
Loading required package: qvalue
Loading required package: lattice
Loading required package: limma

Attaching package: 'metaX'

The following object is masked from 'package:xcms':

    plotQC

The following objects are masked from 'package:BiocGenerics':

    normalize, plotPCA

Warning message:
Package 'metaX' is deprecated and will be removed from Bioconductor
  version 3.3 
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/metaX/plotPCA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotPCA
> ### Title: Plot PCA figure
> ### Aliases: plotPCA
> 
> ### ** Examples
> 
> para <- new("metaXpara")
> pfile <- system.file("extdata/MTBLS79.txt",package = "metaX")
> sfile <- system.file("extdata/MTBLS79_sampleList.txt",package = "metaX")
> rawPeaks(para) <- read.delim(pfile,check.names = FALSE)
> sampleListFile(para) <- sfile
> para <- reSetPeaksData(para)
> para <- missingValueImpute(para)
missingValueImpute: value
Wed Jul  6 21:54:16 2016	Missing value imputation for 'value'
Missing value in total: 3940
Missing value in QC sample: 678
Missing value in non-QC sample: 3262
Wed Jul  6 21:54:16 2016	The ratio of missing value: 4.5814%
<=0: 0
Missing value in total after missing value inputation: 0
<=0 value in total after missing value inputation: 0
> para <- transformation(para,valueID = "value")
> metaX::plotPCA(para,valueID="value",scale="uv",center=TRUE)
plot PCA for value 'value'
$fig
[1] ".//metaX-PCA.png"

$highfig
[1] ".//metaX-PCA.pdf"

$pca
svdImpute calculated PCA
Importance of component(s):
                 PC1    PC2     PC3
R2            0.2245 0.1247 0.07342
Cumulative R2 0.2245 0.3492 0.42262
500 	Variables
134 	Samples
0 	NAs ( 0 %)
3 	Calculated component(s)
Data was mean centered before running PCA 
Data was scaled before running PCA 
Scores structure:
[1] 134   3
Loadings structure:
[1] 500   3

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>