Export differentially methylated region (DMR) results to an Excel workbook, creating one worksheet per contrast.

writeDMRsToExcel(dataTable, path, FDRthres = 0.05)

Arguments

dataTable

data.frame or GRanges DMR results, typically produced by calculateDMRs(). If a GRanges, it will be coerced to a data frame internally.

path

character(1) File path of the Excel workbook to write (e.g., "dmr_results.xlsx").

FDRthres

numeric(1) False discovery rate threshold used to filter DMRs before writing. Default: 0.05.

Value

(Invisibly) returns the input object:

  • writeDMRsToExcel(): returns dataTable (invisibly), enabling use in a pipeline.

Details

One worksheet is created per contrast found in dataTable. If no contrast column is present, all rows are written to a single worksheet. If file I/O is restricted on the system (e.g., some HPC build environments), consider writing to tempfile(fileext = ".xlsx") in examples or tests.

Examples

data(exampleDMRs, package = "mesa")

# Example with multiple contrasts and annotation
exampleDMRs %>%
    writeDMRsToExcel(path = file.path(tempdir(), "test.xlsx"))