count.pca: PCA and Pearson correlation plots from counts table

Description Usage Arguments Value See Also Examples

View source: R/count.pca_function.R

Description

Basic comparison of CRISPR screen counts: PCA and Pearson correlation plots

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
count.pca(
  countsTable,
  metadata,
  identifier1 = NULL,
  identifier2 = NULL,
  identifier3 = NULL,
  batch = FALSE,
  batch.id = NULL,
  save = F
)

Arguments

countsTable

input matrix containing normalized gRNA counts with gRNA ids as row names

metadata

input dataframe containing sample names and other identifiers or data

identifier1

string identifying column name of metadata with which to adjust color in PCA plot

identifier2

string identifying column name of metadata with which to adjust size in PCA plot

identifier3

string identifying column name of metadata with which to adjust shape in PCA plot

batch

logical - correct for batch effects (requires a batch.id input)

batch.id

numerical - column of metadata that identifies the batch effect to remove

save

logical - do you want to save the violin plot to pdf

Value

ggplot object of the violin plot

See Also

ggbiplot which this function uses to plot PCAs

ggplot which this function uses to plot Pearson correlations

Examples

1
2
3
4
5
6
7
y <- matrix(rnorm(100*9, mean = 10, sd = 1),100,9)
y[,1:3] <- y[,1:3] + 5
metadata <- data.frame(sample = paste0('sample.',1:9), batch = c("A","A","A","B","B","B","C","C","C"))

count.pca(y, metadata, identifier1 = 'sample')
count.pca(y, metadata, identifier1 = 'sample', batch = T, batch.id = 'batch')
...

christensensm/COMPOSE documentation built on Dec. 22, 2020, 3:43 a.m.