plot_detected_features: Genes/Transcripts Detected

View source: R/gene_plots.R

plot_detected_featuresR Documentation

Genes/Transcripts Detected

Description

This plotting function returns a stacked barplot showing the number of features detected with and without a promoter proximal TSS or TSR. The information

Usage

plot_detected_features(
  experiment,
  samples = "all",
  data_type = c("tss", "tsr"),
  threshold = NULL,
  dominant = FALSE,
  use_normalized = FALSE,
  data_conditions = NULL,
  return_table = FALSE,
  ...
)

Arguments

experiment

TSRexploreR object.

samples

A vector of sample names to analyze.

data_type

Whether TSSs ('tss') or TSRs ('tsr') should be analyzed.

threshold

TSSs or TSRs with a score below this value will not be considered.

dominant

If TRUE, will only consider the highest-scoring TSS per gene, transcript, or TSR or highest-scoring TSR per gene or transcript.

use_normalized

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

data_conditions

Apply advanced conditions to the data.

return_table

Return a table of results instead of a plot.

...

Arguments passed to geom_col.

Details

This function will returnthe number of genes or transcripts with an associated unique TSS or TSR. Information on whether the feature has a promoter-proximal TSS or TSR is included in the output for plotting purposes.

A set of functions to control data structure for plotting are included. 'use_normalized' will use normalized scores, which only matters if 'consider_score' is TRUE. 'threshold' defines the minimum number of raw counts a TSS or TSR must have to be considered. dominant' specifies whether only the dominant TSS or TSR (determined using the 'mark_dominant' function) is considered. For TSSs, this can be either dominant TSS per TSR or gene/transcript, and for TSRs it is the dominant TSR per gene/transcript. 'data_conditions' can be used to filter, quantile, order, and/or group data for plotting.

Value

ggplot2 object of detected features.

See Also

annotate_features to annotate the TSSs or TSRs.

Examples

data(TSSs_reduced)
annotation <- system.file("extdata", "S288C_Annotation.gtf", package="TSRexploreR")

exp <- TSSs_reduced %>%
  tsr_explorer(genome_annotation=annotation) %>%
  format_counts(data_type="tss") %>%
  annotate_features(data_type="tss")

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


zentnerlab/TSRexploreR documentation built on Dec. 30, 2022, 10:27 p.m.