MDS_var_explained: Function MDS_var_explained

Description Usage Arguments Value Author(s) Examples

View source: R/ggplotMDS.R

Description

Takes a class MDS object from limma::plotMDS and generates two plots: 1) fraction of variance for each dimension, 2) cumulative variance. By default, it plots the first 10 dimensions or the first N dimensions totaling 90 topN and cumVarLimit arguments to change the defaults.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
MDS_var_explained(
  mds,
  topN = 10,
  cumVarLimit = 0.9,
  barColor = "dodgerblue4",
  barFill = "dodgerblue3",
  barWidth = 0.65,
  barSize = 0.1,
  baseFontSize = 14
)

Arguments

mds

A class MDS object from limma::plotMDS or a data matrix to analyze (typically log2) (required)

topN

The number of dimensions to plot (Default = 10)

cumVarLimit

The maximum cumulative variance to plot. Range 0-1. (Default = 0.9)

barColor

Default = "dodgerblue4"

barFill

Default = "dodgerblue3"

barWidth

range 0-1. (Default = 0.65)

barSize

Thickness of the fill border (Default = 0.1)

baseFontSize

Base fontsize for the plot (Default = 14)

Value

A list with two ggplots and the variance explained data.frame.

Author(s)

John Thompson, jrt@thompsonclan.org

Examples

1
2
3
4
5
6
7
8
9
     #Plot the first two dimensions
     MyMDS = ggplotMDS (MyDGEList)
     MyMDS[[1]]  #the MDS plot

     #Then apply MDS_var_explained (the MDS object is MyMDS[[2]])
     varResults <- MDS_var_explained(MyMDS[[2]])
     varResults[[1]] #the Variance per dimension plot
     varResults[[2]] #the cumulative variance plot
     var_explained <- varResults[[3]]  #data used for plotting (unfiltered)

jrthompson54/DGE.Tools2 documentation built on May 12, 2021, 8:47 p.m.