Last data update: 2014.03.03

R: COMPLETE EXPORT AND VISUALIZATION OF DMRforPairs RESULTS
export_dataR Documentation

COMPLETE EXPORT AND VISUALIZATION OF DMRforPairs RESULTS

Description

Complete export of the DMRforPairs results. Export includes pdf's, thumbnails and TSV files describing the methylation status of all relevant (median delta M > dM_min) regions. M and beta values plotted against genomic position. Plots are generated for all samples and sample pairs (if n>2). Annotation information can be automatically looked up in the Ensembl database. If this is requested, integrated figures of the methylation pattern are generated including all transcripts annotated to the region of interest (+margin). This function also generates overviews (tables) in tsv and HTML format with information about the regions and their methylation status in the samples. This is done separately for all regions, regions with a relevant difference and regions with a significant difference.

Usage

export_data (tested,regions,th=0.05,annotate.relevant=FALSE,annotate.significant=TRUE,FigsNotRelevant=FALSE, min_n=4,min_dM=1.4,min_distance=200,margin=10000,clr=NA,method="fdr", experiment.name,debug=FALSE)

Arguments

tested

output of testregion

regions

output of regionfinder

th

p-value threshold for a DMR to be included as significant. (default=0.05; after correction for multiple testing)

annotate.relevant

By default annotations are only looked up for regions showing significant differential methylation patterns. Setting this parameter to TRUE will query Ensembl for the annotation info of each of the relevant (but not significant) regions as well. Please note that the database queries are slow and Ensembl might not accept an unlimited number of requests. (default=FALSE)

annotate.significant

By default annotations are only looked up for regions showing significant differential methylation patterns. Setting this parameter to FALSE will disable this feature (relevant on machines without an internet connection)(default=TRUE)

FigsNotRelevant

If TRUE, export_data() also exports figures (no annotation) for regions that do not show a relevant median difference in M value. Note that this will result in an extremely high number of files in the figures directory. (default=FALSE)

min_n

see DMRforPairs

min_dM

see DMRforPairs

min_distance

see DMRforPairs

margin

Margin in bp outside of each region that is queried in Ensembl and subsequently plotted). (default=10kb)

clr

Defines the colors to be used when plotting the different samples. If NA, colors are picked from the rainbow pallet. (default= NA)

method

see DMRforPairs

experiment.name

String. Is used to create a folder to export the results.

debug

see DMRforPairs

Details

In the output is organized according to all, relevant and significant regions:

  1. all: all regions identified by DMRforPairs

  2. relevant: regions identified by DMRforPairs with a median difference in M values between any pair of samples of > min_dM

  3. significant: relevant + Kruskall Wallis test shows a significant result (<th)

Writing permissions are required in the working directory when using the export and visualization functions of DMRforPairs. Internet access is required to use the annotation features.
By default, DMRforPairs creates a folder (experiment.name) within the current working directory in which the output is stored. This is done within the export_data wrapper which should be run before any other (specific) analysis are performed (exploration phase, see DMRforPairs-package. A complete export generates a large number of files which are stored out of sight (experiment.name/figures). Figures and overviews of statistics are most conveniently accessed through the HTML tables.

Value

The output is comparable to that of testregion, supplemented with external links (Ensembl, UCSC) and annotation info if requested.

Author(s)

Martin Rijlaarsdam, m.a.rijlaarsdam@gmail.com

See Also

DMRforPairs, regionfinder, testregion, plot_annotate_region, plot_annotate_probes.

Examples

#For the this step, pleas ensure that you have writing 
#permissions in your working directory. If any of the
#annotate parameters is set to TRUE, an internet connection
#is required.
data(DMRforPairs_data)
experiment="example_DMRforPairs"

#Export the results from output using the default settings;
#annotation is disabled as to prevent problems on (build)
#systems without an internet connection. A folder 
#"example_DMRforPairs" containing the resuls is created in 
#your working directory.
tested_inclannot=export_data(tested=example_output_DMRforPairs$tested, 
regions=example_output_DMRforPairs$regions, 
experiment.name=experiment,
annotate.significant=FALSE,
annotate.relevant=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DMRforPairs)
Loading required package: Gviz
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit


Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: grid
Loading required package: R2HTML
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/DMRforPairs/export_data.Rd_%03d_medium.png", width=480, height=480)
> ### Name: export_data
> ### Title: COMPLETE EXPORT AND VISUALIZATION OF DMRforPairs RESULTS
> ### Aliases: export_data
> ### Keywords: export_visualization
> 
> ### ** Examples
> 
> #For the this step, pleas ensure that you have writing 
> #permissions in your working directory. If any of the
> #annotate parameters is set to TRUE, an internet connection
> #is required.
> data(DMRforPairs_data)
> experiment="example_DMRforPairs"
> 
> #Export the results from output using the default settings;
> #annotation is disabled as to prevent problems on (build)
> #systems without an internet connection. A folder 
> #"example_DMRforPairs" containing the resuls is created in 
> #your working directory.
> tested_inclannot=export_data(tested=example_output_DMRforPairs$tested, 
+ regions=example_output_DMRforPairs$regions, 
+ experiment.name=experiment,
+ annotate.significant=FALSE,
+ annotate.relevant=FALSE)
Preparing export
Generating images for relevant regions (if annotation is requested, this can take quite long).
Generating images for significant regions (if annotation is requested, this can take quite long).
Exporting tables (HTML & CSV)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>