knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = TRUE, out.width = "100%" )
library(massdataset) library(tidyverse) library(massqc) data("sample_info", package = "massdataset") data("expression_data", package = "massdataset") data("variable_info", package = "massdataset") object = create_mass_dataset( expression_data = expression_data, sample_info = sample_info, variable_info = variable_info ) object
object %>% massqc_pca() object %>% massqc_pca(color_by = "class") ###scale and then PCA object %>% scale %>% massqc_pca(color_by = "class") ###log scale and then PCA object %>% `+`(1) %>% log %>% scale %>% massqc_pca(color_by = "class") object %>% scale %>% massqc_pca(color_by = "class", frame = FALSE) + ggsci::scale_fill_lancet() object %>% scale %>% massqc_pca(color_by = "class", frame = FALSE) + ggsci::scale_fill_lancet() + ggrepel::geom_text_repel(aes(label = sample_id)) object %>% scale %>% massqc_pca(color_by = "class", frame = FALSE) + ggsci::scale_fill_lancet() + ggrepel::geom_text_repel(aes(label = ifelse(class == "QC", sample_id, NA)))
####only show the PC1 object %>% massqc_pca_pc1() object %>% massqc_pca_pc1(color_by = "class") object %>% `+`(1) %>% log() %>% scale %>% massqc_pca_pc1(color_by = "class") object %>% `+`(1) %>% log() %>% scale %>% massqc_pca_pc1( color_by = "class", order_by = "injection.order", point_alpha = 1, point_size = 5 ) + ggsci::scale_color_lancet() object %>% `+`(1) %>% log() %>% scale %>% massqc_pca_pc1( color_by = "class", order_by = "injection.order", point_alpha = 1, point_size = 5, desc = TRUE ) + ggsci::scale_color_lancet()
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.