tidyMetaProfile: TeMPO: Tidy Meta Profiles

Description Usage Arguments Value Examples

Description

TeMPO: Tidy Meta Profiles

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
tidyMetaProfile(sites, forward, reverse = NULL, upstream = 100,
  downstream = 100, trimLower = 0, trimUpper = 1,
  sumFun = matrixStats::colMeans2)


  ## S4 method for signature 
## 'GenomicRanges,BigWigFile_OR_RleList,NULL_OR_missing'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = colMeans)


  ## S4 method for signature 
## 'GenomicRanges,BigWigFile_OR_RleList,BigWigFile_OR_RleList'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = matrixStats::colMeans2)


  ## S4 method for signature 
## 'GenomicRangesList,BigWigFile_OR_RleList,NULL_OR_missing'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = matrixStats::colMeans2)


  ## S4 method for signature 
## 'GenomicRangesList,BigWigFile_OR_RleList,BigWigFile_OR_RleList'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = matrixStats::colMeans2)


  ## S4 method for signature 
## 'GenomicRanges_OR_GenomicRangesList,
##   BigWigFileList_OR_RleListList,
##   NULL_OR_missing'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = matrixStats::colMeans2)


  ## S4 method for signature 
## 'GenomicRanges_OR_GenomicRangesList,
##   BigWigFileList_OR_RleListList,
##   BigWigFileList_OR_RleListList'
tidyMetaProfile(sites,
  forward, reverse = NULL, upstream = 100, downstream = 100,
  trimLower = 0, trimUpper = 1, sumFun = matrixStats::colMeans2)

Arguments

sites

GenomicRanges: Single-bp genomic locations to calculate the meta-profile over.

forward

BigWigFile or RleList: Genome-wide signal stored either on disk as a BigWig-file or in memory as an RleList-object.

reverse

BigWigFile, RleList or NULL: If reverse=NULL, the forward signal is taken as unstranded. If not the genomic signal is taken to be stranded. The class of reverse must be the same as forward.

upstream

integer: Number of bases to extend upstream.

downstream

integer: Number of bases to extend downstream

trimLower

numeric: Lower quantile used for trimming.

trimUpper

numeric: Upper quantile used for trimming.

sumFun

function: The function used for summarising the metaprofile. Should be similar to colSums.

Value

A tibble with the following columns

pos0

0-based position relative to sites, useful for plotting

pos1

1-based position relative to sites

sense

Summarized signal for each position

Depending on the input, addditional columns might be added

anti

If reverse is supplied the genome-wide signal is assumed to be stranded, and the output is split into sense/antisense relative to the orientation of sites.

sites

If sites is a GRangesList, indicates the different sets of sites

signal

if forward/reverse is a BigWigFileList or an RleListList, indicates the different genomic signals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data("CAGE_clusters")
data("CAGE_plus")
data("CAGE_minus")

# Stranded Meta-profile across enhancers:
P <- tidyMetaProfile(sites = subset(CAGE_clusters, clusterType=="enhancer"),
                     forward = CAGE_plus,
                     reverse = CAGE_minus,
                     upstream=200,
                     downstream=200)

# Plot the resulting tibble with ggplot2:
library(tidyr)
library(ggplot2)

P %>%
gather(key="direction", value="score", sense, anti, factor_key=TRUE) %>%
ggplot(aes(x=pos0, y=score, color=direction)) +
geom_line(alpha=0.75) +
scale_color_brewer("Direction", palette="Set1") +
labs(x="Relative position from center",
y="Average Signal")

# See the TeMPO vignette for more examples and settings!

MalteThodberg/TeMPO documentation built on May 15, 2019, 11:48 a.m.