STATegRa (version 1.6.2)

biplotRes: Biplot of component analysis

Description

Generate a biplot of component analysis results

Usage

biplotRes(object, type, comps, block, title=NULL, colorCol=NULL, sizeValues=c(2, 4), shapeValues=c(17, 0), background=TRUE, pointSize=4, labelSize=NULL, axisSize=NULL, titleSize=NULL)

Arguments

object
caClass object containing component analysis results
type
Character specifying which components to plot; "common", "individual" or "both"
comps
Components to plot. If combined=FALSE, specifies the component indices to use as x and y for the plot. Otherwise, the component from the first block and the component from second block to plot together.
block
Which block to plot, either "1" or "2" or the name of the block.
title
Plot title
colorCol
Character specifying a pData column to use to colorise the plot points
sizeValues
Vector containing sizes for scores and loadings
shapeValues
Vector indicating the shapes for scores and loadings
background
Logical, whether to use a grey background
pointSize
Size of plot points
labelSize
Size of plot labels if not NULL
axisSize
Size of axis text
titleSize
Size of title text

Value

ggplot2 object

Examples

Run this code
data("STATegRa_S3")
B1 <- createOmicsExpressionSet(Data=Block1.PCA,pData=ed.PCA,
                               pDataDescr=c("classname"))
B2 <- createOmicsExpressionSet(Data=Block2.PCA,
                               pData=ed.PCA,pDataDescr=c("classname"))
# Omics components analysis
discoRes <- omicsCompAnalysis(Input=list(B1,B2),Names=c("expr","mirna"),
                              method="DISCOSCA",Rcommon=2,Rspecific=c(2,2),
                              center=TRUE,scale=TRUE,weight=TRUE)
jiveRes <- omicsCompAnalysis(Input=list(B1,B2),Names=c("expr","mirna"),
                             method="JIVE",Rcommon=2,Rspecific=c(2,2),
                             center=TRUE,scale=TRUE,weight=TRUE)

o2plsRes <- omicsCompAnalysis(Input=list(B1,B2),Names=c("expr","mirna"),
                              method="O2PLS",Rcommon=2,Rspecific=c(2,2),
                              center=TRUE,scale=TRUE,weight=TRUE)

# Biplot common part. DISCO-SCA

biplotRes(object=discoRes,type="common",comps=c(1,2),block="",
          title=NULL,colorCol="classname",sizeValues=c(2,4),
          shapeValues=c(17,0),background=TRUE,pointSize=4,
          labelSize=NULL,axisSize=NULL,titleSize=NULL)

# Biplot common part. O2PLS

p1 <- biplotRes(object=o2plsRes,type="common",comps=c(1,2),
                block="expr",title=NULL,colorCol="classname",
                sizeValues=c(2,4),shapeValues=c(17,0),
                background=TRUE,pointSize=4,labelSize=NULL,
                axisSize=NULL,titleSize=NULL)
p2 <- biplotRes(object=o2plsRes,type="common",comps=c(1,2),
                block="mirna",title=NULL,colorCol="classname",
                sizeValues=c(2,4),shapeValues=c(17,0),
                background=TRUE,pointSize=4,labelSize=NULL,
                axisSize=NULL,titleSize=NULL)

# Biplot distinctive part. O2PLS

p1 <- biplotRes(object=discoRes,type="individual",comps=c(1,2),
                block="expr",title=NULL,colorCol="classname",
                sizeValues=c(2,4),shapeValues=c(17,0),
                background=TRUE,pointSize=4,labelSize=NULL,
                axisSize=NULL,titleSize=NULL)
p2 <- biplotRes(object=discoRes,type="individual",comps=c(1,2),
                block="mirna",title=NULL,colorCol="classname",
                sizeValues=c(2,4),shapeValues=c(17,0),
                background=TRUE,pointSize=4,labelSize=NULL,
                axisSize=NULL,titleSize=NULL)

Run the code above in your browser using DataCamp Workspace