createSpectralMap: Generate SpectralMaps using the first 3 PCs

Description Usage Arguments Details Note

View source: R/functions-svd.R

Description

This function is a wrapper for esetVis::esetSpectralMap() and will generate 4 images (2x2). The first three images represent SpectralMaps where the largest PCs are plotted against each other. The final image is a barplot representing the 20 largest PCs. Also, this funciton separates esetVis::esetSpectralMap()'s SVD computation and plotting step resulting in a single SVD computation and thereafter plotting the required biplots.

Usage

 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
createSpectralMap(
  eSetObj,
  mainTitle = NULL,
  col2use = NULL,
  group1 = NULL,
  group2 = NULL,
  outputDir = NULL,
  studyName = NULL,
  spec.width = 1600,
  spec.height = 1200,
  spec.res = 100,
  output = "RShiny",
  returnAnalysis = FALSE,
  max.PC = 20,
  seperate.plots = FALSE,
  factorReference = NULL,
  showText = TRUE,
  TSNE = F,
  individualScale = 0.75,
  exact1 = FALSE,
  exact2 = FALSE,
  topSamples = 5,
  topGenes = 5,
  removeControlProbesets = FALSE,
  cloudGenes = TRUE,
  pcaResult = NULL,
  svd.method = c("default_svd", "fast_svd", "truncated_svd"),
  showRShinyProgress = TRUE
)

Arguments

mainTitle

character; main title used on each plot.

col2use

vector or list; colors to use for the different factorlevels defined further below (group1). If this is a "colorKey" class, the proper colors will assigned to the corresponding factor levels.

group1

character; (part of the) column header of pData(eSetObj) to group the samples on. Different colors will be assigned to different levels in this group (see also col2use). Use in conjunction with exact1 parameter.

group2

character; (part of the) column header of pData(eSetObj) to group the samples on. Different shapes will be given to different factor levels. Use in conjunction with exact2 parameter.

outputDir

character; Directory to store the output files in.

studyName

character; Description of the study, will be used in generating the output filename (if output was set to "png") and is also shown in each image title.

spec.width

numeric; width (in pixels) of the created image (default: 1600)

spec.height

numeric; height (in pixels) of the created image (default: 1200)

spec.res

numeric; resolution of the created image (default: 100)

output

character; output type. Can be either to a PNG file ("png"), the screen ("x11") or to an RMarkdown document ("rmd") or prepare for Shiny (RShiny)

returnAnalysis

boolean; Should the function return the values used for generating the ggplot?

max.PC

numeric; number of principal components to include in the barplot. Default: 20

seperate.plots

boolean; Do you want to plot individual spectralmap plots?

factorReference

vector; Order of your factor levels. Each value should be uniquely found (but is not case sensitive)

showText

boolean; Print text to the screen (intended for Rmarkdown, but probably obsolete due to using message() now)

TSNE

boolean; Do we want to include a TSNE plot as well? (default: FALSE)

pcaResult

mpm class object; Parameter to provide a pre-computed PCA object as returned by function flexible_mpm() OR provide a PCA object with signature identical to an object returned by function flexible_mpm(). Default value is NULL. If an object is provided then the function will skip the PCA computation step and directly proceed to plotting biplots and histogram.

svd.method

character; Character indicating the algorithm to be used for singular value decomposition (SVD). Valid inputs are 'default_svd', 'fast_svd' and 'truncated_svd'. Default value is 'default_svd'. 'default_svd' calls base::La.svd for SVD computation. 'fast_svd' computes SVD faster than 'default_svd' as it uses corpcor::fast.svd rather than base::La.svd. However, as the tolerance level of base::La.svd and corpcor::fast.svd are different the number of principal components computed might be different. For 'truncated_svd' the number of principal components computed is equivalent to the value of max.PC.

showRShinyProgress

show progress bar in R Shiny apps

eSetobj

ExpressionSet object. One requirement: the featureData(eSetObj) must contain a column called 'SYMBOL'.

individualscale

numeric; scaling of the dimensions (spec.width and spec.height) for generating individual plots. Default is 0.5 to ensure the individual images are as large as the ones in the 2x2 image.

exact1;

boolean; Did you specify an exact column header name match for group1?

exact2;

boolean; Did you specify an exact column header name match for group2?

topSamples;

integer; numeric indicating which percentile (if <=1) or number (if >1) of samples most distant to the origin of the plot to annotate, by default: 5 samples are selected If no samples should be annotated, set this parameter to 0.

topGenes;

integer; numeric indicating which percentile (if <=1) or number (if >1) of genes most distant to the origin of the plot to annotate, by default: 5 genes are selected If no genes should be annotated, set this parameter to 0

removeControlProbesets;

boolean; Remove the AFFX control probesets prior to calculating the spectralMaps? Default: TRUE.

cloudGenes;

boolean; if TRUE (by default), include the cloud of genes in the plot.

...;

Additional parameters for eSetSpectralMap. See also ?eSetSpectralMap

Details

createSpectralMap

Note

A requirement (for now) is that the featureData(eSetObj) MUSt contain a column named 'SYMBOL' (case sensitive!)


Paradigm4/revealgenomics documentation built on April 7, 2020, 2:01 a.m.