apply_threshold.Rd
Filter TSSs based on given threshold.
apply_threshold(experiment, threshold, n_samples = 1, use_normalized = FALSE)
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. |
TSRexploreR object with weak TSSs filtered out of counts table.
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.
plot_threshold_exploration
to explore fraction of
promoter proximal TSSs, and absolute number of detected genes.
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")#>#>#>#>#>#> Warning: The "phase" metadata column contains non-NA values for features of type #> stop_codon. This information was ignored.#>exp <- apply_threshold(exp, threshold=3)