pcaMatrix: Generate a series of plots comparing the first 10 PCs of a...

Description Usage Arguments Value

Description

Takes ExpressionSet object, performs PCA on the transposed expression matrix, then plots the projections of the sample scores on the first 10 PCs.

Usage

1
2
3
4
pcaMatrix(cellData, scree = FALSE, center = TRUE, scale = FALSE,
  ICA = FALSE, groups, values, gene, colors, logNumeric = TRUE,
  refPC = "PC1", alpha = 0.7, dotsize = 2, bubble = FALSE, bubbleSizes,
  print = FALSE, printNum = 50, save = FALSE)

Arguments

cellData

ExpressionSet object created with readCells (and preferably transformed with prepCells). It is also helpful to first run reduceGenes_var.

scree

Boolean specifying whether to generate a scree plot showing the amount of variance contributed by each PC.

center

Boolean specifying whether to the center the data prior to PCA. This is generally recommended.

scale

Boolean specifying whether the data should be scaled prior to PCA. This is generally not recommended unless samples have different units (e.g. some samples are counts and some are TPMs).

groups

Character string specifying the title of the column in pData that contains the names of the groups to which each sample belongs. The dots representing each sample in the plots will be colored by group. The column length should be the same length as the number of samples.

values

Character string specifying the title of the column in pData that contains a vector of numeric values to be plotted as a color gradient on the dots in the plots. The column length should be the same length as the number of samples. Gene and values cannot be specified simultaneously. If groups and values are both specified, gene will be used for coloring. Set bubble to TRUE to display group information as well.

gene

Character string specifying a gene whose expression values will be plotted a color gradient on the dots in the plots. One gene name should be specified, and the gene must be present within the expression table. Gene and values cannot be specified simultaneously. If groups and gene are both specified, gene will be used for coloring. Set bubble to TRUE to display group information as well.

colors

Vector of character strings of length 2 specifying the color range for values or gene. If not specified, a default black-to-yellow color gradient will be used.

logNumeric

Boolean specifying whether the numbers in values should be transformed to log2 space.

refPC

Character string specifying the PC to be used as the reference PC that is plotted on the x-axis of every plot.

alpha

Numeric specifying the transparency (from 0 to 1) level of the dot colors.

dotsize

Numeric specifying the size of the dots in the plots.

bubble

Boolean specifying whether dots of different sizes should be plotted to display information about another variable on the plot.

bubbleSizes

Vector of numerics specifying the dot sizes for each group within groups. Length of bubbleSizes should be the same length as groups. If bubbleSizes is not specified, default sizes will be generated according to the levels in the groups column. Useful for displaying group information along with values or gene. Additionally, can be used to indicate additional information about groups. E.g. if the levels in groups are 'A1', 'B1', 'C2', and 'D2', bubbleSizes could be c(3,3,6,6) to indicate the '1' and '2' components of the groups with different dot sizes.

print

Boolean specifying whether the genes with the most positive and negative loadings on each of the 10 PCs should be printed in the terminal window.

printNum

Integer specifying the number of genes from each PC to print.

save

Boolean specifying whether to save the resultant plots as a .tiff file.

Value

Matrix of PCA plots for the first 10 PCs.


joeburns06/hocuspocus documentation built on May 19, 2019, 2:59 p.m.