Computes average signal (in the score GRanges metadata column) genome-wide and on each chromosome (each individual sequence determined by seqnames).

average_chr_signal(gr, remove_cen = FALSE, genome,
  cen_region_length = 50000, mean_norm = FALSE, order_chrs = FALSE)

Arguments

gr

Input signal track data as a GRanges object (see ?"GRanges-class" for more details). To load wiggle and bedGraph data run import_wiggle and import_bedGraph, respectively. No default.

remove_cen

Logical indicating whether to remove regions around centromeres. Defaults to FALSE.

genome

Character string indicating reference genome used to align the data. Must be provided when remove_cen = TRUE, in order to load appropriate centromere data, or order_chrs = TRUE, in order to load chromosome length data. Accepts one of the following strings:

  1. "SK1Yue"

  2. "sacCer3"

  3. "SK1"

No default.

cen_region_length

Integer indicating the length (in bp) of the region to remove (centered on the centromere of each chromosome). Defaults to 50'000 bp.

mean_norm

Logical indicating whether to normalize by average genome-wide score. This adds two columns to the dataframe (first element of the output list): mean ratio (avrg_signal_mean_ratio) and mean-subtracted (avrg_signal_mean_subtracted). Defaults to FALSE.

order_chrs

Logical indicating whether to order rows by chromosome length (in increasing order). Defaults to FALSE.

Value

List with two elements:

  1. seq_avrg Average score on each sequence (dataframe)

  2. genome_avrg Average score genome-wide (named vector)

Examples

# NOT RUN {
average_chr_signal(GRanges_object)

average_chr_signal(anti_Rec8, remove_cen=TRUE, mean_norm=TRUE, order_chrs=TRUE)

average_chr_signal(anti_Rec8, remove_cen=TRUE, genome = 'SK1Yue',
                   cen_region_length=40000, mean_norm=TRUE, order_chrs=TRUE)
# }