plot_pca: Generate a PCA plot from a gene expression matrix

Description Usage Arguments Value Examples

Description

This function is able to log transform (use rlog function in DESeq2 package) count data originated from a RNA-seq experiment, and draw a PCA plot to reflect sample relationship. That's a good way to check batch effect from gene expression matrix.

Usage

1
plot_pca(count, color, shape, color.legend = "cell", shape.legend = "donor")

Arguments

count

the gene expression count matrix

color

a character vector whose length is same as samples, different value corresponds to different point color in the plot

shape

a character vector whose length is same as samples, different value corresponds to different point shape in the plot

color.legend

the legend text corresponds to point color

shape.legend

the legend text corresponds to point shape

Value

a ggplot object

Examples

1
2
3
4
count = matrix(rpois(400, 101:140), 100, 4)
colnames(count) <- paste("sample", 1:4, sep="_")
rownames(count) <- paste("gene", 1:100, sep="_")
plot_pca(count, rep(c('c1','c2'), 2), rep(c('d1', 'd2'), each=2))

jzsh2000/jzshr documentation built on May 20, 2019, 6:29 a.m.