massqc_pca: massqc_pca

View source: R/massqc_pca.R

massqc_pcaR Documentation

massqc_pca

Description

Boxplot for each samples.

Usage

massqc_pca(
  object,
  color_by,
  point_alpha = 0.8,
  frame = TRUE,
  frame.type = "norm",
  line = TRUE,
  ...
)

Arguments

object

tidymass-class object.

color_by

which column (sample_info) is used to color samples

point_alpha

point_alpha

frame

?ggplot2::autoplot

frame.type

?ggplot2::autoplot

line

Add lines or not.

...

other paramters for ggplot2::autoplot

Value

ggplot2 plot.

Author(s)

Xiaotao Shen shenxt1990@163.com

Examples

library(massdataset)
library(ggplot2)
data("expression_data")
data("sample_info")
data("variable_info")

object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info
  )

object %>%
  massqc_pca()

object %>%
  massqc_pca(color_by = "class")

object %>%
  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)))

tidymass/massqc documentation built on Sept. 24, 2022, 9:23 p.m.