apply_threshold: Apply a threshold to TSSs or TSRs

apply_thresholdR Documentation

Apply a threshold to TSSs or TSRs

Description

Filter TSSs based on given threshold.

Usage

apply_threshold(experiment, threshold, n_samples = 1, use_normalized = FALSE)

Arguments

experiment

TSRexploreR object.

threshold

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

n_samples

Number of samples threshold must be reached to keep TSS. By default set to 1 sample. A NULL value will result in all samples being required to have read counts above the threshold at a given TSS position

use_normalized

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

Details

All TSSs mapping methods produce spurious TSSs. For the most part, these spurious reads TSSs to be weak and somewhat uniformly distributed throughout promoters and gene bodies. This means that this background can be mitigated by requiring a minimum read threshold for a TSS to be considered in downstream analyses.

This function will remove TSSs from the TSS data.table if no sample has at least 'threshold' number of reads in at least 'n_samples' number of samples.

Value

TSRexploreR object with weak TSSs filtered out of counts table.

See Also

plot_threshold_exploration to explore fraction of promoter proximal TSSs, and absolute number of detected genes.

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")
  
exp <- apply_threshold(exp, threshold=3)


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