score_metagene.Rd
Uses mean binned PC scores across a set of regions to draw a metagene.
score_metagene(ranks, regions, bin, title, xaxis, yaxis,
chromDictObj, return.data, linecol)
getPCRanks output data.frame
A three-column data.frame containing a set of regions to test. Columns = chrom, start, end.
integer, number of bins to use in metagenes. Default=100.
Output plot title
Output plot x-axis title
Output plot y-axis title
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.
T/F, whether to return a plot, or data that can be run with plot_metagene() or multiple_metagenes().
Colour for line, auto="red"
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.
ranks <- getPCRanks(eigen, IDs = c("trt", "ctl"), PC = 1)
DMRs <- Get_Novel_DMRs(ranks, 2940, minCpGs=10)
#> Splitting data by chromosome...
#> Bootstrapping background distributions for each chromosome...
#> Compressing nearby seeds...
#> done! Collapsed 2940 seeds to 250 seeds!
#>
#> Expanding DMRs from 250 seeds...
#> Trimming 135 DMRs...
#> done!
# 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)
#> Creating chromDict Object. If you plant to run the score_metagene() function multiple times, it is strongly recommended to generate a chromDict Object with the chromDict() function, and specify it with score_metagene(..., chromDictObj=OBJECT). This is the most computationally intensive part of metagene creation, and only needs to be done once.