score_metagene {PCBS}R Documentation

Make a metagene from PC Scores.

Description

Uses mean binned PC scores across a set of regions to draw a metagene.

Usage

score_metagene(ranks, regions, bin, title, xaxis, yaxis, 
chromDictObj, return.data, linecol)

Arguments

ranks

getPCRanks output data.frame

regions

A three-column data.frame containing a set of regions to test. Columns = chrom, start, end.

bin

integer, number of bins to use in metagenes. Default=100.

title

Output plot title

xaxis

Output plot x-axis title

yaxis

Output plot y-axis title

chromDictObj

Optional chromDictObject made from chromDict(), runs internally if set to NULL (default). Scripts that run this function multiple times will be sped up by setting this option.

return.data

T/F, whether to return a plot, or data that can be run with plot_metagene() or multiple_metagenes().

linecol

Colour for line, auto="red"

Value

If return.data=F, returns a grob containing a metagene plot. Otherwise, returns a list of two data.frames containing metagene and metagene standard error plotting information.

Examples

ranks <- getPCRanks(eigen, IDs = c("trt", "ctl"), PC = 1)
DMRs <- Get_Novel_DMRs(ranks, 2940, minCpGs=10)

# select chrom, start, and end of all hyper DMRs:
hyper_DMRs <- DMRs[DMRs$FDR <= 0.05 & DMRs$DMR_Zscore > 0,]
regions_hyper <- hyper_DMRs[c(1:3)] 
score_metagene(ranks, regions_hyper)

[Package PCBS version 0.1.0 Index]