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

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.

Value

ggplot2 object of detected features.

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.

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")
#> Import genomic features from the file as a GRanges object ...
#> OK
#> Prepare the 'metadata' data frame ...
#> OK
#> Make the TxDb object ...
#> Warning: The "phase" metadata column contains non-NA values for features of type #> stop_codon. This information was ignored.
#> OK
p <- plot_detected_features(exp, data_type="tss")