plot_shift_rank: Shifting Rank Plot

Description Usage Arguments Details Value See Also Examples

View source: R/shifting_plots.R

Description

Barplot of shift scores ranked by score.

Usage

1
2
3
4
5
6
plot_shift_rank(
  experiment,
  samples = "all",
  score_order = "descending",
  ncol = 3
)

Arguments

experiment

TSRexploreR object.

samples

A vector of sample names to analyze.

score_order

Either 'descending' or 'ascending'.

ncol

Integer specifying the number of columns to arrange multiple plots.

Details

The 'tss_shifting' function uses the earth mover's score (EMS) to assess shifts in TSS distribution in consensus TSRs between two samples. This function generates a barplot of shifting scores, with the x-axis corresponding to TSS clusters ordered by tss shifting score, and the y-axis the shifting score. TSRs can be in ascending or descending order as controlled by 'score_order'.

Value

ggplot2 object of ranked shifting scores.

See Also

tss_shift to calculate TSS cluster shifting.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(TSSs)
assembly <- system.file("extdata", "S288C_Assembly.fasta", package = "TSRexploreR")
samples <- data.frame(
  sample_name=c(sprintf("S288C_D_%s", seq_len(3)), sprintf("S288C_WT_%s", seq_len(3))),
  file_1=rep(NA, 6), file_2=rep(NA, 6),
  condition=c(rep("Diamide", 3), rep("Untreated", 3))
)

exp <- TSSs %>%
  tsr_explorer(sample_sheet=samples, genome_assembly=assembly) %>%
  format_counts(data_type="tss") %>%
  tss_clustering(threshold=3) %>%
  merge_samples(data_type="tss", merge_group="condition") %>%
  merge_samples(data_type="tsr", merge_group="condition") %>%
  tss_shift(
    sample_1=c(TSS="S288C_WT_1", TSR="S288C_WT_1"),
    sample_2=c(TSS="S288C_D_1", TSR="S288C_D_1"),
    comparison_name="Untreated_vs_Diamide",
    max_distance = 100, min_threshold = 10, n_resamples = 1000L
  )
  
p <- plot_shift_rank(exp)

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