plot_reduction: Dimensionality Reduction.

Description Usage Arguments Details Value Examples

View source: R/dim_reduction.R

Description

Dimensionality reduction using PCA.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_reduction(
  experiment,
  samples = "all",
  data_type = c("tss", "tsr", "tss_features", "tsr_features"),
  use_normalized = TRUE,
  remove_var = NULL,
  center = TRUE,
  scale = TRUE,
  ...
)

Arguments

experiment

TSRexploreR object.

samples

A vector of sample names to analyze.

data_type

Whether to analyze TSSs ('tss') or TSRs ('tsr').

use_normalized

Whether to use the normalized (TRUE) or raw (FALSE) counts.

remove_var

Remove features in this bottom fraction.

center

Center the data (TRUE).

scale

Scale the data (TRUE).

...

Additional arguments passed to PCAtools::biplot.

Details

This function will generatete a PCA plot of the first two PCs. This helps to visualize the relative similarity of samples based on the most variable features.

'remove_var' removes features in the bottom fraction of variance. 'center' and 'scale' will center and scale the data, respectively.

Value

ggplot2 object of PCA plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(TSSs)
samples <- data.frame(
  sample_name=sprintf("S288C_D_%s", seq_len(2)),
  file_1=NA, file_2=NA,
  condition="Diamide"
)

exp <- TSSs[seq_len(2)] %>%
  tsr_explorer(sample_sheet=samples) %>%
  format_counts(data_type="tss") %>%
  normalize_counts(method="CPM")

p <- plot_reduction(exp, data_type="tss")

rpolicastro/tsrexplorer documentation built on Oct. 17, 2021, 3:02 p.m.