Pulls out the ChIP signal over all ORFs in the genome normalized to a constant length. Collects the signal over each ORF plus both flanking regions (1/2 the length of the ORF on each side) and scales them all to the same value (1000). This means that for two example genes with lengths of 500 bp and 2 kb, flanking regions of 250 bp and 1 kb will be collected up and downstream, respectively. The whole region is then rescaled to a length of 1000, corresponding to a gene length of 500 plus 250 for each flanking region.

signal_at_orf2(signal_data, gff, window_size = 1, write_to_file = FALSE,
  file_name)

Arguments

signal_data

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.

gff

Either a path to a gff file or loaded gff data as a GRanges object. No default.

window_size

Integer specifying the width in bp of a window to average signal in. Defaults to 1 (no averaging).

write_to_file

Logical indicating whether output should be written to a .txt file. The file will be saved at location provided in file_name argument or at the current working directory if only a file name is provided). If write_to_file = FALSE the function returns output R object. Defaults to FALSE.

file_name

Character string indicating file name when writing output to a .txt file. Must be provided if write_to_file = TRUE. No default.

Value

An EnrichedHeatmap matrix with 1000 columns containing signal at each meta position. Columns correspond to the following meta positions:

  1. t1 to t250 Upstream flank (1/2 of gene length)

  2. t251 to t750 ORF

  3. t751 to t1000 Downstream flank (1/2 of gene length)

Warning

Our ChIP-seq data always contains gaps with missing data. The affected genes will contain "NA" values in the output. As a warning, the number of affected genes is printed to the console.

Examples

# NOT RUN {
signal_at_orf2(WT, gff = gff)

signal_at_orf2(WT, gff = "S288C_annotation_modified.gff",
               write_to_file = TRUE, file_name = "WT_S288C_metaORF.txt")
# }