getModuleBED: Get a Module BED file

View source: R/Visualize_Comethylation_Network.R

getModuleBEDR Documentation

Get a Module BED file

Description

getModuleBED() takes a data.frame of regions with module annotations, converts it to the BED file format suitable for viewing it on the UCSC Genome Browser, and then saves it.

Usage

getModuleBED(
  regions,
  grey = FALSE,
  save = TRUE,
  file = "Modules.bed",
  verbose = TRUE
)

Arguments

regions

A data.frame of regions with module assignments, typically obtained from getModules().

grey

A logical(1) specifying whether to include "grey" (unassigned) regions in the BED file.

save

A logical(1) indicating whether to save the BED file.

file

A character(1) giving the file name (.BED).

verbose

A logical(1) indicating whether messages should be printed.

Details

getModuleBED() is designed to be used in combination with getModules(). The BED file produced includes a header line to enable single-step viewing on the UCSC Genome Browser. Each region is labeled by its RegionID and assigned module, and is colored by the module color. "Grey" (unassigned) regions are excluded by default, but can be optionally included.

Value

A BED file.

See Also

  • getModules() to build a comethylation network and identify modules of comethylated regions.

  • plotRegionDendro() to visualize region similarity and module assignments.

Examples

## Not run: 

# Get Comethylation Modules
modules <- getModules(methAdj, power = sft$powerEstimate, regions = regions,
                      corType = "pearson", file = "Modules.rds")

# Visualize Comethylation Modules
plotRegionDendro(modules, file = "Region_Dendrograms.pdf")
BED <- getModuleBED(modules$regions, file = "Modules.bed")

## End(Not run)


cemordaunt/comethyl documentation built on Oct. 20, 2023, 5:47 p.m.