Description Usage Arguments Details Value Examples
'pca_plot()' plots the first two PC in a scatterplot.
1 |
voom_data, |
voom object |
metadata |
cleaned metadata for RNAseq data |
... |
arguments to aes |
Like any other ggplot object, you can customize the theme of the plot. Note that this function generates a fairly generic PCA plot, and thus is intended for quick exploratory purposes (much like the intention behind 'qplot()').
a scatterplot of the first two PC (ggplot object)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # As an EDA step within a pipeline of functions
counts <- readr::read_delim("data/GSE60450_Lactation-GenewiseCounts.txt", delim = "\t")
meta <- readr::read_delim("data/SampleInfo_Corrected.txt", delim = "\t") %>%
mutate(FileName = stringr::str_replace(FileName, "\\.", "-"))
id <- as.character(counts$EntrezGeneID)
my_design <- check_sample_names(counts, c(1,2), meta, FileName) %>%
purrr::pluck("meta") %>%
make_design_matrix(., c("Status"))
check_sample_names(counts, c(1,2), meta, FileName) %>%
purrr::pluck("mod_count") %>%
filter_genes(., id, "edgeR") %>%
make_voom(., my_design) %T>%
{print(pca_plot(., check_sample_names(counts, c(1,2), meta, FileName) %>%
purrr::pluck("meta")))} %>%
model_limma() %>%
make_contrasts(design_matrix = my_design, Statuspregnant, Statusvirgin) %>%
model_bayes()
prcomp_obj, result from prcomp()
index, which PCA you want
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.