Title: | RnBeads |
---|---|
Description: | RnBeads facilitates comprehensive analysis of various types of DNA methylation data at the genome scale. |
Authors: | Yassen Assenov [aut], Christoph Bock [aut], Pavlo Lutsik [aut], Michael Scherer [aut], Fabian Mueller [aut, cre] |
Maintainer: | Fabian Mueller <[email protected]> |
License: | GPL-3 |
Version: | 2.25.0 |
Built: | 2024-11-17 06:45:22 UTC |
Source: | https://github.com/bioc/RnBeads |
Extract parts of BigFfMat
## S4 method for signature 'BigFfMat,ANY,ANY,ANY' x[i, j, drop = TRUE]
## S4 method for signature 'BigFfMat,ANY,ANY,ANY' x[i, j, drop = TRUE]
x |
BigFfMat object |
i |
row indices (integer, logical, character are allowed) |
j |
column indices (integer, logical, character are allowed) |
drop |
analogous to generic drop |
Replace parts of BigFfMat
## S4 replacement method for signature 'BigFfMat,ANY,ANY,ANY' x[i, j] <- value
## S4 replacement method for signature 'BigFfMat,ANY,ANY,ANY' x[i, j] <- value
x |
BigFfMat object |
i |
row indices (integer, logical, character are allowed) |
j |
column indices (integer, logical, character are allowed) |
value |
replacement values |
The values of options in RnBeads are stored in dedicated R objects accompanying the package. These objects are named
infos
, accepted
, current
and previous
. They should not be loaded or otherwise operated on
by users. Please refer to the documentation of rnb.options
for accessing and modifying option values in
RnBeads.
infos
is a data.frame
containing information about all options in RnBeads. Row names in
this table are the option names; the column names are "Type"
, "Named"
, "Null"
,
"Max"
, "Min"
, "MaxInclusive"
and "MinInclusive"
.
accepted
is a list
containing the sets of accepted values for some of the options.
current
is a list
with current values for all options.
previous
is a list
with previous values for the affected options; this list is only temporarily
used while setting option values through rnb.options
or rnb.xml2options
.
Yassen Assenov
Adds a differential methylation table
## S4 method for signature 'RnBDiffMeth' addDiffMethTable( object, dmt, comparison, region.type, grp.labs = c("group1", "group2") )
## S4 method for signature 'RnBDiffMeth' addDiffMethTable( object, dmt, comparison, region.type, grp.labs = c("group1", "group2") )
object |
|
dmt |
Differential methylation table to add |
comparison |
character or index of the comparison of the table to retrieve |
region.type |
character or index of the region type of the table to retrieve |
grp.labs |
character vector of length 2 specifying the names of the groups being compared |
the updated RnBDiffMeth object
Caveat: if disk dumping is enabled the resulting object tables will be stored in the initial location of the object.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) s.groups <- rnb.sample.groups(rnb.set.example,"Sample_Group")[[1]] dmt.sites <- computeDiffTab.extended.site(meth(rnb.set.example),s.groups[[1]],s.groups[[2]]) map.regions.to.sites <- regionMapping(rnb.set.example,"promoters") dmt.promoters <- computeDiffTab.default.region(dmt.sites,map.regions.to.sites) cmp.name <- get.comparisons(dm)[1] grp.labs <- get.comparison.grouplabels(dm)[1,] #add the promoter level differential methylation table dm.add <- addDiffMethTable(dm,dmt.promoters,cmp.name,"promoters",grp.labs) get.region.types(dm.add)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) s.groups <- rnb.sample.groups(rnb.set.example,"Sample_Group")[[1]] dmt.sites <- computeDiffTab.extended.site(meth(rnb.set.example),s.groups[[1]],s.groups[[2]]) map.regions.to.sites <- regionMapping(rnb.set.example,"promoters") dmt.promoters <- computeDiffTab.default.region(dmt.sites,map.regions.to.sites) cmp.name <- get.comparisons(dm)[1] grp.labs <- get.comparison.grouplabels(dm)[1,] #add the promoter level differential methylation table dm.add <- addDiffMethTable(dm,dmt.promoters,cmp.name,"promoters",grp.labs) get.region.types(dm.add)
Adds phenotypic or processing information to the sample annotation table of the given RnBSet
object.
## S4 method for signature 'RnBSet' addPheno(object, trait, header)
## S4 method for signature 'RnBSet' addPheno(object, trait, header)
object |
|
trait |
Trait as a non-empty |
header |
Trait name given as a one-element |
The modified dataset as an object of type RnBSet
.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) is.hiPSC <- pheno(rnb.set.example)[, "Sample_Group"]=="hiPSC" rnb.set.mod <- addPheno(rnb.set.example, is.hiPSC, "is_hiPSC") pheno(rnb.set.mod)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) is.hiPSC <- pheno(rnb.set.example)[, "Sample_Group"]=="hiPSC" rnb.set.mod <- addPheno(rnb.set.example, is.hiPSC, "is_hiPSC") pheno(rnb.set.mod)
For the region annotation of a given RnBSet
object. Subdivide each region into subsegments by
hierarchical clustering on the site distances in a particular region and then splitting the region into subregions consisting
of these site clusters. The number of clusters is determined in such way that the mean number of sites per cluster
is given by the ns
parameter.
addRegionSubsegments( rnb.set, annotation.dir, region.types = NULL, add.region.types.to.options = FALSE, ns = 10 )
addRegionSubsegments( rnb.set, annotation.dir, region.types = NULL, add.region.types.to.options = FALSE, ns = 10 )
rnb.set |
an |
annotation.dir |
a directory to save the annotation to for later reloading. (binary |
region.types |
the region types to which subsegmentation should be applied. Must be a non-empty
subset of |
add.region.types.to.options |
Flag indicating whether to add the newly created subregions to the package's
|
ns |
the mean number of sites per cluster. |
the modified RnBSet
object
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.set.mod <- addRegionSubsegments(rnb.set.example,tempdir(),region.types=c("tiling","genes")) summary(meth(rnb.set.mod,type="tiling.subsegments"))
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.set.mod <- addRegionSubsegments(rnb.set.example,tempdir(),region.types=c("tiling","genes")) summary(meth(rnb.set.mod,type="tiling.subsegments"))
Genomic annotation of the methylation sites or regions covered in the supplied dataset.
## S4 method for signature 'RnBSet' annotation(object, type = "sites", add.names = FALSE, include.regions = FALSE)
## S4 method for signature 'RnBSet' annotation(object, type = "sites", add.names = FALSE, include.regions = FALSE)
object |
dataset as an object of type inheriting |
type |
loci or regions for which the annotation should be obtained. If the value of this parameter is
|
add.names |
flag specifying whether the unique site identifiers should be used as row names of the resulting data frame |
include.regions |
if |
Annotation table in the form of a data.frame
.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) ## show present sites head(annotation(rnb.set.example, add.names=TRUE)) ## show promoters ann.prom<-annotation(rnb.set.example, type="promoters", add.names=TRUE) head(ann.prom)
library(RnBeads.hg19) data(small.example.object) ## show present sites head(annotation(rnb.set.example, add.names=TRUE)) ## show promoters ann.prom<-annotation(rnb.set.example, type="promoters", add.names=TRUE) head(ann.prom)
This routine applies the iEVORA method created by Teschendorff et.al. to the supplied methylation matrix in a similar way as the diffVar method.
apply.iEVORA(meth.matrix, inds.g1, inds.g2)
apply.iEVORA(meth.matrix, inds.g1, inds.g2)
meth.matrix |
Matrix containing the methylation information used to calculate differentially variable sites between the two groups |
inds.g1 |
Indices in the phenotypic table corresponding to the first group. |
inds.g2 |
Indices in the phenotypic table corresponding to the second group. |
Q-values as the result of applying the iEVORA method and then correct for multiple testing.
Michael Scherer
The "as"
method can be used for the following conversions:
MethyLumiSet
(in package methylumi) to RnBeadRawSet
RnBeadRawSet
to MethyLumiSet
RGChannelSet
(in package minfi) to RnBeadRawSet
Extracts information about assembly
## S4 method for signature 'RnBSet' assembly(object)
## S4 method for signature 'RnBSet' assembly(object)
object |
Dataset of interest. |
Sample annotation information available for the dataset in the form of a data.frame
.
library(RnBeads.hg19) data(small.example.object) assembly(rnb.set.example) # "hg19"
library(RnBeads.hg19) data(small.example.object) assembly(rnb.set.example) # "hg19"
automatically select a rank cutoff for given ranks and p-values current implementation: sort the p-values according to rank. select as rank cutoff the rank for which the worst (i.e. max) p-value in the top list is still smaller than the best (i.e. min) p-value of the group of worst-ranking p-values of equal size as the top-list
auto.select.rank.cut(p, r, alpha = 0.1)
auto.select.rank.cut(p, r, alpha = 0.1)
p |
vector of p-values |
r |
vector of ranks |
alpha |
the percentile to select the top and bottom part of the list |
the maximum rank fulfilling the criterion
Fabian Mueller
This function makes 3 indipendent attempts to fit a 3-state beta mixture model on the provided type I
probes. An attempt is successful if at least 4 probes are assigned to each level. In case all attempts
fail, the return value is NULL
.
BMIQ( beta.v, design.v, doH = TRUE, nfit = 50000, th1.v = c(0.2, 0.75), th2.v = NULL, niter = 5, tol = 0.001 )
BMIQ( beta.v, design.v, doH = TRUE, nfit = 50000, th1.v = c(0.2, 0.75), th2.v = NULL, niter = 5, tol = 0.001 )
beta.v |
|
design.v |
|
doH |
Flag indicating if normalization for hemimethylated type II probes is to be performed. |
nfit |
Number of probes of a given design to use for the fitting. Smaller values will make BMIQ faster at the expense of accuracy. Values between 10000 and 50000 seem to work well. |
th1.v |
Thresholds "type 1" to use for the initialization of the EM algorithm. These values should represent best guesses for calling type I probes hemi-methylated and methylated, and are refined in further steps by the algorithm. |
th2.v |
Thresholds "type 2" to used for the initialization of the EM algorithm. These values should represent
best guesses for calling type II probes hemi-methylated and methylated, and are refined in further
steps by the EM algorithm. If this is |
niter |
Maximum number of EM iterations to be performed. |
tol |
Tolerance threshold for EM algorithm. |
Performs Beta-mixture quantile normalization, adjusting for type II bias in Infinium 450K data.
List with the following elements:
"all"
The normalised beta-profile for the sample.
"class1"
Methylation state assigned to the type I probes.
"class2"
Methylation state assigned to the type II probes.
"av1"
Mean beta values for the nL
classes for type I probes.
"av2"
Mean beta values for the nL
classes for type II probes.
"hf"
Hubble dilation factor.
"th1"
Estimated thresholds used for type I probes.
"th2"
Estimated thresholds used for type II probes.
Andrew Teschendorff and Steve Horvath; with minor modifications by Yassen Assenov
A virtual class for storing specifications of architectures for different compute clusters. It is designed to let other classes inherit from it
For a concrete child class for a sun grid architecture specification see ClusterArchitectureSGE
If you want to implement your own child class be sure to at least implement the following functions:
getSubCmdTokens,ClusterArchitecture-method
.
name
A name or identifier
executables
A NAMED character vector of executables that can be used by the cluster. For instance, the R
executable is important
getSubCmdTokens.optional.args
character vector containing the valid optional arguments to the getSubCmdTokens,ClusterArchitecture-method
function.
getSubCmdTokens,ClusterArchitecture-method
Returns a vector of command line tokens corresponding to submitting a job with the given command to the cluster
getSubCmdStr,ClusterArchitecture-method
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster
setExecutable,ClusterArchitecture,character,character-method
Tells the cluster architecture about an executable that can be submitted as job
getExecutable,ClusterArchitecture,character-method
Gets the location of an executable associated with a name
Fabian Mueller
A child class of ClusterArchitecture
implementing specifications of IBM LSF architectures.
Follow this template if you want to create your own ClusterArchitecture class.
getSubCmdTokens,ClusterArchitectureLSF-method
Returns a vector of command line tokens corresponding to submitting a job with the given command to the cluster
Michael Scherer
A child class of ClusterArchitecture
implementing specifications of Sun Grid Engine (SGE) architectures.
Follow this template if you want to create your own ClusterArchitecture class.
getSubCmdTokens,ClusterArchitectureSGE-method
Returns a vector of command line tokens corresponding to submitting a job with the given command to the cluster
Fabian Mueller
A child class of ClusterArchitecture
implementing specifications of Simple Linux Utility for Resource Management (SLURM) architectures.
Follow this template if you want to create your own ClusterArchitecture class.
getSubCmdTokens,ClusterArchitectureSGE-method
Returns a vector of command line tokens corresponding to submitting a job with the given command to the cluster
Michael Scherer
Convert a RnBeadSet
object to MethyLumiSet
Convert a RnBeadSet
object to a "mock" RnBiseqSet
object
(used in the combine method)
Return a matrix containing the negative absolute values of the information used to rank the sites. Those are currently: the variance difference, the log ratio in variances and the p-value from the statistical test.
cols.to.rank.site(diff.var) cols.to.rank.region(diff.var)
cols.to.rank.site(diff.var) cols.to.rank.region(diff.var)
diff.var |
A differential variability table. |
A matrix with the absolute values of the relevant columns
Michael Scherer
combine differential methylation objects (output from rnb.run.differential
).
To be more precise, the diffmeth
and dm.go.enrich
are merged.
individual objects that are merged are assumed to belong to the same analysis
and vary only in their indexing of region types and comparisons
combine.diffMeth.objs(obj.list)
combine.diffMeth.objs(obj.list)
obj.list |
a list containing outputs from |
Fabian Mueller
Combine two objects inheriting from RnBSet
class
## S4 method for signature 'RnBSet,RnBSet' combine.rnb.sets(x, y, type = "all")
## S4 method for signature 'RnBSet,RnBSet' combine.rnb.sets(x, y, type = "all")
x , y
|
|
type |
|
Combine method supports a merge of any two RnBSet objects that contain data of the same specie.
In case a non-synonymous merge is performed, the class conversion will follow the following hierarchy:
RnBeadSet
< RnBeadRawSet
< RnBiseqSet
.
In case x
and y
are both array data containers (RnBeadSet
or RnBeadRawSet
),
the resulting object will have an annotation that corresponds to the newer array version
(27k
< 450k
< EPIC
< EPICv2
).
The sample sets of x
and y
should be unique. Sample annotation information is merged only for columns
which have identical names in both objects. CpG sites of the new object are a union of those present in both objects.
combined RnBeadSet
, RnBeadRawSet
or
RnBiseqSet
object
library(RnBeads.hg19) data(small.example.object) r1 <- rnb.set.example r1 <- remove.samples(r1,samples(rnb.set.example)[1:5]) i <- which(r1@sites[,2] == 15 | r1@sites[,2] == 21) sites.rem.r1 <- union(sample(1:nrow(meth(rnb.set.example)),500),i) r1 <- remove.sites(r1,sites.rem.r1) r2 <- rnb.set.example r2 <- remove.samples(r2,samples(rnb.set.example)[6:12]) sites.rem.r2 <- sample(1:nrow(meth(rnb.set.example)),800) r2 <- remove.sites(r2,sites.rem.r2) rc <- combine.rnb.sets(r1,r2) #assertion: check the number of sites sites.rem.c <- intersect(sites.rem.r1,sites.rem.r2) (nrow(meth(rnb.set.example))-length(sites.rem.c)) == nrow(meth(rc))
library(RnBeads.hg19) data(small.example.object) r1 <- rnb.set.example r1 <- remove.samples(r1,samples(rnb.set.example)[1:5]) i <- which(r1@sites[,2] == 15 | r1@sites[,2] == 21) sites.rem.r1 <- union(sample(1:nrow(meth(rnb.set.example)),500),i) r1 <- remove.sites(r1,sites.rem.r1) r2 <- rnb.set.example r2 <- remove.samples(r2,samples(rnb.set.example)[6:12]) sites.rem.r2 <- sample(1:nrow(meth(rnb.set.example)),800) r2 <- remove.sites(r2,sites.rem.r2) rc <- combine.rnb.sets(r1,r2) #assertion: check the number of sites sites.rem.c <- intersect(sites.rem.r1,sites.rem.r2) (nrow(meth(rnb.set.example))-length(sites.rem.c)) == nrow(meth(rc))
combine p-values of multiple tests using (a generalization of) Fisher's method. The parameter setting here is taylored to DNA methylation, but can be adapted. Reference: Makambi, K. (2003). Weighted inverse chi-square method for correlated significance tests. Journal of Applied Statistics, 30(2), 225-234.
combineTestPvalsMeth( pvalues, testWeights = NULL, correlated = FALSE, methExpectedTestCorrelation = 0.8 )
combineTestPvalsMeth( pvalues, testWeights = NULL, correlated = FALSE, methExpectedTestCorrelation = 0.8 )
pvalues |
p-values to combine |
testWeights |
weights for the individual tests |
correlated |
are the individual tests correlated |
methExpectedTestCorrelation |
expected correlation. Empirically approximated to the default value of 0.8 for DNA-methylation |
the combined p-value
Fabian Mueller, Christoph Bock
p.vals <- 10^-c(0,1,5) combineTestPvalsMeth(p.vals)
p.vals <- 10^-c(0,1,5) combineTestPvalsMeth(p.vals)
computes a difference table containing multiple difference measures, In the simple version the mean of the difference in means, the mean quotient in means and a combination of p-values on the site level are computed. This is computed for each row of the input table. The extended version contains additional columns
computeDiffTab.default.region(dmtp, regions2sites, includeCovg = FALSE)
computeDiffTab.default.region(dmtp, regions2sites, includeCovg = FALSE)
dmtp |
differential methylation table on the site level (as obtained from |
regions2sites |
a list containing for each region the indices of the corresponding sites in the site differential methylation table |
includeCovg |
flag indicating whether to include coverage information |
a dataframe containing the following variables for a given genomic region:
mean.mean.g1 , mean.mean.g2
|
mean of mean methylation levels for group 1 and 2 across all sites in a region |
mean.mean.diff |
Mean difference in means across all sites in a region |
mean.mean.quot.log2 |
Mean quotient in means across all sites in a region |
comb.p.val |
Combined p-value using a generalization of Fisher's method. See |
comb.p.adj.fdr |
FDR adjusted combined p-value |
num.sites |
number of sites that were considered for a region |
mean.num.na.g1/2 |
mean number (accross all considered sites) of samples that contained an NA for group 1 and 2 respectively |
mean.mean.covg.g1/2 |
Mean value of mean coverage values (across all samples in a group) across all sites in a region |
mean.nsamples.covg.thresh.g1/2 |
mean number (accross all considered sites) of samples that have a coverage larger than the specified threshold
(see |
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] dm.sites <- computeDiffTab.extended.site(meth.mat,sample.groups[[1]],sample.groups[[2]]) map.regions.to.sites <- regionMapping(rnb.set.example,"promoters") dm.promoters <- computeDiffTab.default.region(dm.sites,map.regions.to.sites)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] dm.sites <- computeDiffTab.extended.site(meth.mat,sample.groups[[1]],sample.groups[[2]]) map.regions.to.sites <- regionMapping(rnb.set.example,"promoters") dm.promoters <- computeDiffTab.default.region(dm.sites,map.regions.to.sites)
computes a difference table containing multiple difference measures, In the simple version the difference in means, quotients in means and a p-value for the comparison of two groups in a table are computed. This is computed for each row of the input table. The extended version contains additional columns
computeDiffTab.default.site( X, inds.g1, inds.g2, diff.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), paired = FALSE, adjustment.table = NULL, eps = 0.01, imputed = FALSE ) computeDiffTab.extended.site( X, inds.g1, inds.g2, diff.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), paired = FALSE, adjustment.table = NULL, eps = 0.01, covg = NULL, covg.thres = rnb.getOption("filtering.coverage.threshold"), imputed = FALSE )
computeDiffTab.default.site( X, inds.g1, inds.g2, diff.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), paired = FALSE, adjustment.table = NULL, eps = 0.01, imputed = FALSE ) computeDiffTab.extended.site( X, inds.g1, inds.g2, diff.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), paired = FALSE, adjustment.table = NULL, eps = 0.01, covg = NULL, covg.thres = rnb.getOption("filtering.coverage.threshold"), imputed = FALSE )
X |
Matrix on which the difference measures are calculated for every row |
inds.g1 |
column indices of group 1 members |
inds.g2 |
column indices of group 2 members |
diff.method |
Method to determine p-values for differential methylation. Currently supported are
"ttest" for a two-sided Welch t-test, "refFreeEWAS" for adjusting for cell mixtures,
and "limma" for p-values resulting from linear modeling of the transformed beta values (M-values)
and using techniques from expression microarray analysis employed in the |
variability.method |
Method to determine p-values for differential variability. Currently supported are "diffVar" for the diffVar method implemented in the missMethyl bioconductor package, and "iEVORA". |
paired |
should a paired a analysis be performed. If |
adjustment.table |
a table of variables to be adjusted for in the differential methylation test. Currently this is only supported for
|
eps |
Epsilon for computing quotients (avoid division by 0 by adding this value to denominator and enumerator before calculating the quotient) |
imputed |
flag indicating if methylation matrix was already imputed |
covg |
coverage information (should be NULL for disabled or of equal dimensions as X) |
covg.thres |
a coverage threshold |
a dataframe containing the following variables:
mean.g1 |
Mean of group 1 |
mean.g2 |
Mean of group 2 |
mean.diff |
Difference in means |
mean.quot.log2 |
log2 of the quotient of means |
diffmeth.p.val |
P-value (as determined by |
max.g1/max.g2 |
[extended version only] Group maxima |
min.g1/min.g2 |
[extended version only] Group minima |
sd.g1/sd.g2 |
[extended version only] Group standard deviations |
min.diff |
[extended version only] Minimum of 0 and single linkage difference between the groups |
diffmeth.p.adj.fdr |
[extended version only] FDR adjusted p-values |
num.na.g1/num.na.g2 |
[extended version only] number of NA methylation values for groups 1 and 2 respectively |
mean.covg.g1/mean.covg.g2 |
[extended version with coverage information only] mean coverage of groups 1 and 2 respectively |
min.covg.g1/min.covg.g2 |
[extended version with coverage information only] minimum coverage of groups 1 and 2 respectively |
max.covg.g1/max.covg.g2 |
[extended version with coverage information only] maximum coverage of groups 1 and 2 respectively |
covg.thresh.nsamples.g1/2 |
[extended version with coverage information only] number of samples in group 1 and 2 respectively exceeding the coverage threshold for this site. |
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] dm <- computeDiffTab.extended.site(meth.mat,sample.groups[[1]],sample.groups[[2]]) summary(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] dm <- computeDiffTab.extended.site(meth.mat,sample.groups[[1]],sample.groups[[2]]) summary(dm)
Extract coverage information from an object of RnBSet
class.
## S4 method for signature 'RnBSet' covg(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
## S4 method for signature 'RnBSet' covg(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
object |
Dataset of interest. |
type |
|
row.names |
Flag indicating of row names are to be generated in the result. |
i |
indices of sites/regions to be retrieved. By default ( |
j |
indices of samples to be retrieved. By default ( |
coverage information available for the dataset in the form of a matrix
.
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix cvg<-covg(rnb.set.example, row.names=TRUE) head(cvg)
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix cvg<-covg(rnb.set.example, row.names=TRUE) head(cvg)
Creates a density scatterplot highlighting points in sparsely populated plot regions as well as points marked as special in a seperate color
create.densityScatter( df2p, is.special = NULL, dens.subsample = FALSE, dens.special = TRUE, sparse.points = 0.01, dens.n = 100, add.text.cor = FALSE )
create.densityScatter( df2p, is.special = NULL, dens.subsample = FALSE, dens.special = TRUE, sparse.points = 0.01, dens.n = 100, add.text.cor = FALSE )
df2p |
|
is.special |
boolean vector of length equal to the number of rows in |
dens.subsample |
if the number of points exceeds this number, subsample the number of points for the density estimation to that number. Any non-numeric value disables subsampling. |
dens.special |
Flag indicating whether the points of the special population should be colored according to their density |
sparse.points |
Either percentage ( |
dens.n |
passed on to |
add.text.cor |
flag indicating whether a text token with the correlation coefficient should be included in the lower right corner of the plot |
ggplot
object
Fabian Mueller
d <- data.frame(x=rnorm(1000),y=rnorm(1000)) s <- rep(FALSE,1000) s[sample(1:length(s),100)] <- TRUE create.densityScatter(d,s)
d <- data.frame(x=rnorm(1000),y=rnorm(1000)) s <- rep(FALSE,1000) s[sample(1:length(s),100)] <- TRUE create.densityScatter(d,s)
Creates a summary plot binning the data given by a certain quantity in heagonal bins
create.hex.summary.plot( df2p, x = colnames(df2p)[1], y = colnames(df2p)[2], q = colnames(df2p)[3], bins = 128, fun = median, ... )
create.hex.summary.plot( df2p, x = colnames(df2p)[1], y = colnames(df2p)[2], q = colnames(df2p)[3], bins = 128, fun = median, ... )
df2p |
|
x |
name of the variable in |
y |
name of the variable in |
q |
name of the variable in |
bins , fun , ...
|
arguments to be passed on to |
ggplot
object
Fabian Mueller
Creates a scatterplot containing all points in a given data.frame. Points are colored according to point density. Optionally, a selection of points are shown in a different color
create.scatter.dens.points( df2p, is.special = NULL, dens.special = TRUE, mock = FALSE )
create.scatter.dens.points( df2p, is.special = NULL, dens.special = TRUE, mock = FALSE )
df2p |
|
is.special |
boolean vector of length equal to the number of rows in |
dens.special |
Flag indicating whether the points of the special population should be colored according to their density |
mock |
Should only the axis be plotted? useful when exporting scatterplots with lots of points as immage and the corresponding axis as vector graphics. |
ggplot
object
Fabian Mueller
d <- data.frame(x=rnorm(1000),y=rnorm(1000)) s <- rep(FALSE,1000) s[sample(1:length(s),100)] <- TRUE create.scatter.dens.points(d,s)
d <- data.frame(x=rnorm(1000),y=rnorm(1000)) s <- rep(FALSE,1000) s[sample(1:length(s),100)] <- TRUE create.scatter.dens.points(d,s)
Creates a new report object.
createReport( fname, title, page.title = "RnBeads report", authors = NULL, dirs = NULL, init.configuration = FALSE )
createReport( fname, title, page.title = "RnBeads report", authors = NULL, dirs = NULL, init.configuration = FALSE )
fname |
Single-element |
title |
Title of the report in the form of a single-element |
page.title |
Web page title. This usually appears in the web browser's window title when the report is open. If specified, this must be a vector. Note that only the first element is used. |
authors |
Optional list of authors in the form of a |
dirs |
Location of the supporting directories, that is, paths that are expected to contain additional files linked to from the HTML report. See the Details section for a list of these directories. |
init.configuration |
Flag indicating if the report configuration data should be initialized. If this parameter
is |
If specified, the parameter dirs
must be a character
vector. The following names are read:
"configuration"
Directory that contains the auxilliary configuration files, such as style sheets and
Javascript files. If missing or NA
, the default value used is "configuration"
.
"data"
Directory to contain the tables, lists and other generated data files that are linked to in
the HTML report. If missing or NA
, the value used is formed from the file name fname
(without
the extension) and the suffix "_data"
.
"pngs"
Directory to contain the low resolution PNG images shown in the HTML report. If missing or
NA
, the value used is formed from the file name fname
(without the extension) and the suffix
"_images"
.
"pdfs"
Directory to contain the PDF images (if such are created). If not missing or NA
, the
value used is formed from the file name fname
(without the extension) and the suffix "_pdf"
.
"high"
Directory to contain the high resolution PNG images (if such are created). If missing or
NA
, the value used is the same as the pngs
directory.
Any other elements, if present, are ignored. Note that these directories are not required to point to different
locations. In particular, if the directories for low and for high resolution images are identical, the
high-resolution image files are assumed to be the ones with suffix "_high_resolution.png"
. See
createReportPlot
for creating image files.
In order to ensure independence of the operating system, there are strong restrictions on the names of the file and
directories. The name of the report's HTML file can consist of the following symbols only: Latin letters, digits, dot
(.
), dash (-
) and underline (_
). The extension of the report's HTML file must be one of
htm
, html
, xhtml
or xml
. The supporting directories must be given as relative paths;
the restrictions on the path names are identical to the ones for file name. Forward slash (/
) is to be used as
path separator. Path names cannot start or end with a slash. None of the directory names can be
an empty string, use "."
instead. A value in the form "mypath/.html"
for fname
is invalid.
Upon initialization, the report attempts to create or overwrite the specified fname
. If the path to it does
not exist, or if the current process does not have permissions to write to the file, report initialization will fail.
The report object visits each supporting directory (except configuration
) and attempts to create it, unless it
is an existing empty directory. Report initialization will fail if any of the visited directories does not meet the
criteria and could not be created. Hidden files (file names starting with "."
on Unix platforms) are ignored.
Thus, all supporting directories that already exist and contain hidden files only are considered valid.
Newly created Report
object.
Yassen Assenov
Report
for functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE)
report <- createReport("example.html", "Example", init.configuration = TRUE)
creates a report plot containing a ggplot object
. Except for the ggp
parameter, the signature and
behavior is identical to createReportPlot
.
createReportGgPlot( ggp, fname, report = NULL, width = 7, height = 7, create.pdf = TRUE, low.png = as.integer(100), high.png = as.integer(0) )
createReportGgPlot( ggp, fname, report = NULL, width = 7, height = 7, create.pdf = TRUE, low.png = as.integer(100), high.png = as.integer(0) )
ggp |
|
fname |
|
report |
Report (object of type |
width |
|
height |
|
create.pdf |
Flag indicating if a PDF image is to be created. The length of this vector must be |
low.png |
Resolution, in dots per inch, used for the figure image. Set this to |
high.png |
Resolution, in dots per inch, used for a dedicated image. Set this to |
Newly created ReportGgPlot
object.
Fabian Mueller
Initializes a report plot and opens a device to create it. The type of the device created depends on the
parameters create.pdf
, low.png
and high.png
. If create.pdf
is TRUE
, a PDF device
is opened and its contents are later copied to PNG device(s) if needed. Otherwise, a PNG device is opened. Note that
at least one of the following conditions must be met:
create.pdf == TRUE
low.png > 0
high.png > 0
createReportPlot( fname, report = NULL, width = 7, height = 7, create.pdf = TRUE, low.png = 100L, high.png = 0L )
createReportPlot( fname, report = NULL, width = 7, height = 7, create.pdf = TRUE, low.png = 100L, high.png = 0L )
fname |
|
report |
Report (object of type |
width |
|
height |
|
create.pdf |
Flag indicating if a PDF image is to be created. The length of this vector must be |
low.png |
Resolution, in dots per inch, used for the figure image. Set this to |
high.png |
Resolution, in dots per inch, used for a dedicated image. Set this to |
In order to ensure independence of the operating system, there are strong restrictions on the name of the file. It
can consist of the following symbols only: Latin letters, digits, dot (.
), dash (-
) and underline
(_
). The name must not include paths, that is, slash (/
) or backslash (\
) cannot be used.
Newly created ReportPlot
object.
Yassen Assenov
pdf
for manually initializing a graphics device; Report
for other
functions adding contents to an HTML report
plot.image <- createReportPlot('scatterplot_tumors') plot(x = c(0.4, 1), y = c(9, 3), type = 'p', main = NA, xlab = expression(beta), ylab = 'Measure') off(plot.image)
plot.image <- createReportPlot('scatterplot_tumors') plot(x = c(0.4, 1), y = c(9, 3), type = 'p', main = NA, xlab = expression(beta), ylab = 'Measure') off(plot.image)
Converts a data.frame
that defines genomic regions to object of type GRanges
.
data.frame2GRanges( dframe, ids = rownames(dframe), chrom.column = "Chromosome", start.column = "Start", end.column = "End", strand.column = NULL, assembly = "hg19", sort.result = TRUE )
data.frame2GRanges( dframe, ids = rownames(dframe), chrom.column = "Chromosome", start.column = "Start", end.column = "End", strand.column = NULL, assembly = "hg19", sort.result = TRUE )
dframe |
Table defining genomic regions. |
ids |
Region names (identifiers) as a |
chrom.column |
Column name or index that lists the chromosome names. |
start.column |
Column name or index that lists the start positions of the regions. |
end.column |
Column name or index that lists the end positions of the regions. |
strand.column |
Column name or index that lists the strands on which the regions are located. Set this to
|
assembly |
Genome assembly of interest. See |
sort.result |
Should the resulting table be sorted |
GRanges
object encapsulating all well defined regions on supported chromosomes, contained in
dframe
. Columns other that the ones listed as parameters in this function are included as metadata.
Yassen Assenov
Rank the points accordind to density of the region they fall in. Densities are computed
as Kernel Density estimates. The method and parameters are implemented in analogy to
grDevices::densCols
densRanks(x, y = NULL, nbin = 128, bandwidth)
densRanks(x, y = NULL, nbin = 128, bandwidth)
x |
x-coordinate |
y |
y-coordinate |
nbin |
number of bins |
bandwidth |
bandwidth |
Fabian Mueller
remove tables stored to disk from the file system. Useful for cleaning up disk dumped objects. CAUTION: currently only works with reloaded objects
## S4 method for signature 'RnBDiffMeth' destroy(object)
## S4 method for signature 'RnBDiffMeth' destroy(object)
object |
|
Nothing of particular interest
Fabian Mueller
Remove tables stored to disk from the file system. Useful for cleaning up disk dumped objects.
## S4 method for signature 'RnBSet' destroy(object) ## S4 method for signature 'RnBeadSet' destroy(object) ## S4 method for signature 'RnBeadRawSet' destroy(object)
## S4 method for signature 'RnBSet' destroy(object) ## S4 method for signature 'RnBeadSet' destroy(object) ## S4 method for signature 'RnBeadRawSet' destroy(object)
object |
object inheriting from |
Nothing of particular interest
Creates a deviation plot based on the methylation beta values of a population.
deviation.plot.beta(betas, c.values = NULL, c.legend = NULL)
deviation.plot.beta(betas, c.values = NULL, c.legend = NULL)
betas |
Non-empty numeric |
c.values |
Vector (usually a |
c.legend |
If |
Methylation variability as a number between 0
and 1
, invisibly. This number denotes the relative
area of variation in the generated plot.
Yassen Assenov
This routine applies the diffVar method from the missMethyl
package that determines sites exhibiting
differential variability between two sample groups
diffVar(meth.matrix, inds.g1, inds.g2, adjustment.table = NULL, paired = FALSE)
diffVar(meth.matrix, inds.g1, inds.g2, adjustment.table = NULL, paired = FALSE)
meth.matrix |
Matrix containing the methylation information used to calculate differentially variable sites between the two groups |
inds.g1 |
Indices in the phenotypic table corresponding to the first group. |
inds.g2 |
Indices in the phenotypic table corresponding to the second group. |
adjustment.table |
A |
paired |
Should the analysis be performed in a paired fashion. If yes, the first index in |
P-values as the result of the diffVar method not adjusted for multiple hypothesis testing.
Michael Scherer
Phipson, Belinda, Oshlack, Alicia (2014) DiffVar: a new method for detecting differential variability with application to methylation in cancer and aging Genome Biology 15(9):465.
Dimensions of BigFfMat
## S4 method for signature 'BigFfMat' dim(x)
## S4 method for signature 'BigFfMat' dim(x)
x |
BigFfMat object |
Downloading prepared LOLA DBs from server
downloadLolaDbs(dest, dbs = c("LOLACore"))
downloadLolaDbs(dest, dbs = c("LOLACore"))
dest |
destination directory |
dbs |
vector of names of LOLA DBs to be downloaded. Currently 'LOLACore' and 'LOLAExt' are supported |
Requires a stable internet connection. Could take a while depending on the size of the database and the internet connection
a list containing vectors of directory names for each available genome assembly
Fabian Mueller
lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore")
lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore")
Extract detection p-values from an object of RnBeadSet
class.
## S4 method for signature 'RnBeadSet' dpval(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
## S4 method for signature 'RnBeadSet' dpval(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
object |
|
type |
|
row.names |
Flag indicating of row names are to be generated in the result. |
i |
Indices of sites/regions to be retrieved. By default ( |
j |
Indices of samples to be retrieved. By default ( |
detection p-values available for the dataset in the form of a matrix
.
library(RnBeads.hg19) data(small.example.object) dp<-dpval(rnb.set.example, row.names=TRUE) head(dp)
library(RnBeads.hg19) data(small.example.object) dp<-dpval(rnb.set.example, row.names=TRUE) head(dp)
Estimates cell type proportions using the constrained projection method from Houseman et al. [1]
estimateProportionsCP( rnb.set, cell.type.column, n.most.variable = NA, n.markers = 500L, constrained = TRUE, full.output = FALSE )
estimateProportionsCP( rnb.set, cell.type.column, n.most.variable = NA, n.markers = 500L, constrained = TRUE, full.output = FALSE )
rnb.set |
RnBSet object |
cell.type.column |
integer index or character identifier of a column in the RnBSet object sample annotation table which gives the mapping to reference cell type samples |
n.most.variable |
Singleton integer specifying how many top variable CpGs should be used for marker selection.
If this option is set to |
n.markers |
singleton integer specifying how many CpGs should be used as markers for fitting the projection model |
constrained |
if |
full.output |
if |
This is a minimally customized implementation of the method by Houseman et al. [1] based on the orginial code kindly provided by
Andres Houseman. Note that RnBeads does not provide any reference data sets, and the methylomes of purified cell types should be provided
by the user as a part of the object supplied via rnb.set
. The column specified by cell.type.column
should
give assignment of each reference methylome replicate to a cell type and missing values for all the target samples.
First the marker selection model is fit to estimate association of each CpG with the given reference cell types (first expression in eq. (1) of [1]).
The strength of association is expressed as an F-statistic.
Since fitting the marker selection model to all CpGs can take a lot of time, one can limit the marker search only to variable CpG positions
by setting n.most.variable
to non-NA
positive integer. The CpGs will be ranked using across-sample variance in the
reference data set and n.most.variable
will be taken to fit the marker selection model.
Coefficients of the fit, together with the F-statistic value for each CpG, are returned in case full.output
is TRUE
.
Thereafter, n.markers
are selected as true quantitative markers and the projection model (eq. [2]) is fit to estimate contributions of each cell type.
Depending on the value of constrained
the returned coefficients can be either raw or enforced to attain values between 0 and 1 with within-sample sum
less or equal to 1.
a matrix of estimated cell type contributions (samples times cell types) or a list with results of the intermetidate steps (see details).
Requires the package nlme.
Pavlo Lutsik
1. Houseman, Eugene and Accomando, William and Koestler, Devin and Christensen, Brock and Marsit, Carmen and Nelson, Heather and Wiencke, John and Kelsey, Karl. DNA methylation arrays as surrogate measures of cell mixture distribution. BMC Bioinformatics 2012, 13:86
export differentially methylated regions to region file (standard bed). The output is in BED6 format where the score corresponds to to the combined rank (rank==1 would receive a score of 1000 and a combined rank equal to the number of regions a score of 0)
exportDMRs2regionFile( rnbSet, diffmeth, dest, comp.name, region.type, rank.cut = NULL, rerank = FALSE )
exportDMRs2regionFile( rnbSet, diffmeth, dest, comp.name, region.type, rank.cut = NULL, rerank = FALSE )
rnbSet |
the RnBSet object for which the DMRs were computed. |
diffmeth |
DiffMeth object. See |
dest |
destination file name |
comp.name |
name of the comparison |
region.type |
region type. |
rank.cut |
rank cutoff. If |
rerank |
flag indicating whether the ranks should be reranked or whether |
NULL
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) exportDMRs2regionFile(rnb.set.example,dm,tempfile(),get.comparisons(dm)[1],"promoters")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) exportDMRs2regionFile(rnb.set.example,dm,tempfile(),get.comparisons(dm)[1],"promoters")
Given indices for two groups of samples for comparison, this function
retrieves data.frame
containing the variables to be adjusted for
get.adjustment.variables( rnbSet, inds.g1, inds.g2 = -inds.g1, colnames.adj = c(), colname.target = "", adjust.sva = FALSE, adjust.celltype = FALSE )
get.adjustment.variables( rnbSet, inds.g1, inds.g2 = -inds.g1, colnames.adj = c(), colname.target = "", adjust.sva = FALSE, adjust.celltype = FALSE )
rnbSet |
RnBSet object |
inds.g1 |
sample indices in |
inds.g2 |
sample indices in |
colnames.adj |
column names in |
colname.target |
column names in |
adjust.sva |
flag indicating whether the resulting table should also contain surrogate variables (SVs) for the given target variable. |
adjust.celltype |
flag indicating whether the resulting table should also contain estimated celltype contributions.
See |
a data.frame
containing one column for each selected variable from the phenotypic data
each row corresponds to a sample in the union of samples of the wto groups with the first
length(inds.g1)
rows corresponding to group 1 and the remaining rows corresponding to group 2
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] get.adjustment.variables(rnb.set.example,sample.groups[[1]],sample.groups[[2]],"Cell_Line")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] get.adjustment.variables(rnb.set.example,sample.groups[[1]],sample.groups[[2]],"Cell_Line")
Gets all comparison grouplabels represented in the object as character matrix of dimension n.comparisons x 2 where the columns specify group names 1 and 2 respectively
## S4 method for signature 'RnBDiffMeth' get.comparison.grouplabels(object)
## S4 method for signature 'RnBDiffMeth' get.comparison.grouplabels(object)
object |
|
character matrix containing comparison group names
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparison.grouplabels(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparison.grouplabels(dm)
Gets all comparison group sizes represented in the object as character matrix of dimension n.comparisons x 2 where the columns specify sizes of groups 1 and 2 respectively
## S4 method for signature 'RnBDiffMeth' get.comparison.groupsizes(object)
## S4 method for signature 'RnBDiffMeth' get.comparison.groupsizes(object)
object |
|
character matrix containing comparison group sizes
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparison.groupsizes(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparison.groupsizes(dm)
retrieve the comparison information for an RnBSet object
get.comparison.info( x, pheno.cols = rnb.getOption("differential.comparison.columns"), region.types = rnb.region.types.for.analysis(x), pheno.cols.all.pairwise = rnb.getOption("differential.comparison.columns.all.pairwise"), columns.pairs = rnb.getOption("columns.pairing"), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.sva = rnb.getOption("differential.adjustment.sva"), pheno.cols.adjust.sva = rnb.getOption("inference.targets.sva"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), adjust.na.rm = TRUE )
get.comparison.info( x, pheno.cols = rnb.getOption("differential.comparison.columns"), region.types = rnb.region.types.for.analysis(x), pheno.cols.all.pairwise = rnb.getOption("differential.comparison.columns.all.pairwise"), columns.pairs = rnb.getOption("columns.pairing"), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.sva = rnb.getOption("differential.adjustment.sva"), pheno.cols.adjust.sva = rnb.getOption("inference.targets.sva"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), adjust.na.rm = TRUE )
x |
|
pheno.cols |
column names of the pheno slot in |
region.types |
which region types should be processed for differential methylation |
pheno.cols.all.pairwise |
integer or character vector specifying the colomns of |
columns.pairs |
argument passed on to |
columns.adj |
Column names or indices in the table of phenotypic information to be used for confounder adjustment in the differential methylation analysis. |
adjust.sva |
flag indicating whether the adjustment table should also contain surrogate variables (SVs) for the given target variable. |
pheno.cols.adjust.sva |
Target variables for SVA adjustment. Only important if |
adjust.celltype |
flag indicating whether the resulting table should also contain estimated celltype contributions.
See |
adjust.na.rm |
Flag indicating whether NAs in the adjustment table should be removed. |
a list containing one element for each comparison to be conducted. Each element is again a list containing:
comparison
the name of the comparison
pheno.colname
the column name of the sample annotation table the comparison is derived from
group.names
the names of the two groups being compared
group.inds
the sample indices of the samples belonging to the two groups
paired
flag indicating whether paired analysis is conducted
adj.sva
flag indicating whether adjustment for SVA is conducted
adj.celltype
flag indicating whether adjustment for cell type is conducted
adjustment.table
the covariate adjustment table. NULL
if the comparison is not adjusted
region.types
the region types applicable to the analysis
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) cmp.info <- get.comparison.info(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) cmp.info[[1]]
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) cmp.info <- get.comparison.info(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) cmp.info[[1]]
Gets all comparisons represented in the object as character vector
## S4 method for signature 'RnBDiffMeth' get.comparisons(object)
## S4 method for signature 'RnBDiffMeth' get.comparisons(object)
object |
|
character vector containing comparisons
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparisons(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparisons(dm)
Retrieves an NxK matrix of cell type contributions stored in an RnBSet for a given target variable
get.covariates.ct(rnb.set)
get.covariates.ct(rnb.set)
rnb.set |
|
an NxK matrix of K cell types contributions for N samples of the rnb.set
. NULL
if the components have not been computed or added to rnb.set
.
Retrieves an NxK table of Surrogate variables stored in an RnBSet for a given target variable
get.covariates.sva(rnb.set, target)
get.covariates.sva(rnb.set, target)
rnb.set |
|
target |
target variable. Must be in |
an NxK table of K Surrogate variables stored for N samples of the rnb.set
. NULL
if the components have not been computed or added to rnb.set
.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) get.covariates.sva(rnb.set.mod,"Sample_Group")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) get.covariates.sva(rnb.set.mod,"Sample_Group")
Gets the coverage threshold employed for obtaining statistics in the differential methylation tables
## S4 method for signature 'RnBDiffMeth' get.covg.thres(object)
## S4 method for signature 'RnBDiffMeth' get.covg.thres(object)
object |
RnBDiffMeth object |
integer coverage threshold
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.covg.thres(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.covg.thres(dm)
Computes CpG-related statistics for the specified regions.
get.cpg.stats(chrom.sequence, starts, ends)
get.cpg.stats(chrom.sequence, starts, ends)
chrom.sequence |
Chromosome sequence, usually obtained from the assembly's genome definition. This must be an
object of type |
starts |
|
ends |
|
Table of statistics for the regions in the form of a matrix
with the following columns:
"CpG"
and "GC"
. The columns contain the number of CpG dinucleoties and the number of C and G
bases in each region.
Yassen Assenov
Gets the list of all files that are planned to be generated, or were already generated by the given report plot.
get.files(report.plot)
get.files(report.plot)
report.plot |
Report plot of interest. This must be an object of type |
Non-empty character
vector of absolute file names.
Yassen Assenov
plot.image <- createReportPlot('scatterplot', high.png = 200) get.files(plot.image)
plot.image <- createReportPlot('scatterplot', high.png = 200) get.files(plot.image)
Gets all region types represented in the object as character vector
## S4 method for signature 'RnBDiffMeth' get.region.types(object)
## S4 method for signature 'RnBDiffMeth' get.region.types(object)
object |
|
character vector containing region types
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.region.types(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.region.types(dm)
Gets the site testing method used to obtain the p-values in the differential methylation tables
## S4 method for signature 'RnBDiffMeth' get.site.test.method(object)
## S4 method for signature 'RnBDiffMeth' get.site.test.method(object)
object |
RnBDiffMeth object |
character describing the site test method
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.site.test.method(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.site.test.method(dm)
Gets a differential methylation table
## S4 method for signature 'RnBDiffMeth' get.table( object, comparison, region.type, undump = TRUE, return.data.frame = FALSE )
## S4 method for signature 'RnBDiffMeth' get.table( object, comparison, region.type, undump = TRUE, return.data.frame = FALSE )
object |
|
comparison |
character or index of the comparison of the table to retrieve |
region.type |
character or index of the region type of the table to retrieve |
undump |
Flag indicating whether to convert the table into a matrix instead of using the file descriptor.
Only meaningful if the if the objects's |
return.data.frame |
should a data.frame be returned instead of a matrix? |
differential methylation table. See computeDiffMeth.bin.site
and computeDiffMeth.bin.region
for details.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) dm.promoters <- get.table(dm,get.comparisons(dm)[1],"promoters",return.data.frame=TRUE) summary(dm.promoters)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) dm.promoters <- get.table(dm,get.comparisons(dm)[1],"promoters",return.data.frame=TRUE) summary(dm.promoters)
Returns the colum names of the differential variability table.
get.table.ids(includeCovg = FALSE)
get.table.ids(includeCovg = FALSE)
includeCovg |
Flag indicating if dataset contains coverage information |
Column names of the differential variability table
Gets the variability testing method used to obtain the p-values in the differential varibiality tables
## S4 method for signature 'RnBDiffMeth' get.variability.method(object)
## S4 method for signature 'RnBDiffMeth' get.variability.method(object)
object |
RnBDiffMeth object |
character describing the variability method
Michael Scherer
retrieve or guess cell types from a LOLA DB object
getCellTypesFromLolaDb(lolaDb)
getCellTypesFromLolaDb(lolaDb)
lolaDb |
LOLA DB object as returned by |
character vector with cell types
Fabian Mueller
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getCellTypesFromLolaDb(lolaDb)
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getCellTypesFromLolaDb(lolaDb)
Retrieves the executable associated with a name/identifier
## S4 method for signature 'ClusterArchitecture,character' getExecutable(object, exec.name)
## S4 method for signature 'ClusterArchitecture,character' getExecutable(object, exec.name)
object |
|
exec.name |
The executable's name/identifier |
The executable. If the name is not associated with any executable, the names will be returned and a warning will be raised
Fabian Mueller
Retrieves the number of cores used by each module
## S4 method for signature 'RnBClusterRun' getModuleNumCores(object)
## S4 method for signature 'RnBClusterRun' getModuleNumCores(object)
object |
|
A named vector containing the number of cores for each module
Fabian Mueller
get human readable names from a LOLA DB object
getNamesFromLolaDb(lolaDb, addCollectionNames = FALSE, addDbId = TRUE)
getNamesFromLolaDb(lolaDb, addCollectionNames = FALSE, addDbId = TRUE)
lolaDb |
LOLA DB object as returned by |
addCollectionNames |
attach the name of the collection to the name |
addDbId |
attach the index of the item in the LOLA DB object to the name |
character vector with human readable names
Fabian Mueller
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getNamesFromLolaDb(lolaDb)
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getNamesFromLolaDb(lolaDb)
for each site/region, the getNumNaMeth retrieves the number of NA values accross all samples. Does this efficiently by breaking down the methylation matrix into submatrices
## S4 method for signature 'RnBSet' getNumNaMeth(object, type = "sites", chunkSize = 1e+05, mask = NULL)
## S4 method for signature 'RnBSet' getNumNaMeth(object, type = "sites", chunkSize = 1e+05, mask = NULL)
object |
object inheriting from |
type |
"sites" or region type |
chunkSize |
size of each submatrix (performance tuning parameter) |
mask |
logical matrix. its entries will also be considered NAs in counting |
vector containing the number of NAs per site/region
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster.
## S4 method for signature 'ClusterArchitecture' getSubCmdStr(object, ...)
## S4 method for signature 'ClusterArchitecture' getSubCmdStr(object, ...)
object |
|
... |
arguments passed on to |
A string containing the submission command
Fabian Mueller
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster.
## S4 method for signature 'ClusterArchitecture' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0) )
## S4 method for signature 'ClusterArchitecture' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0) )
object |
|
cmd.tokens |
a character vector specifying the executable command that should be wrapped in the cluster submission command |
log |
file name and path of the log file that the submitted job writes to |
job.name |
name of the submitted job |
res.req |
character vector specifying required resources. The resource requirements should be the values of the vector, the names should specify the resource name |
depend.jobs |
character vector containg names or ids of jobs the submitted job will depend on. |
For a concrete child class implementation for a sun grid architecture specification see getSubCmdTokens,ClusterArchitectureSGE-method
A character vector containing the submission command tokens
Fabian Mueller
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster.
## S4 method for signature 'ClusterArchitectureLSF' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0) )
## S4 method for signature 'ClusterArchitectureLSF' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0) )
object |
|
cmd.tokens |
a character vector specifying the executable command that should be wrapped in the cluster submission command |
log |
file name and path of the log file that the submitted job writes to |
job.name |
name of the submitted job |
res.req |
named vector of requested resources. Two options are available: |
depend.jobs |
character vector containg names or ids of jobs the submitted job will depend on. |
For a concrete child class implementation for a LSF architecture specification see ClusterArchitectureLSF
A character vector containing the submission command tokens
Michael Scherer
arch <- new("ClusterArchitectureLSF", name="my_lsf_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
arch <- new("ClusterArchitectureLSF", name="my_lsf_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster.
## S4 method for signature 'ClusterArchitectureSGE' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0), sub.binary = TRUE, quote.cmd = TRUE, queue = NULL )
## S4 method for signature 'ClusterArchitectureSGE' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0), sub.binary = TRUE, quote.cmd = TRUE, queue = NULL )
object |
|
cmd.tokens |
a character vector specifying the executable command that should be wrapped in the cluster submission command |
log |
file name and path of the log file that the submitted job writes to |
job.name |
name of the submitted job |
res.req |
character vector specifying required resources. The resource requirements should be the values of the vector, the names should specify the resource name |
depend.jobs |
character vector containg names or ids of jobs the submitted job will depend on. |
sub.binary |
treat the command as binary (see |
quote.cmd |
Flag indicating whether the submitted cammed should also be wrapped in quotes |
queue |
The name of the queue to submit jobs to |
For a concrete child class implementation for a sun grid architecture specification see ClusterArchitectureSGE
A character vector containing the submission command tokens
Fabian Mueller
arch <- new("ClusterArchitectureSGE", name="my_sge_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
arch <- new("ClusterArchitectureSGE", name="my_sge_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
Returns a string for the of command line corresponding to submitting a job with the given command to the cluster.
## S4 method for signature 'ClusterArchitectureSLURM' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0), sub.binary = TRUE, quote.cmd = TRUE )
## S4 method for signature 'ClusterArchitectureSLURM' getSubCmdTokens( object, cmd.tokens, log, job.name = "", res.req = character(0), depend.jobs = character(0), sub.binary = TRUE, quote.cmd = TRUE )
object |
|
cmd.tokens |
a character vector specifying the executable command that should be wrapped in the cluster submission command |
log |
file name and path of the log file that the submitted job writes to |
job.name |
name of the submitted job |
res.req |
named vector of requested resources. Two options are available: |
depend.jobs |
character vector containg names or ids of jobs the submitted job will depend on. |
sub.binary |
flag indicating if the command is to be submitted using the |
quote.cmd |
Flag indicating whether the submitted cammed should also be wrapped in quotes |
For a concrete child class implementation for a SLURM architecture specification see ClusterArchitectureSLURM
A character vector containing the submission command tokens
Michael Scherer
arch <- new("ClusterArchitectureSLURM", name="my_slurm_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
arch <- new("ClusterArchitectureSLURM", name="my_slurm_architecture" ) getSubCmdTokens(arch,c("Rscript","my_great_script.R"),"my_logfile.log")
retrieve or guess the target from a LOLA DB object. Here, target typically refers to antibodies for ChIP-seq experiments, but could also refer to other annotations (e.g. motifs in TF motif databases, annotation according to UCSC features etc.)
getTargetFromLolaDb(lolaDb)
getTargetFromLolaDb(lolaDb)
lolaDb |
LOLA DB object as returned by |
character vector with targets
Fabian Mueller
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getTargetFromLolaDb(lolaDb)
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]]) getTargetFromLolaDb(lolaDb)
Performs all iterations of the Greedycut algorithm for removing rows and columns from the given matrix.
greedycut.filter.matrix(mm, rows2ignore = integer(), rc.ties = "row")
greedycut.filter.matrix(mm, rows2ignore = integer(), rc.ties = "row")
mm |
Numeric matrix to filter. |
rows2ignore |
|
rc.ties |
Flag indicating what the behaviour of the algorithm should be in case of ties between values of
rows and columns. The value of this parameter must be one of |
Table summarizing the iterations of the algorithm in the form of a data.frame
with the following
columns : Index, Type, Score, Normalized score, Rows, Columns.
Yassen Assenov
greedycut.get.submatrix
for extracting the resulting matrix after filtering
Calculates various statistics on the iterations of Greedycut.
greedycut.get.statistics(filterinfo)
greedycut.get.statistics(filterinfo)
filterinfo |
Information on the filtering iterations as a |
Additional statistics on the iterations in the form of a data.frame
with the following columns:
"Elements retained"
, "Elements removed"
, "Mismatches retained"
,
"Mismatches removed"
, "False Positive Rate"
, "Sensitivity"
, "D"
. The last column
signifies distance from the diagonal in a ROC curve.
Yassen Assenov
Filters a data matrix executing the given number of iterations of Greedycut.
greedycut.get.submatrix( mm, filter.info, it.num = nrow(filter.info) - as.integer(1) )
greedycut.get.submatrix( mm, filter.info, it.num = nrow(filter.info) - as.integer(1) )
mm |
Data |
filter.info |
Information on the filtering iterations as a |
it.num |
Number of iterations to execute. Defaults to all iterations. |
Data matrix containing subsets of the rows and columns of mm
.
Yassen Assenov
Checks whether the given RnBSet
object contains cell type contribution estimates
has.covariates.ct(rnb.set)
has.covariates.ct(rnb.set)
rnb.set |
|
TRUE
if the supplied object contains the cell type covariates information and FALSE
otherwise
Returns whether Surrogate Variables have been computed and added to the rnb.set
for a given target variable
has.covariates.sva(rnb.set, target)
has.covariates.sva(rnb.set, target)
rnb.set |
|
target |
target variable. Must be in |
logical(1)
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group") has.covariates.sva(rnb.set.mod,"Treatment")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group") has.covariates.sva(rnb.set.mod,"Treatment")
Returns TRUE
if the RnBSet
object contains coverage information for sites or the specified region type.
## S4 method for signature 'RnBSet' hasCovg(object, type = "sites")
## S4 method for signature 'RnBSet' hasCovg(object, type = "sites")
object |
|
type |
|
TRUE
if the RnBSet
object contains coverage information for sites or the specified region type. FALSE
otherwise
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix hasCovg(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix hasCovg(rnb.set.example)
Returns TRUE
if the differential methylation object contains site-level information
## S4 method for signature 'RnBDiffMeth' includes.sites(object)
## S4 method for signature 'RnBDiffMeth' includes.sites(object)
object |
RnBDiffMeth object |
TRUE
if the differential methylation object contains site-level information. FALSE
otherwise
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) includes.sites(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) includes.sites(dm)
Initialize an ClusterArchitecture object
## S4 method for signature 'ClusterArchitecture' initialize(.Object, name = "ClusterArchitecture")
## S4 method for signature 'ClusterArchitecture' initialize(.Object, name = "ClusterArchitecture")
.Object |
New instance of |
name |
A name or identifier |
Fabian Mueller
Initialize an ClusterArchitecture object for a LSF
## S4 method for signature 'ClusterArchitectureLSF' initialize(.Object, name = "ClusterArchitectureLSF", ...)
## S4 method for signature 'ClusterArchitectureLSF' initialize(.Object, name = "ClusterArchitectureLSF", ...)
.Object |
New instance of |
name |
A name or identifier |
... |
arguments passed on to the constructor of |
Michael Scherer
Initialize an ClusterArchitecture object for a Sun Grid Engine (SGE)
## S4 method for signature 'ClusterArchitectureSGE' initialize(.Object, name = "ClusterArchitectureSGE", ...)
## S4 method for signature 'ClusterArchitectureSGE' initialize(.Object, name = "ClusterArchitectureSGE", ...)
.Object |
New instance of |
name |
A name or identifier |
... |
arguments passed on to the constructor of |
Fabian Mueller
Initialize an ClusterArchitecture object for a SLURM
## S4 method for signature 'ClusterArchitectureSLURM' initialize(.Object, name = "ClusterArchitectureSLURM", ...)
## S4 method for signature 'ClusterArchitectureSLURM' initialize(.Object, name = "ClusterArchitectureSLURM", ...)
.Object |
New instance of |
name |
A name or identifier |
... |
arguments passed on to the constructor of |
Michael Scherer
Initialize an RnBClusterRun object
## S4 method for signature 'RnBClusterRun' initialize(.Object, architecture)
## S4 method for signature 'RnBClusterRun' initialize(.Object, architecture)
.Object |
New instance of |
architecture |
A |
Fabian Mueller
Initialize an RnBDiffMeth object
## S4 method for signature 'RnBDiffMeth' initialize( .Object, site.test.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), covg.thres = rnb.getOption("filtering.coverage.threshold"), disk.dump = FALSE, disk.path = NULL )
## S4 method for signature 'RnBDiffMeth' initialize( .Object, site.test.method = rnb.getOption("differential.site.test.method"), variability.method = rnb.getOption("differential.variability.method"), covg.thres = rnb.getOption("filtering.coverage.threshold"), disk.dump = FALSE, disk.path = NULL )
.Object |
New instance of |
site.test.method |
method which was applied to obtain the site-level p-values. |
variability.method |
method to be used to calculate differentially variable sites. Has to be one of: ‘diffVar’ or ‘iEVORA’. |
covg.thres |
coverage threshold. Important for certain columns of the differential methylation tables.
See |
disk.dump |
Flag indicating whether the tables should be stored on disk rather than in the main memory |
disk.path |
Path on the disk for DMTs.Only meaningful if |
Fabian Mueller
Rearranges information from "M" and "U" slots of a RnBeadsRawSet object by color channel.
intensities.by.color( raw.set, address.rownames = TRUE, add.oob = all(!is.null(M0(raw.set)), !is.null(U0(raw.set))), add.controls = !is.null(qc(raw.set)), add.missing = TRUE, re.separate = FALSE )
intensities.by.color( raw.set, address.rownames = TRUE, add.oob = all(!is.null(M0(raw.set)), !is.null(U0(raw.set))), add.controls = !is.null(qc(raw.set)), add.missing = TRUE, re.separate = FALSE )
raw.set |
Methylation dataset as an instance of |
address.rownames |
if |
add.oob |
if |
add.controls |
if |
add.missing |
if |
re.separate |
if |
A list
with elements Cy3
and Cy5
containing average bead intensities measured for each
each probe in the green and red channels, respectively. Exception, if re.separate
is TRUE
a list
with elements Cy3.I
, Cy5.I
, and II
will be returned. The elements Cy3.I.oob
,
Cy5.I.oob
and also Cy3.ctl
, Cy5.ctl
will be returned
if the respective parameters (add.oob
and add.ctl
) are set to true.
Pavlo Lutsik, Nathan Steenbuck
Validate an RnBDiffMeth object, ie. verify that all differential methylation tables are specified and accounted for
## S4 method for signature 'RnBDiffMeth' is.valid(object, verbose = FALSE)
## S4 method for signature 'RnBDiffMeth' is.valid(object, verbose = FALSE)
object |
|
verbose |
print more info to the logger |
TRUE iff all differential methylation tables are present and accounted for
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm1 <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) dm2 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Sample_Group","Treatment"),"promoters") dm.join1 <- join.diffMeth(dm1,dm2) #The following joint object is invalid due to missing region type - comparison combinations is.valid(dm.join1) dm3 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Treatment"),c("genes","tiling")) dm.join2 <- join.diffMeth(dm.join1,dm3) #After joining the missing information, the new object is valid is.valid(dm.join2)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm1 <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) dm2 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Sample_Group","Treatment"),"promoters") dm.join1 <- join.diffMeth(dm1,dm2) #The following joint object is invalid due to missing region type - comparison combinations is.valid(dm.join1) dm3 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Treatment"),c("genes","tiling")) dm.join2 <- join.diffMeth(dm.join1,dm3) #After joining the missing information, the new object is valid is.valid(dm.join2)
Getter for the imputation field. Return TRUE, if the object has been imputed and FALSE otherwise.
## S4 method for signature 'RnBSet' isImputed(object)
## S4 method for signature 'RnBSet' isImputed(object)
object |
Object for which the information should be returned |
TRUE, if the object has been imputed and FALSE otherwise.
Michael Scherer
Merges two disjoint RnBDiffMeth objects into one. Disjoint here means, that no differential methylation table is specified in both objects.
## S4 method for signature 'RnBDiffMeth,RnBDiffMeth' join.diffMeth(obj1, obj2)
## S4 method for signature 'RnBDiffMeth,RnBDiffMeth' join.diffMeth(obj1, obj2)
obj1 |
|
obj2 |
|
the merged RnBDiffMeth
object
Caveat: if disk dumping is enabled the resulting object tables will be stored in the initial location of the first object to be joined I.e. deleting the first object will lead to a broken joined object and deleting the joined object will lead to an broken first object.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm1 <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) dm2 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Sample_Group","Treatment"),"promoters") dm.join1 <- join.diffMeth(dm1,dm2) #The following joint object is invalid due to missing region type - comparison combinations is.valid(dm.join1) dm3 <- rnb.execute.computeDiffMeth(rnb.set.example,"Treatment",c("genes","tiling")) dm.join2 <- join.diffMeth(dm.join1,dm3) #After joining the missing information, the new object is valid is.valid(dm.join2)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm1 <- rnb.execute.computeDiffMeth(rnb.set.example,"Sample_Group",c("genes","tiling")) dm2 <- rnb.execute.computeDiffMeth(rnb.set.example,c("Sample_Group","Treatment"),"promoters") dm.join1 <- join.diffMeth(dm1,dm2) #The following joint object is invalid due to missing region type - comparison combinations is.valid(dm.join1) dm3 <- rnb.execute.computeDiffMeth(rnb.set.example,"Treatment",c("genes","tiling")) dm.join2 <- join.diffMeth(dm.join1,dm3) #After joining the missing information, the new object is valid is.valid(dm.join2)
applies hierarchical modeling anlalogous to differential expression employed in the limma
package and returns
p-values for differential methylation
limmaP( X, inds.g1, inds.g2 = -inds.g1, adjustment.table = NULL, fun.conversion = rnb.beta2mval, paired = FALSE )
limmaP( X, inds.g1, inds.g2 = -inds.g1, adjustment.table = NULL, fun.conversion = rnb.beta2mval, paired = FALSE )
X |
Matrix on which the test is performed for every row |
inds.g1 |
column indices of group 1 members |
inds.g2 |
column indices of group 2 members |
adjustment.table |
a |
fun.conversion |
conversion function to transform the beta values into M values. By default, it is the logit function with adjustment
for infinity values. See |
paired |
should a paired analysis model be used. If so, the first index in |
vector of p-values resulting from limma's differential analysis
Requires limma
package
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] p.vals <- limmaP(meth.mat,sample.groups[[1]],sample.groups[[2]])
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] p.vals <- limmaP(meth.mat,sample.groups[[1]],sample.groups[[2]])
For the region annotation of a given RnBSet
object. Subdivide each region into subsegments by
hierarchical clustering on the site distances in a particular region and then splitting the region into subregions consisting
of these site clusters. The number of clusters is determined in such way that the mean number of sites per cluster
is given by the ns
parameter.
load.region.subsegment.annotation(rnb.set, annotation.dir)
load.region.subsegment.annotation(rnb.set, annotation.dir)
rnb.set |
The |
annotation.dir |
a directory to load the annotation from. (binary |
invisible TRUE
Fabian Mueller
load a saved RnBDiffMeth
object from disk
load.rnb.diffmeth(path)
load.rnb.diffmeth(path)
path |
path of the saved object (a directory containing a corresponding |
the loaded RnBDiffMeth
object
Fabian Mueller
Loading of the RnBSet
objects with large matrices of type ff.
load.rnb.set(path, temp.dir = tempdir())
load.rnb.set(path, temp.dir = tempdir())
path |
full path of the file or directory. If |
temp.dir |
|
Loaded object
Pavlo Lutsik
Load LOLA databases from disk and merge them
loadLolaDbs(lolaDbPaths)
loadLolaDbs(lolaDbPaths)
lolaDbPaths |
vector of names of LOLA DB paths to be loaded |
LOLA DB list as returned by LOLA::loadRegionDB
Fabian Mueller
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]])
# download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") lolaDb <- loadLolaDbs(lolaDirs[["hg19"]])
Reads a command-line argument supplied to a script.
logger.argument( arg.names, full.name, arg.type = "character", accepted.values = NULL, default = NULL, arg.list = commandArgs() )
logger.argument( arg.names, full.name, arg.type = "character", accepted.values = NULL, default = NULL, arg.list = commandArgs() )
arg.names |
|
full.name |
One-element |
arg.type |
Variable type of the argument. Must be one of |
accepted.values |
Vector of accepted values for the argument. This must be of the type given in |
default |
Default value for the argument in case it is not specified. Setting this to |
arg.list |
Vector of arguments provided at the execution of the script. The arguments should be provided as name=value pairs. |
This is convenience function for reading parameters supplied to the script in the form name = value.
It expects that logging is enabled (see rnb.options
). The function fails if this condition is
not met.
Argument's value, or NULL
if such is not provided.
Yassen Assenov
n.iterations <- logger.argument("iterations", "number of iterations", "integer", accepted.values = 1:100, default = 1L) logger.close()
n.iterations <- logger.argument("iterations", "number of iterations", "integer", accepted.values = 1:100, default = 1L) logger.close()
Gets the files currently used by the logger.
logger.getfiles()
logger.getfiles()
Vector storing the full names of the files that are being used by the logger. This vector contains NA
as an element if the logger is (also) using the console for its output. If logging functionality is disabled
(see rnb.options
) or the logger is not initialized, this function returns NULL
.
Yassen Assenov
logger.isinitialized
to check if logging is activated;
logger.start
for initializing a logger or starting a section
if (NA %in% logger.getfiles()) cat("Console logger is enabled\n")
if (NA %in% logger.getfiles()) cat("Console logger is enabled\n")
Checks if the logger is initialized.
logger.isinitialized()
logger.isinitialized()
TRUE
if the logger was initialized and is in use; FALSE
otherwise.
Yassen Assenov
logger.start
for initializing a logger or starting a section
if (!logger.isinitialized()) logger.start(fname = NA)
if (!logger.isinitialized()) logger.start(fname = NA)
Log the machine name the analysis is run on
logger.machine.name()
logger.machine.name()
None (invisible NULL
).
Fabian Mueller
Functions for logger management.
logger.start(txt = character(0), fname = NULL) logger.completed() logger.close()
logger.start(txt = character(0), fname = NULL) logger.completed() logger.close()
txt |
Description to add to the log file. The words |
fname |
Name of the log file and/or console. Note that at most one file name can be specified. The function
|
None (invisible NULL
).
logger.start
initializes the logger and/or starts a new section. logger.completed
completes the last
(innermost) open section in the log. logger.close
deinitializes the logger. Note that after reinitialization
or deinitialization, the information about the current output file, as well as any open sections, is deleted.
Yassen Assenov
logger.isinitialized
if (!logger.isinitialized()) logger.start(fname = NA) logger.start("Tests for Significance") logger.completed() logger.close()
if (!logger.isinitialized()) logger.start(fname = NA) logger.start("Tests for Significance") logger.completed() logger.close()
Appends a single-line status message to the log text file. The message is prepended by its type, which is one of
STATUS
, INFO
, WARNING
or ERROR
.
logger.status(txt) logger.info(txt) logger.warning(txt) logger.error(txt, terminate = rnb.getOption("logging.exit.on.error"))
logger.status(txt) logger.info(txt) logger.warning(txt) logger.error(txt, terminate = rnb.getOption("logging.exit.on.error"))
txt |
Text to add to the log file. This must be a |
terminate |
Flag indicating if the execution is to be terminated after this error message is added to the log. |
None (invisible NULL
).
Yassen Assenov
logger.isinitialized
to check if logging is activated;
logger.start
for initializing a logger or starting a section
if (!logger.isinitialized()) logger.start(fname = NA) logger.status(c("Reached step", 2)) logger.info(c("Provided email:", rnb.getOption("email")))
if (!logger.isinitialized()) logger.start(fname = NA) logger.status(c("Reached step", 2)) logger.info(c("Provided email:", rnb.getOption("email")))
Validates the specified file or directory exists. Prints an error or a warning message to the log if it does not exist, it is not of the accepted type or is not accessible.
logger.validate.file(file, is.file = TRUE, terminate = TRUE)
logger.validate.file(file, is.file = TRUE, terminate = TRUE)
file |
Name of file or directory to validate. |
is.file |
Flag indicating if the given name must denote an existing file. If this is |
terminate |
Flag indicating if the execution is to be terminated in case the validation fails. This parameter
determines if an error message ( |
Whether the validation succeeded or not, invisibly. Note that when terminate
is TRUE
and the
validation fails, the R session is closed and thus no value is returned.
Yassen Assenov
if (!logger.isinitialized()) logger.start(fname = NA) # Validate the current working directory exists logger.validate.file(getwd(), FALSE)
if (!logger.isinitialized()) logger.start(fname = NA) # Validate the current working directory exists logger.validate.file(getwd(), FALSE)
plot a barplot of LOLA enrichment results
lolaBarPlot( lolaDb, lolaRes, scoreCol = "pValueLog", orderCol = scoreCol, signifCol = "qValue", includedCollections = c(), pvalCut = 0.01, maxTerms = 50, colorpanel = sample(rainbow(maxTerms, v = 0.5)), groupByCollection = TRUE, orderDecreasing = NULL )
lolaBarPlot( lolaDb, lolaRes, scoreCol = "pValueLog", orderCol = scoreCol, signifCol = "qValue", includedCollections = c(), pvalCut = 0.01, maxTerms = 50, colorpanel = sample(rainbow(maxTerms, v = 0.5)), groupByCollection = TRUE, orderDecreasing = NULL )
lolaDb |
LOLA DB object as returned by |
lolaRes |
LOLA enrichment result as returned by the |
scoreCol |
column name in |
orderCol |
column name in |
signifCol |
column name of the significance score in |
includedCollections |
vector of collection names to be included in the plot. If empty (default), all collections are used |
pvalCut |
p-value cutoff to be employed for filtering the results |
maxTerms |
maximum number of items to be included in the plot |
colorpanel |
colors to be used for coloring the bars according to "target" (see |
groupByCollection |
facet the plot by collection |
orderDecreasing |
flag indicating whether the value in |
ggplot object containing the plot
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaBarPlot(res$lolaDb, lolaRes, scoreCol="oddsRatio", orderCol="maxRnk", pvalCut=0.05)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaBarPlot(res$lolaDb, lolaRes, scoreCol="oddsRatio", orderCol="maxRnk", pvalCut=0.05)
plot a boxplot showing LOLA enrichment results per "target" group (see getTargetFromLolaDb
for an explanation of
"target").
lolaBoxPlotPerTarget( lolaDb, lolaRes, scoreCol = "pValueLog", orderCol = scoreCol, signifCol = "qValue", includedCollections = c(), pvalCut = 0.01, maxTerms = 50, colorpanel = c(), groupByCollection = TRUE, orderDecreasing = NULL, scoreDecreasing = NULL )
lolaBoxPlotPerTarget( lolaDb, lolaRes, scoreCol = "pValueLog", orderCol = scoreCol, signifCol = "qValue", includedCollections = c(), pvalCut = 0.01, maxTerms = 50, colorpanel = c(), groupByCollection = TRUE, orderDecreasing = NULL, scoreDecreasing = NULL )
lolaDb |
LOLA DB object as returned by |
lolaRes |
LOLA enrichment result as returned by the |
scoreCol |
column name in |
orderCol |
column name in |
signifCol |
column name of the significance score in |
includedCollections |
vector of collection names to be included in the plot. If empty (default), all collections are used |
pvalCut |
p-value cutoff to be employed for filtering the results |
maxTerms |
maximum number of items to be included in the plot |
colorpanel |
colors to be used for coloring the bars according to "target" (see |
groupByCollection |
facet the plot by collection |
orderDecreasing |
flag indicating whether the value in |
scoreDecreasing |
flag indicating whether the value in |
ggplot object containing the plot
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaBoxPlotPerTarget(res$lolaDb, lolaRes, scoreCol="oddsRatio", orderCol="maxRnk", pvalCut=0.05)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaBoxPlotPerTarget(res$lolaDb, lolaRes, scoreCol="oddsRatio", orderCol="maxRnk", pvalCut=0.05)
plot a volcano plot showing LOLA enrichment results: LOLA p-value against the log-odds score. Colored by rank
lolaVolcanoPlot( lolaDb, lolaRes, includedCollections = c(), signifCol = "qValue", colorBy = "maxRnk", colorpanel = c() )
lolaVolcanoPlot( lolaDb, lolaRes, includedCollections = c(), signifCol = "qValue", colorBy = "maxRnk", colorpanel = c() )
lolaDb |
LOLA DB object as returned by |
lolaRes |
LOLA enrichment result as returned by the |
includedCollections |
vector of collection names to be included in the plot. If empty (default), all collections are used |
signifCol |
column name of the significance score in |
colorBy |
annotation/column in the the LOLA DB that should be used for point coloring |
colorpanel |
colors to be used for coloring the points |
ggplot object containing the plot
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaVolcanoPlot(res$lolaDb, lolaRes, signifCol="qValue")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]]) # select the 500 most hypermethylated tiling regions in ESCs compared to iPSCs # in the example dataset lolaRes <- res$region[["hESC vs. hiPSC (based on Sample_Group)"]][["tiling"]] lolaRes <- lolaRes[lolaRes$userSet=="rankCut_500_hyper",] # plot lolaVolcanoPlot(res$lolaDb, lolaRes, signifCol="qValue")
The sites used by the LUMP algorithm for estimating immune cell content are stored in an object named
lump.hg19
. This object should not be loaded or otherwise operated on by users. Please refer to the
documentation of rnb.execute.lump
for information on the algorithm and its implementation in
RnBeads.
lump.*
is a list
of non-empty integer
matrices, one per supported platform. Every
matrix
contains exactly two columns, denoting chromosome index and chromosome-based index,
respectively. These indices refer to positions within the probe/site annotation table employed by
RnBeads for the corresponding platform.
Yassen Assenov
Those are the same sites as reported in lump.hg19
, but lifted to ‘hg38' with UCSC’s liftOver functionality. This only
applies for the CpG-wise sites; i.e. those used for sequencing data sets, since 'hg38' is not supported for array-based data
sets.
lump.*
is a list
of non-empty integer
matrices, one per supported platform. Here, only 'CpG' is
available for BS datasets.
Michael Scherer
Extract raw methylated probe intensity from an object of RnBeadRawSet
class.
## S4 method for signature 'RnBeadRawSet' M(object, row.names = FALSE)
## S4 method for signature 'RnBeadRawSet' M(object, row.names = FALSE)
object |
Dataset of interest. |
row.names |
Flag indicating whether the resulting matrix will be assigned row names |
matrix
of the methylated probe intensities
library(RnBeads.hg19) data(small.example.object) M.intensity<-M(rnb.set.example) head(M.intensity)
library(RnBeads.hg19) data(small.example.object) M.intensity<-M(rnb.set.example) head(M.intensity)
Given a logical matrix, sets corresponding entries in the methylation table to NA (masking). Low memory footprint
## S4 method for signature 'RnBSet' mask.sites.meth(object, mask, verbose = FALSE)
## S4 method for signature 'RnBSet' mask.sites.meth(object, mask, verbose = FALSE)
object |
Dataset of interest. |
mask |
logical matrix indicating which sites should be masked |
verbose |
if |
The modified dataset.
Take an RnBSet object and merge methylation and phenotype information given a grouping column in the pheno table coverage is combined by taking the sum of coverages pheno is combined by concatenating entries from all samples
## S4 method for signature 'RnBSet' mergeSamples(object, grp.col)
## S4 method for signature 'RnBSet' mergeSamples(object, grp.col)
object |
input RnBSet object |
grp.col |
a column name (string) of |
combines phenotype information, coverage information and methylation information
methylation is combined by taking the average. Detection p-values are combined using Fisher's method.
For methylation arrays, bead counts are currently not taken into account.
objects of class RnBeadRawSet
are automatically converted to RnBeadSet
.
the modified RnBSet object
Requires the packages foreach and doParallel.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) rnb.set.example rnb.set.merged <- mergeSamples(rnb.set.example,"Cell_Line") rnb.set.merged pheno(rnb.set.merged)
library(RnBeads.hg19) data(small.example.object) rnb.set.example rnb.set.merged <- mergeSamples(rnb.set.example,"Cell_Line") rnb.set.merged pheno(rnb.set.merged)
Extracts DNA methylation information (beta values) for a specified set of genomic features.
## S4 method for signature 'RnBSet' meth(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
## S4 method for signature 'RnBSet' meth(object, type = "sites", row.names = FALSE, i = NULL, j = NULL)
object |
dataset of interest. |
type |
|
row.names |
flag indicating if row names are to be generated in the result. |
i |
indices of sites/regions to be retrieved. By default ( |
j |
indices of samples to be retrieved. By default ( |
matrix
with methylation beta values.
mval
for calculating M values
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix mm<-meth(rnb.set.example, row.names=TRUE) head(mm) ## beta-values for each covered gene gmm<-meth(rnb.set.example, type="gene", row.names=TRUE) head(gmm)
library(RnBeads.hg19) data(small.example.object) ## per-site beta-value matrix mm<-meth(rnb.set.example, row.names=TRUE) head(mm) ## beta-values for each covered gene gmm<-meth(rnb.set.example, type="gene", row.names=TRUE) head(gmm)
Extracts DNA methylation information (M values) for a specified set of genomic features.
## S4 method for signature 'RnBSet' mval(object, type = "sites", row.names = FALSE, epsilon = 0)
## S4 method for signature 'RnBSet' mval(object, type = "sites", row.names = FALSE, epsilon = 0)
object |
dataset of interest. |
type |
|
row.names |
Flag indicating of row names are to be generated in the result. |
epsilon |
Threshold of beta values to use when adjusting for potential M values close to +infinity or
-infinity. See |
matrix
with methylation M values.
meth
for extracting methylation beta values
library(RnBeads.hg19) data(small.example.object) ## per-site M-value matrix mm<-mval(rnb.set.example, row.names=TRUE) head(mm) ## M-values for each covered gene gmm<-mval(rnb.set.example, type="gene", row.names=TRUE) head(gmm)
library(RnBeads.hg19) data(small.example.object) ## per-site M-value matrix mm<-mval(rnb.set.example, row.names=TRUE) head(mm) ## M-values for each covered gene gmm<-mval(rnb.set.example, type="gene", row.names=TRUE) head(gmm)
Returns the number of sites/regions for a given RnBSet
object
## S4 method for signature 'RnBSet' nsites(object, type = "sites")
## S4 method for signature 'RnBSet' nsites(object, type = "sites")
object |
|
type |
|
integer
stating the number of sites/regions. NA
if the regions have not been summarized yet.
meth
Retrieving the matrix of methylation values
library(RnBeads.hg19) data(small.example.object) nsites(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) nsites(rnb.set.example)
Performs cleanup and/or other finishing activities and closes the specified device, connection, or document.
## S4 method for signature 'Report' off(.Object) ## S4 method for signature 'ReportPlot' off(.Object) ## S4 method for signature 'ReportGgPlot' off(.Object, handle.errors = FALSE)
## S4 method for signature 'Report' off(.Object) ## S4 method for signature 'ReportPlot' off(.Object) ## S4 method for signature 'ReportGgPlot' off(.Object, handle.errors = FALSE)
.Object |
Object to be closed. |
handle.errors |
Flag indicating if the method should attempt to catch and process errors (e.g. I/O errors)
internally. Setting this to |
The closed object, invisibly.
Gets the number of workers used for parallel processing.
parallel.getNumWorkers()
parallel.getNumWorkers()
Number of workers used for parallel processing; -1
if parallel processing is not enabled.
Fabian Mueller
parallel.getNumWorkers() parallel.setup(2) parallel.getNumWorkers() parallel.teardown() parallel.getNumWorkers()
parallel.getNumWorkers() parallel.setup(2) parallel.getNumWorkers() parallel.teardown() parallel.getNumWorkers()
Checks if whether parallel processing is enabled.
parallel.isEnabled()
parallel.isEnabled()
TRUE
if multicore processing is enabled, FALSE
otherwise.
Fabian Mueller
parallel.isEnabled() parallel.setup(2) parallel.isEnabled() parallel.teardown() parallel.isEnabled()
parallel.isEnabled() parallel.setup(2) parallel.isEnabled() parallel.teardown() parallel.isEnabled()
Sets up parallel processing. Requires the foreach and doParallel packages
parallel.setup(...)
parallel.setup(...)
... |
Parameters for |
TRUE
(invisible) to indicate that parallelization is set up.
Requires the packages foreach and doParallel.
Fabian Mueller
parallel.setup(2) parallel.teardown()
parallel.setup(2) parallel.teardown()
Disables parallel processing.
parallel.teardown()
parallel.teardown()
TRUE
, invisibly.
Fabian Mueller
parallel.getNumWorkers() parallel.setup(2) parallel.getNumWorkers() parallel.teardown() parallel.getNumWorkers()
parallel.getNumWorkers() parallel.setup(2) parallel.getNumWorkers() parallel.teardown() parallel.getNumWorkers()
performs Geno Ontology (GO) enrichment analysis for a given differential methylation table.
performGoEnrichment.diffMeth( rnbSet, diffmeth, ontologies = c("BP", "MF"), rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE, ... )
performGoEnrichment.diffMeth( rnbSet, diffmeth, ontologies = c("BP", "MF"), rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE, ... )
rnbSet |
RnBSet object for which dirrential methylation was computed |
diffmeth |
RnBDiffMeth object. See |
ontologies |
GO ontologies to use for enrichment analysis |
rank.cuts.region |
Cutoffs for combined ranking that are used to determine differentially methylated regions |
add.auto.rank.cut |
flag indicating whether an automatically computed cut-off should also be considered. |
rerank |
For deterimining differential methylation: should the ranks be ranked again or should the absolute ranks be used. |
verbose |
Enable for detailed status report |
... |
arguments passed on to the parameters of |
a DiffMeth.go.enrich object (S3) containing the following attributes
region |
Enrichment information for differential methylation on the region level. See |
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) res <- performGoEnrichment.diffMeth(rnb.set.example,dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) res <- performGoEnrichment.diffMeth(rnb.set.example,dm)
performs Gene Ontology (GO) enrichment analysis for a list of Entrez identifiers
performGOenrichment.diffMeth.entrez( gids, uids, ontology, assembly = "hg19", ... )
performGOenrichment.diffMeth.entrez( gids, uids, ontology, assembly = "hg19", ... )
gids |
gene ids to test (entrez IDs) |
uids |
ids to test against (universe) |
ontology |
which ontology should be used (see |
assembly |
Genome to be used. One of the following: hg19, mm9, mm10 or rn5 |
... |
arguments passed on to the parameters of |
a GOHyperGresult
object (see the GOstats
package for further details)
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) dmt <- get.table(dm,get.comparisons(dm)[1],"promoters") annot <- annotation(rnb.set.example,"promoters") all.promoters <- annot$entrezID #get the hypermethylated promoters hyper.promoters <- annot$entrezID[dmt[,"mean.mean.diff"]>0] result <- performGOenrichment.diffMeth.entrez(hyper.promoters,all.promoters,"BP",assembly="hg19")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) dmt <- get.table(dm,get.comparisons(dm)[1],"promoters") annot <- annotation(rnb.set.example,"promoters") all.promoters <- annot$entrezID #get the hypermethylated promoters hyper.promoters <- annot$entrezID[dmt[,"mean.mean.diff"]>0] result <- performGOenrichment.diffMeth.entrez(hyper.promoters,all.promoters,"BP",assembly="hg19")
performs Geno Ontology (GO) enrichment analysis for a given differential variability table.
performGOEnrichment.diffVar( rnbSet, diffmeth, enrich.diffMeth = NULL, ontologies = c("BP", "MF"), rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE, ... )
performGOEnrichment.diffVar( rnbSet, diffmeth, enrich.diffMeth = NULL, ontologies = c("BP", "MF"), rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE, ... )
rnbSet |
RnBSet object for which dirrential variability was computed |
diffmeth |
RnBDiffMeth object. See |
enrich.diffMeth |
Result of |
ontologies |
GO ontologies to use for enrichment analysis |
rank.cuts.region |
Cutoffs for combined ranking that are used to determine differentially variable regions |
add.auto.rank.cut |
flag indicating whether an automatically computed cut-off should also be considered. |
rerank |
For deterimining differential variability: should the ranks be ranked again or should the absolute ranks be used. |
verbose |
Enable for detailed status report |
... |
arguments passed on to the parameters of |
a DiffMeth.enrich object (S3) containing the following attributes
region |
Enrichment information for differential variability on the region level. See |
Fabian Mueller and Michael Scherer
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.diffVar(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) res <- performEnrichment.diffVar(rnb.set.example,dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.diffVar(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) res <- performEnrichment.diffVar(rnb.set.example,dm)
performs LOLA enrichment analysis for a given differential methylation table.
performLolaEnrichment.diffMeth( rnbSet, diffmeth, lolaDbPaths, rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE )
performLolaEnrichment.diffMeth( rnbSet, diffmeth, lolaDbPaths, rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE )
rnbSet |
RnBSet object for which dirrential methylation was computed |
diffmeth |
RnBDiffMeth object. See |
lolaDbPaths |
LOLA database paths |
rank.cuts.region |
Cutoffs for combined ranking that are used to determine differentially methylated regions |
add.auto.rank.cut |
flag indicating whether an automatically computed cut-off should also be considered. |
rerank |
For deterimining differential methylation: should the ranks be ranked again or should the absolute ranks be used. |
verbose |
Enable for detailed status report |
a DiffMeth.lola.enrich object (S3) containing the following attributes
region |
Enrichment information for differential methylation on the region level. A |
lolaDb |
The loaded |
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]])
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffMeth(rnb.set.example,dm,lolaDirs[["hg19"]])
performs LOLA enrichment analysis for a given differential variability table.
performLolaEnrichment.diffVar( rnbSet, diffmeth, enrich.diffMeth = NULL, lolaDbPaths, rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE )
performLolaEnrichment.diffVar( rnbSet, diffmeth, enrich.diffMeth = NULL, lolaDbPaths, rank.cuts.region = c(100, 500, 1000), add.auto.rank.cut = TRUE, rerank = TRUE, verbose = TRUE )
rnbSet |
RnBSet object for which differential variability was computed |
diffmeth |
RnBDiffMeth object. See |
enrich.diffMeth |
Enrichment object as obtained from |
lolaDbPaths |
LOLA database paths |
rank.cuts.region |
Cutoffs for combined ranking that are used to determine differentially variable regions |
add.auto.rank.cut |
flag indicating whether an automatically computed cut-off should also be considered. |
rerank |
For deterimining differential variability: should the ranks be ranked again or should the absolute ranks be used. |
verbose |
Enable for detailed status report |
a DiffMeth.lola.enrich object (S3) containing the following attributes
region |
Enrichment information for differential variability on the region level. A |
lolaDb |
The loaded |
Michael Scherer and Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.diffVar(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffVar(rnb.set.example,dm,lolaDirs[["hg19"]])
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) # compute differential methylation dm <- rnb.execute.diffVar(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) # download LOLA DB lolaDest <- tempfile() dir.create(lolaDest) lolaDirs <- downloadLolaDbs(lolaDest, dbs="LOLACore") # perform enrichment analysis res <- performLolaEnrichment.diffVar(rnb.set.example,dm,lolaDirs[["hg19"]])
Extracts sample phenotype and/or processing information.
## S4 method for signature 'RnBSet' pheno(object)
## S4 method for signature 'RnBSet' pheno(object)
object |
Dataset of interest. |
Sample annotation information available for the dataset in the form of a data.frame
.
library(RnBeads.hg19) data(small.example.object) pheno(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) pheno(rnb.set.example)
Starting from an RnBeadSet
object generates a batch submission file for Gene Expression Omnibus series in SOFT format
prepareSOFTfileForGEO( rnb.set, filename, sample.source.col = NULL, sample.description.col = NULL, sample.title.col = NULL, export.cols = seq(ncol(pheno(rnb.set))), rnb.set.raw = NULL, sample.extra.info = NULL, series.info = NULL )
prepareSOFTfileForGEO( rnb.set, filename, sample.source.col = NULL, sample.description.col = NULL, sample.title.col = NULL, export.cols = seq(ncol(pheno(rnb.set))), rnb.set.raw = NULL, sample.extra.info = NULL, series.info = NULL )
rnb.set |
Object inheriting from class |
filename |
Absolute path or a name of a SOFT file to be generated |
sample.source.col |
|
sample.description.col |
|
sample.title.col |
|
export.cols |
|
rnb.set.raw |
Object inheriting from class |
sample.extra.info |
Optionally, a |
series.info |
A |
The code was largely adapted from a similar function in package lumi
which is due to Pan Du.
TRUE
on success.
Pavlo Lutsik
Extracts HumanMethylation quality control information
## S4 method for signature 'RnBeadSet' qc(object)
## S4 method for signature 'RnBeadSet' qc(object)
object |
Dataset of interest. |
Quality control information available for the dataset in the form of a list
with two elements:
Cy3
and Cy5
.
library(RnBeads.hg19) data(small.example.object) qcinf<-dpval(rnb.set.example, row.names=TRUE) head(qcinf$Cy3) head(qcinf$Cy5)
library(RnBeads.hg19) data(small.example.object) qcinf<-dpval(rnb.set.example, row.names=TRUE) head(qcinf$Cy3) head(qcinf$Cy5)
Reads a reduced-representation/whole-genome bisulfite sequencing data set from a set of BED files
read.bed.files( base.dir = NULL, file.names = NULL, sample.sheet = NULL, file.names.col = 0, assembly = rnb.getOption("assembly"), region.types = rnb.region.types.for.analysis(assembly), pos.coord.shift = 1L, skip.lines = 1, sep.samples = rnb.getOption("import.table.separator"), merge.bed.files = TRUE, useff = rnb.getOption("disk.dump.big.matrices"), usebigff = rnb.getOption("disk.dump.bigff"), verbose = TRUE, ... )
read.bed.files( base.dir = NULL, file.names = NULL, sample.sheet = NULL, file.names.col = 0, assembly = rnb.getOption("assembly"), region.types = rnb.region.types.for.analysis(assembly), pos.coord.shift = 1L, skip.lines = 1, sep.samples = rnb.getOption("import.table.separator"), merge.bed.files = TRUE, useff = rnb.getOption("disk.dump.big.matrices"), usebigff = rnb.getOption("disk.dump.bigff"), verbose = TRUE, ... )
base.dir |
Directory with BED files contatining processed methylation data |
file.names |
Optional non-empty |
sample.sheet |
Optional file name containing a table of sample annotation data, or the table itself in the form
of a |
file.names.col |
Column of the sample sheet which contains the file names (integer singleton). If |
assembly |
Genome assembly. Defaults to human ( |
region.types |
|
pos.coord.shift |
The frame shift between the the CpG annotation (1-based) and the coordinates in the loaded BEDs.
If BEDs have 0-based coordinates, |
skip.lines |
The number of top lines to skip while reading the BED files |
sep.samples |
|
merge.bed.files |
In case multiple BED files are specified for each sample, the flag indicates whether the methylation calls should be merged after reading |
useff |
If |
usebigff |
flag specifying whether the extended ff functionality should be used (large matrix support for ff) |
verbose |
Flag indicating ifthe messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error. |
... |
Further arguments which are passed to the internal function |
To control the BED column assignment, one should also supply arguments to read.single.bed
.
an object of class RnBiseqSet
Pavlo Lutsik
Reads in a directory with Illumina Infinium HumanMethylation450 data. The files shoudl be stored as data
read.data.dir( dir, pheno, betas, p.values, bead.counts, sep = rnb.getOption("import.table.separator"), verbose = TRUE )
read.data.dir( dir, pheno, betas, p.values, bead.counts, sep = rnb.getOption("import.table.separator"), verbose = TRUE )
dir |
directory containing the table files |
pheno |
a file containing data sample annotations and phenotypic information |
betas |
a file containing the beta values. If not supplied, the routine will look in dir for a file containing "beta" token in the filename |
p.values |
a file containing the detection p values. If not supplied, the routine will look in dir for a file containing "pval" token in the filename |
bead.counts |
a file containing the bead counts (optional). If not supplied, the routine will look in dir for a file containing "bead" token in the filename |
sep |
character used as field separator in the tables files. Default value is taken by the call to |
verbose |
Flag indicating ifthe messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error. |
Colnames in all files should match. They will be returned as the samples element of the list.
Object of type RnBeadSet
.
Pavlo Lutsik
Reads in a Genome Studio report, exported as a single file.
read.GS.report( gsReportFile, pd = NULL, sep = rnb.getOption("import.table.separator"), keep.methylumi = FALSE, verbose = TRUE )
read.GS.report( gsReportFile, pd = NULL, sep = rnb.getOption("import.table.separator"), keep.methylumi = FALSE, verbose = TRUE )
gsReportFile |
location of the GS report file |
pd |
alternative sample annotation, if the |
sep |
character used as field separator in the sample sheet file and in the GS report file
(should be identical).
Default value is taken by the call to |
keep.methylumi |
a flag indicating whether the a |
verbose |
Flag indicating ifthe messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error. |
MethylumiSet object with the data from the report
Reads a directory of .idat
files and initializes an object of type MethyLumiSet
.
read.idat.files( base.dir, barcodes = NULL, sample.sheet = NULL, sep.samples = rnb.getOption("import.table.separator"), dpval.method = "controls", useff = FALSE, verbose = TRUE )
read.idat.files( base.dir, barcodes = NULL, sample.sheet = NULL, sep.samples = rnb.getOption("import.table.separator"), dpval.method = "controls", useff = FALSE, verbose = TRUE )
base.dir |
Directory that contains the |
barcodes |
Optional non-empty |
sample.sheet |
Optional file name containing a table of sample annotation data, or the table itself in the
form of a |
sep.samples |
|
dpval.method |
|
useff |
If |
verbose |
Flag specifying whether the messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error. |
If neither barcodes
, nor sample.sheet
are specified, the function attempts to locate a file in
base.dir
containing sample annotation information. It fails ifsuch a file cannot be (unambiguously)
identified. If both barcodes
and sample.sheet
are supplied, only sample.sheet
is used in loading
methylation data. The value of barcodes
is tested for validity but it is not used as a filter.
Loaded dataset of HumanMethylation450K samples, encapsulated in an object of type MethyLumiSet
.
Pavlo Lutsik
methylumIDAT
in package methylumi
Reads a directory of .idat
files and initializes an object of type MethyLumiSet
.
read.idat.files2( base.dir, barcodes = NULL, sample.sheet = NULL, sep.samples = rnb.getOption("import.table.separator"), load.chunk = NULL, keep.methylumi = FALSE, verbose = TRUE )
read.idat.files2( base.dir, barcodes = NULL, sample.sheet = NULL, sep.samples = rnb.getOption("import.table.separator"), load.chunk = NULL, keep.methylumi = FALSE, verbose = TRUE )
base.dir |
Directory that contains the |
barcodes |
Optional non-empty |
sample.sheet |
Optional file name containing a table of sample annotation data, or the table itself in the
form of a |
sep.samples |
character used as field separator in the sample sheet file.
Default value is taken by the call to |
load.chunk |
|
keep.methylumi |
a flag indicating whether the a |
verbose |
Flag indicating ifthe messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error. |
If neither barcodes
, nor sample.sheet
are specified, the function attempts to locate a file in
base.dir
containing sample annotation information. It fails ifsuch a file cannot be (unambiguously)
identified. If both barcodes
and sample.sheet
are supplied, only sample.sheet
is used in loading
methylation data. The value of barcodes
is tested for validity but it is not used as a filter.
Loaded dataset of HumanMethylation450K samples, encapsulated in an object of type MethyLumiSet
.
Pavlo Lutsik
methylumIDAT
in package methylumi
Reads Illumina Infinium sample annotation.
read.sample.annotation(fname, sep = rnb.getOption("import.table.separator"))
read.sample.annotation(fname, sep = rnb.getOption("import.table.separator"))
fname |
Name of text file that contains a sample annotation table with a header. This method handles a variety of file formats, including comma-separated values file exported from Genome Studio. |
sep |
One-element |
Sample annotation table in the form of a data.frame
, in which every row corresponds to a sample, and
every column - to a trait.
Pavlo Lutsik
annotation.file<-system.file("") sa<-read.sample.annotation(annotation.file) sa
annotation.file<-system.file("") sa<-read.sample.annotation(annotation.file) sa
reads a BED file with methylation information
read.single.bed( file, chr.col = 1L, start.col = 2L, end.col = 3L, strand.col = 6L, mean.meth.col = 7L, coverage.col = 8L, c.col = NA, t.col = NA, is.epp.style = FALSE, coord.shift = 0L, ffread = FALSE, context = "cg", ... )
read.single.bed( file, chr.col = 1L, start.col = 2L, end.col = 3L, strand.col = 6L, mean.meth.col = 7L, coverage.col = 8L, c.col = NA, t.col = NA, is.epp.style = FALSE, coord.shift = 0L, ffread = FALSE, context = "cg", ... )
file |
the input BED file |
chr.col |
chromosome column index |
start.col |
start column index |
end.col |
end column index |
strand.col |
strand column index |
mean.meth.col |
mean methylation column index |
coverage.col |
column with coverage information |
c.col |
converted C counts column index |
t.col |
unconverted C counts column index |
is.epp.style |
Flag for custom Broad Epigenome Pipeline (EPP) bed style (columns |
coord.shift |
An integer specifying the coordinate adjustment applied to the start and end coordinates. |
ffread |
Use |
context |
prefix for the output rownames |
... |
further arguments to |
Missing columns should be assigned with NA
. In case mean.meth.col
is absent at least coverage.col
and one of c.col
or t.col
should be specified.
a data.frame
or ff.data.frame
object with DNA methylation and coverage information. The row names are formed by the following convension:
context\.read.delim(file,...)[,chr.col]\.read.delim(file,...)[,start.col]\.read.delim(file,...)[,strand.col]
.
Pavlo Lutsik
NOTE: This function is deprecated, since the RefFreeEWAS package is not supported and available anymore Applies the reference-free cell-type heterogeneity adjustment model from [1] and returns corrected p-values
refFreeEWASP( X, inds.g1, inds.g2 = -inds.g1, adjustment.table = NULL, paired = FALSE, nboot = 100, ignore.na = TRUE, rescale.residual = TRUE )
refFreeEWASP( X, inds.g1, inds.g2 = -inds.g1, adjustment.table = NULL, paired = FALSE, nboot = 100, ignore.na = TRUE, rescale.residual = TRUE )
X |
Matrix on which the test is performed for every row |
inds.g1 |
column indices of group 1 members |
inds.g2 |
column indices of group 2 members |
adjustment.table |
a |
paired |
should a paired analysis model be used. If so, the first index in |
nboot |
The number of bootstrapping resamples |
ignore.na |
in this case all |
rescale.residual |
rescale the residual matrix as z-scores |
vector of p-values for the "adjusted" regression coefficients from the Reference-free EWAS model
Requires the package RefFreeEWAS.
Pavlo Lutsik
1. Houseman, E. Andres, John Molitor, and Carmen J. Marsit. "Reference-Free Cell Mixture Adjustments in Analysis of DNA Methylation Data." Bioinformatics (2014): btu029.
get the mapping of regions in the RnBSet object to methylation site indices in the RnBSet object
## S4 method for signature 'RnBSet' regionMapping(object, region.type)
## S4 method for signature 'RnBSet' regionMapping(object, region.type)
object |
Dataset as an object of type inheriting |
region.type |
region type. see |
A list containing for each region the indices (as integers) of sites that belong to that region
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) promoter.probe.list <- regionMapping(rnb.set.example,"promoters") #get the number of CpGs per promoter in the dataset: sapply(promoter.probe.list,length)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) promoter.probe.list <- regionMapping(rnb.set.example,"promoters") #get the number of CpGs per promoter in the dataset: sapply(promoter.probe.list,length)
Methylation regions, information for which is present in the RnBSet
object.
## S4 method for signature 'RnBSet' regions(object, type = NULL)
## S4 method for signature 'RnBSet' regions(object, type = NULL)
object |
Dataset of interest. |
type |
Region type(s) of interest as a |
Methylation site and region assignment. If type
is singleton, a matrix
is returned. The first
column corresponds to the methylation context index. The second column is the index of the chromosome in
the genome, and the third is the index of the region in the GRanges
object of the region type
annotation. When length(type)>1
, a list of such matrices is returned for each element of type
.
If type
is NULL
, matrices for all summarized region types are returned.
Methylation context index is an integer number denoting the sequence context of the cytosine of interest. Index
1
corresponds to CpG
, the only supported index in bisulfite sequencing datasets.
Pavlo Lutsik
summarized.regions
for all summarized region types in a dataset;
rnb.get.chromosomes
listing all supported chromosomes for a given genome assembly
library(RnBeads.hg19) data(small.example.object) head(regions(rnb.set.example))
library(RnBeads.hg19) data(small.example.object) head(regions(rnb.set.example))
reload disk dumped tables. Useful if the table files are manually copied or if the object is loaded again.
## S4 method for signature 'RnBDiffMeth' reload( object, save.file, disk.path = tempfile(pattern = "diffmeth_", tmpdir = getOption("fftempdir")) )
## S4 method for signature 'RnBDiffMeth' reload( object, save.file, disk.path = tempfile(pattern = "diffmeth_", tmpdir = getOption("fftempdir")) )
object |
|
save.file |
location of the ff data saved to disk (i.e. save in save.RData and save.ffData) |
disk.path |
path on the disk for DMTs. can be new or be the same as in the original object |
the updated RnBDiffMeth object
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) #compute differential methylation pcols <- c("Sample_Group","Treatment") tdir <- tempfile(pattern="working") dm <- rnb.execute.computeDiffMeth(rnb.set.example,pcols,disk.dump=TRUE,disk.dump.dir=tdir) #get temporary file names fn.save.tabs <- tempfile(pattern="saveTables") fn.save.obj <- tempfile(pattern="saveObject") #save the object and the tables to disk save(dm,file=fn.save.obj) save.tables(dm,fn.save.tabs) #delete the object from the workspace destroy(dm) rm(dm) #reload the object and tables load(fn.save.obj) dm.new <- reload(dm,fn.save.tabs)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) #compute differential methylation pcols <- c("Sample_Group","Treatment") tdir <- tempfile(pattern="working") dm <- rnb.execute.computeDiffMeth(rnb.set.example,pcols,disk.dump=TRUE,disk.dump.dir=tdir) #get temporary file names fn.save.tabs <- tempfile(pattern="saveTables") fn.save.obj <- tempfile(pattern="saveObject") #save the object and the tables to disk save(dm,file=fn.save.obj) save.tables(dm,fn.save.tabs) #delete the object from the workspace destroy(dm) rm(dm) #reload the object and tables load(fn.save.obj) dm.new <- reload(dm,fn.save.tabs)
Remove the summarized methylation information for a given region type from an RnBSet
object.
## S4 method for signature 'RnBSet' remove.regions(object, region.type)
## S4 method for signature 'RnBSet' remove.regions(object, region.type)
object |
Dataset of interest. |
region.type |
Type of the region annotation for which the summarization should be removed |
object of the same class as the supplied one without the summarized methylation information for the specified region type
library(RnBeads.hg19) data(small.example.object) summarized.regions(rnb.set.example) rnb.set.reduced<-remove.regions(rnb.set.example, "genes") summarized.regions(rnb.set.reduced)
library(RnBeads.hg19) data(small.example.object) summarized.regions(rnb.set.example) rnb.set.reduced<-remove.regions(rnb.set.example, "genes") summarized.regions(rnb.set.reduced)
Removes the specified samples from the dataset.
## S4 method for signature 'RnBSet' remove.samples(object, samplelist) ## S4 method for signature 'RnBeadSet' remove.samples(object, samplelist) ## S4 method for signature 'RnBeadRawSet' remove.samples(object, samplelist)
## S4 method for signature 'RnBSet' remove.samples(object, samplelist) ## S4 method for signature 'RnBeadSet' remove.samples(object, samplelist) ## S4 method for signature 'RnBeadRawSet' remove.samples(object, samplelist)
object |
Dataset of interest. |
samplelist |
List of samples to be removed in the form of a |
The modified dataset.
remove.sites
for removing sites or probes from a methylation dataset
library(RnBeads.hg19) data(small.example.object) samples(rnb.set.example) ## remove 3 random samples s2r<-sample.int(length(samples(rnb.set.example)), 3) rnb.set.f<-remove.samples(rnb.set.example, s2r) samples(rnb.set.f)
library(RnBeads.hg19) data(small.example.object) samples(rnb.set.example) ## remove 3 random samples s2r<-sample.int(length(samples(rnb.set.example)), 3) rnb.set.f<-remove.samples(rnb.set.example, s2r) samples(rnb.set.f)
Removes the specified probes from the dataset.
## S4 method for signature 'RnBSet' remove.sites(object, probelist, verbose = FALSE) ## S4 method for signature 'RnBeadSet' remove.sites(object, probelist, verbose = TRUE) ## S4 method for signature 'RnBeadRawSet' remove.sites(object, probelist, verbose = TRUE)
## S4 method for signature 'RnBSet' remove.sites(object, probelist, verbose = FALSE) ## S4 method for signature 'RnBeadSet' remove.sites(object, probelist, verbose = TRUE) ## S4 method for signature 'RnBeadRawSet' remove.sites(object, probelist, verbose = TRUE)
object |
Dataset of interest. |
probelist |
List of probes to be removed in the form of a |
verbose |
if |
The modified dataset.
remove.samples
for removing samples from a methylation dataset
library(RnBeads.hg19) data(small.example.object) print(rnb.set.example) ## remove 100 random sites s2r<-sample.int(nrow(sites(rnb.set.example)), 100) rnb.set.f<-remove.sites(rnb.set.example, s2r) print(rnb.set.f)
library(RnBeads.hg19) data(small.example.object) print(rnb.set.example) ## remove 100 random sites s2r<-sample.int(nrow(sites(rnb.set.example)), 100) rnb.set.f<-remove.sites(rnb.set.example, s2r) print(rnb.set.f)
Handler of a generated HTML report. Reports are initialized using the function createReport
.
fname
Name of the file that contains the HTML report.
dir.conf
Directory that contains configuration files; usually shared between reports.
dir.data
Directory that contains the generated external lists and tables.
dir.pngs
Directory that contains the generated figure image files.
dir.pdfs
Directory that contains the generated figure PDF files.
dir.high
Directory that contains the generated high-resolution image file.
sections
Number of sections and subsections currently added to the report.
opensections
Indices of currently active section and subsections.
figures
Number of figures currently added to the report.
tables
Number of selectable tables added to the report.
references
List of references to be added at the end of the report.
rnb.get.directory
Gets the location of a given report-specific directory.
rnb.add.section
Generates HTML code for a new section in the report.
rnb.add.paragraph
Generates HTML code for a new paragraph in the report.
rnb.add.list
Generates HTML code for a list in the report.
rnb.add.table
Generates HTML code for a table in the report.
rnb.add.tables
Generates HTML code for a listing of tables in the report.
rnb.add.figure
Generates HTML code for a figure in the report.
rnb.add.reference
Adds a reference item to the report.
off
Completes the HTML report by adding a reference section (if needed),
a footer notice and closing the <body>
and <html>
tags.
Yassen Assenov
Information about the files created to store one generated plot in a report. Report plots are initialized using the
function createReportGgPlot
. It inherits from the ReportPlot
class and handling is
analogous, except that it contains an additional slot to store a ggplot
object.
ggp
ggplot
object to be printed
No device is being opened until off(reportGgPlot)
is called.
Fabian Mueller
Information about the files created to store one generated plot in a report. Report plots are initialized using the
function createReportPlot
.
fname
Relative file name. It does not include path or extension.
width
Width of the image in inches.
height
Height of the image in inches.
create.pdf
Flag indicating if a PDF image is created.
low.png
Resolution, in dots per inch, used for the figure image.
high.png
Resolution, in dots per inch, used for the high-resolution image.
dir.pdf
Directory that contains the generated PDF file.
dir.png.low
Directory that contains the generated figure image file.
dir.png.high
Directory that contains the generated high-resolution image file.
get.files
Gets the list of all files that are planned to be generated, or were already generated by the report plot.
off
Copies the figure to a PNG file (if needed) and closes the device associated with the report plot.
Yassen Assenov
Generates HTML code for a figure in the specified report. A figure is a collection of images (plots), of which only one is visible at any given moment.
rnb.add.figure( report, description, report.plots, setting.names = list(), selected.image = as.integer(1) )
rnb.add.figure( report, description, report.plots, setting.names = list(), selected.image = as.integer(1) )
report |
Report to write the text to. |
description |
Human-readable description of the figure. This must be a non-empty |
report.plots |
Object of type |
setting.names |
List of plot file element descriptors. Every variable elements in the plot file names must be included in this list. Set this to empty list if no variable elements are present, that is, if the figure should present a single report plot. |
selected.image |
Index of plot to be initially selected in the figure. |
The modified report.
Yassen Assenov
rnb.add.tables
for adding a listing of tables; Report
for other functions
adding contents to an HTML report
Generates HTML code for a list in the specified report.
rnb.add.list(report, txt, type = "u")
rnb.add.list(report, txt, type = "u")
report |
Report to write the text to. |
txt |
Non-empty list of items to be written. An attribute named |
type |
List type to be used for the list and/or its sublists in case the attribute |
There are two ways to specify a list type: (1) setting a value for the attribute type
of the list, or
(2) using the function's parameter type
. The value of the function's parameter is used only for lists
and sublists that do not contain an attribute named type
. The following types are supported:
"o"
Ordered list using arabic numbers - 1
, 2
, 3
, etc.
"u"
Unordered list using bullet points.
Note that every list type must be a one-element character
vector containing one of the codes listed
above. Specifying any other value for list type results in an error.
The modified report, invisibly.
Yassen Assenov
Report
for other functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) recipe <- list("Sift flour in a bowl", "Add sugar and mix", "Add milk and mix") rnb.add.list(report, recipe, type="o")
report <- createReport("example.html", "Example", init.configuration = TRUE) recipe <- list("Sift flour in a bowl", "Add sugar and mix", "Add milk and mix") rnb.add.list(report, recipe, type="o")
Generates HTML code for a new paragraph in the specified report.
rnb.add.paragraph(report, txt, paragraph.class = NULL)
rnb.add.paragraph(report, txt, paragraph.class = NULL)
report |
Report to write the text to. |
txt |
|
paragraph.class |
CSS class definition of the paragraph. This must be either
|
The modified report, invisibly.
Yassen Assenov
Report
for other functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) txt <- "A pessimist is a person who has had to listen to too many optimists." txt <- c(txt, " <i>Don Marquis</i>") rnb.add.paragraph(report, txt)
report <- createReport("example.html", "Example", init.configuration = TRUE) txt <- "A pessimist is a person who has had to listen to too many optimists." txt <- c(txt, " <i>Don Marquis</i>") rnb.add.paragraph(report, txt)
Adds a reference item to the given report.
rnb.add.reference(report, txt)
rnb.add.reference(report, txt)
report |
Report to add a reference item to. |
txt |
Text of the reference in the form of a non-empty |
The modified report.
Yassen Assenov
rnb.get.reference
for adding citations in the report's text; Report
for
other functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) txt.reference <- c("Bird A. ", "<i>Nucleic Acids Res.</i> <b>8</b> (1980)") report <- rnb.add.reference(report, txt.reference) txt <- c("This was shown in ", rnb.get.reference(report, txt.reference), ".") rnb.add.paragraph(report, txt)
report <- createReport("example.html", "Example", init.configuration = TRUE) txt.reference <- c("Bird A. ", "<i>Nucleic Acids Res.</i> <b>8</b> (1980)") report <- rnb.add.reference(report, txt.reference) txt <- c("This was shown in ", rnb.get.reference(report, txt.reference), ".") rnb.add.paragraph(report, txt)
Generates HTML code for a new section in the specified report.
rnb.add.section(report, title, description, level = 1L, collapsed = FALSE)
rnb.add.section(report, title, description, level = 1L, collapsed = FALSE)
report |
Report to write the text to. |
title |
Section header. This must be a single-element |
description |
Human-readable paragraph text of the section in the form of a |
level |
Section level as a single |
collapsed |
Flag indicating if the contents of this section is to be initially collapsed. Possible values are
|
The modified report.
Yassen Assenov
Report
for other functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) report <- rnb.add.section(report, "Introduction", "This is how it's done.")
report <- createReport("example.html", "Example", init.configuration = TRUE) report <- rnb.add.section(report, "Introduction", "This is how it's done.")
Generates HTML code for a table in the specified report.
rnb.add.table( report, tdata, row.names = TRUE, first.col.header = FALSE, indent = 0, tag.attrs = c(class = "tabdata"), thead = NULL, tcaption = NULL, na = "<span class=\"disabled\">n/a</span>" )
rnb.add.table( report, tdata, row.names = TRUE, first.col.header = FALSE, indent = 0, tag.attrs = c(class = "tabdata"), thead = NULL, tcaption = NULL, na = "<span class=\"disabled\">n/a</span>" )
report |
Report to write the text to. |
tdata |
Matrix or data frame to be presented in HTML form. Column names, if present, are used to define table columns. If this table contains 0 (zero) rows or 0 columns, calling this function has no effect. |
row.names |
Flag indicating if row names should also be printed. If this parameter is |
first.col.header |
Flag indicating if all cells in the first column must be displayed as header cells. Note
that, if both this parameter and |
indent |
Default indentation, in number of tabulation characters, to apply to HTML tags. This
indentation is also applied to |
tag.attrs |
Named |
thead |
|
tcaption |
Text to include as a caption below the table, or |
na |
|
The modified report, invisibly.
Yassen Assenov
rnb.add.tables
for adding a listing of tables; Report
for other functions
adding contents to an HTML report
Generates HTML code for a listing of tables (of which only one is visible at any moment) in the specified report.
rnb.add.tables( report, tables, setting.names, selected.table = 1L, indent = 2L, ... )
rnb.add.tables( report, tables, setting.names, selected.table = 1L, indent = 2L, ... )
report |
Report to write the text to. |
tables |
Non-empty |
setting.names |
List of table name element descriptors. Every variable elements in the table names must be included in this list. |
selected.table |
Index of the table to be initially selected in this listing. |
indent |
Default indentation, in number of tabulation characters, to apply to every table. |
... |
Other parameters passed to |
The modified report.
Yassen Assenov
rnb.add.table
for adding a single table to a report; Report
for other
functions adding contents to an HTML report
Gets the size, in number of genomic elements, of the specified annotation.
rnb.annotation.size(type = "CpG", assembly = "hg19")
rnb.annotation.size(type = "CpG", assembly = "hg19")
type |
Name of annotation. Control probe annotations are not accepted. |
assembly |
Genome assembly of interest. See |
integer
vector showing the number of elements the specified annotation contains per chromosome. The
names of the vector are the names of rnb.get.chromosomes
for the given genome assembly.
Chromosomes that are not covered by the annotation have their respective value set to 0
(zero).
Yassen Assenov
rnb.region.types
for a list of supported region annotations
library(RnBeads.hg19) rnb.annotation.size("probes450")
library(RnBeads.hg19) rnb.annotation.size("probes450")
Transform the specified site, probe or region annotation to data.frame
.
rnb.annotation2data.frame(annotation.table, add.names = TRUE)
rnb.annotation2data.frame(annotation.table, add.names = TRUE)
annotation.table |
Annotation in the form of non-empty |
add.names |
Flag indicating if element names should be extracted and returned also as a column named
|
Annotation in the form of a single data.frame
. The columns in this table include, among other,
"Chromosome"
, "Start"
and "End"
.
Yassen Assenov
library(RnBeads.hg19) head(rnb.annotation2data.frame(rnb.get.annotation("probes450")))
library(RnBeads.hg19) head(rnb.annotation2data.frame(rnb.get.annotation("probes450")))
This function creates a BED file from the segmentation result of rnb.execute.segmentation
and stores it on disk.
rnb.bed.from.segmentation( rnb.set, sample.name, type = "final", store.path = getwd() )
rnb.bed.from.segmentation( rnb.set, sample.name, type = "final", store.path = getwd() )
rnb.set |
An |
sample.name |
The sample name for which segmentation was computed. |
type |
The type of segmentation ( |
store.path |
Path to which the BED file is to be stored. |
Michael Scherer
Transforms beta values to M values, adjusting for +infinity and -infinity.
rnb.beta2mval(betas, epsilon = 1e-05)
rnb.beta2mval(betas, epsilon = 1e-05)
betas |
|
epsilon |
Single |
The calculated and adjusted M values.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) mvals <- rnb.beta2mval(meth(rnb.set.example)) summary(mvals)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) mvals <- rnb.beta2mval(meth(rnb.set.example)) summary(mvals)
This function creates a boxplot from the segmentation result of rnb.execute.segmentation
.
rnb.boxplot.from.segmentation(rnb.set, sample.name, type = "final")
rnb.boxplot.from.segmentation(rnb.set, sample.name, type = "final")
rnb.set |
An |
sample.name |
The sample name for which segmentation was computed. |
type |
The type of segmentation ( |
An object of type ggplot
visualizing the methylation values in the segments.
Michael Scherer
Creates an HTML index file that contains listing of all available RnBeads reports. If no known reports are found in the specified directory, no index is created.
rnb.build.index( dir.reports, fname = "index.html", dir.configuration = "configuration", open.index = TRUE )
rnb.build.index( dir.reports, fname = "index.html", dir.configuration = "configuration", open.index = TRUE )
dir.reports |
Directory that contains HTML reports generated by RnBeads modules. If this directory does not exist, is a regular file, is inaccessible, or does not contain any recognizable HTML report files, this function does not generate an HTML index file and produces an error or a warning message. |
fname |
One-element |
dir.configuration |
Subdirectory that hosts configuration files shared by the reports. This must be a
|
open.index |
Flag indicating if the index should be displayed after it is created. If this is
|
In order to ensure independence of the operating system, there are strong restrictions on the name of the index file.
It can consist of the following symbols only: Latin letters, digits, dot (.
), dash (-
) and underline
(_
). The extension of the file must be one of htm
, html
, xhtml
or xml
. The name
must not include paths, that is, slash (/
) or backslash (\
) cannot be used. In addition, it cannot be
any of the recognized RnBeads report file names.
Names of all HTML report files that were referenced in the newly generated index, invisibly. The order of the
file names is the same as the one they are listed in the index. If no known reports are found in the given
directory, the returned value is an empty character
vector.
Yassen Assenov
rnb.run.analysis
, rnb.initialize.reports
calls the destructor of an RnBSet, RnBeadSet or RnBeadRawSet object
conditionally on whether the enforce.destroy.disk.dumps
option is enabled.
rnb.call.destructor(object, ...)
rnb.call.destructor(object, ...)
object |
object to be destroyed |
... |
further arguments to the method |
invisible TRUE
Fabian Mueller
Creates a figure in the given report that contains one or more color legends.
rnb.color.legends( report, legends, fprefix = ifelse(is.character(legends), "legend", "legend_"), description = "Color legend.", setting.names = NULL, size.factor = 3 )
rnb.color.legends( report, legends, fprefix = ifelse(is.character(legends), "legend", "legend_"), description = "Color legend.", setting.names = NULL, size.factor = 3 )
report |
Report to contain the legend figure. This must be an object of type |
legends |
Color legend in the form of a non-empty |
fprefix |
File name or prefix for the plot files. |
description |
Text of the figure description. See the correponding parameter in
|
setting.names |
One-element list containing a plot file descriptor, when |
size.factor |
Relative size, in inches of the plots. Legends are displayed in columns of up to 10 items; each column is effectively a square with the specified size. |
In case legends
specifies multiple legends in the form of a list, names(legends)
are appended
to fprefix
to generate file names. In order to ensure independence of the operating system, there are
strong restrictions on these names. They can consist of the following symbols only: Latin letters, digits,
dot (.
), dash (-
) and underline (_
).
The modified report.
Yassen Assenov
Concatenates two array-based datasets focusing on the common probes.
rnb.combine.arrays(dataset1, dataset2, type = "common")
rnb.combine.arrays(dataset1, dataset2, type = "common")
dataset1 |
First input dataset as an object of type inheriting |
dataset2 |
Second input dataset as an object of type inheriting |
type |
Type of the combine operation as a character singleton, one of "common", "all.x", "all.y" and "all". |
This method expects that the sample annotation tables of the two datasets have identical structures.
This method expects that the two datasets target the same genome assembly.
The platform of the combined dataset is the most recent among the platforms of the input datasets.
The combined dataset is of type RnBeadRawSet
only when both input
datasets are of this type. Otherwise, any intensity value data is ignored.
Only the common probes are included in the resulting dataset.
Regions summarized in any of the input datasets are ignored. In the resulting dataset, regions are
summarized as specified in the analysis option "region.types"
.
QC data in the input datasets is ignored. The combined dataset includes no data on QC probe intensities.
Inferred covariates in the input datasets are ignored. The combined dataset includes no data on inferred covariates.
The combined dataset stores big tables on disk when the analysis option
"disk.dump.big.matrices"
is enabled.
Combined dataset as an object of type inheriting RnBeadSet
.
Yassen Assenov
Initial implementation of the combine method for sequencing datasets.
rnb.combine.seq(x, y, type = "common")
rnb.combine.seq(x, y, type = "common")
x |
An object of type |
y |
Another object of type |
type |
A character representing the type of combination. Needs to be one of |
The type parameters determines the mode of combination:
"common"
The intersection between the sites present in the two
datasets is used for the new dataset.
"all.x"
All sites present in x are used.
"all.y"
All sites present in y are used.
"all"
The union between the sites of both datasets is used.
An RnBiseqSet-class
object with combined information
Performs age prediction by either the specified predictor in the option inference.age.prediction.predictor
or by the corresponding predefined predictor.
rnb.execute.age.prediction(object)
rnb.execute.age.prediction(object)
object |
a |
modified RnBSet
object
Michael Scherer
Computation of correlations and permutation-based p-values for detecting quality-associated batch effects.
rnb.execute.batch.qc(rnb.set, pcoordinates, permutations = NULL)
rnb.execute.batch.qc(rnb.set, pcoordinates, permutations = NULL)
rnb.set |
HumanMethylation450K dataset as an object of type |
pcoordinates |
Coordinates of the samples of |
permutations |
Matrix of sample index permutations, as returned by |
NULL
if no principal components for batch analysis are specified (
rnb.getOption("exploratory.principal.components") == 0
); otherwise, a hierarchical structure of
matrices in the form of a nested list. The root branches are represented by the elements
"correlations"
and "pvalues"
. Every element is a list of control probe types; each type is in
turn a list of up to two matrices of correlations between probe values and principal components - one for the
probes on the green channel and one for the red channel. Note that the "pvalues"
branch is not
returned when permutations
is NULL
.
Pavlo Lutsik
Performs tests for association between traits and principal components.
rnb.execute.batcheffects(rnb.set, pcoordinates = NULL)
rnb.execute.batcheffects(rnb.set, pcoordinates = NULL)
rnb.set |
Methylation dataset as an object of type inheriting |
pcoordinates |
Coordinates of the samples of |
Results of attempted tests for associations in the form of a list with up to three elements:
"permutations"
integer
matrix of index permutations. The number of rows in the matrix
is N - the number of samples in rnb.set
. Every column in this matrix denotes a sample
permutation; the first column is the sequence 1 to N. This element is included only when
rnb.getOption("exploratory.correlation.permutations")
is non-zero and there are numeric traits
to be tested.
"pc"
List of four matrices named "failures"
, "tests"
, "correlations"
and "pvalues"
. The rows in each of these matrices correspond to the first several principal
components, and the columns - to selected traits. This element is not included in the returned list
when pcoordinates
is NULL
.
"traits"
List of four square symmetric matrices named "failures"
, "tests"
,
"correlations"
and "pvalues"
, containing information about the performed tests for
pairwise trait association. This element is included only if two or more traits were tested.
Yassen Assenov
rnb.run.exploratory
for running the whole exploratory analysis module
library(RnBeads.hg19) data(small.example.object) regs <- c("sites", summarized.regions(rnb.set.example)) dreduction <- function(x) rnb.execute.dreduction(rnb.set.example, x) pcoordinates <- lapply(regs, dreduction) names(pcoordinates) <- regs result <- rnb.execute.batcheffects(rnb.set.example, pcoordinates)
library(RnBeads.hg19) data(small.example.object) regs <- c("sites", summarized.regions(rnb.set.example)) dreduction <- function(x) rnb.execute.dreduction(rnb.set.example, x) pcoordinates <- lapply(regs, dreduction) names(pcoordinates) <- regs result <- rnb.execute.batcheffects(rnb.set.example, pcoordinates)
Performs hierarchical clustering on the samples of the given dataset using multiple distance metrics and agglomeration methods for a single given region type.
rnb.execute.clustering(rnb.set, region.type = "sites")
rnb.execute.clustering(rnb.set, region.type = "sites")
rnb.set |
Methylation dataset as an object of type inheriting |
region.type |
the clustering is performed on methylation levels from regions of that type.
see |
List of clustering results, whereby each element is an object of type RnBeadClustering
.
In case clustering cannot be performed, the return value is NULL
. Reasons for a failure include, among
others, the case when rnb.set
contains less than 3 samples, or undefined distances between a pair of
samples due to (too many) missing values in the respective methylation matrix.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) results <- rnb.execute.clustering(rnb.set.example, "promoters") # List applied dissimilarity metrics sapply(results, slot, "dissimilarity") # List applied clustering algorithms str(lapply(results, slot, "algorithm"))
library(RnBeads.hg19) data(small.example.object) results <- rnb.execute.clustering(rnb.set.example, "promoters") # List applied dissimilarity metrics sapply(results, slot, "dissimilarity") # List applied clustering algorithms str(lapply(results, slot, "algorithm"))
Performs hierarchical clustering on the samples of the given dataset using multiple distance metrics and agglomeration methods for all suggested site and region types.
rnb.execute.clustering.all(rnb.set)
rnb.execute.clustering.all(rnb.set)
rnb.set |
Methylation dataset as an object of type inheriting |
List of list of clustering results; each element corresponds to one region type and is a list of objects
of type RnBeadClustering
.
Fabian Mueller
rnb.execute.clustering
for performing clustering using a single site or region type.
computes differential methylation
rnb.execute.computeDiffMeth( x, pheno.cols, region.types = rnb.region.types.for.analysis(x), covg.thres = rnb.getOption("filtering.coverage.threshold"), pheno.cols.all.pairwise = rnb.getOption("differential.comparison.columns.all.pairwise"), columns.pairs = rnb.getOption("columns.pairing"), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.sva = rnb.getOption("differential.adjustment.sva"), pheno.cols.adjust.sva = rnb.getOption("inference.targets.sva"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), skip.sites = !rnb.getOption("analyze.sites"), disk.dump = rnb.getOption("disk.dump.big.matrices"), disk.dump.dir = tempfile(pattern = "diffMethTables_"), ... )
rnb.execute.computeDiffMeth( x, pheno.cols, region.types = rnb.region.types.for.analysis(x), covg.thres = rnb.getOption("filtering.coverage.threshold"), pheno.cols.all.pairwise = rnb.getOption("differential.comparison.columns.all.pairwise"), columns.pairs = rnb.getOption("columns.pairing"), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.sva = rnb.getOption("differential.adjustment.sva"), pheno.cols.adjust.sva = rnb.getOption("inference.targets.sva"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), skip.sites = !rnb.getOption("analyze.sites"), disk.dump = rnb.getOption("disk.dump.big.matrices"), disk.dump.dir = tempfile(pattern = "diffMethTables_"), ... )
x |
RnBSet object |
pheno.cols |
column names of the pheno slot in |
region.types |
which region types should be processed for differential methylation |
covg.thres |
coverage threshold for computing the summary statistics. See |
pheno.cols.all.pairwise |
integer or character vector specifying the colomns of |
columns.pairs |
argument passed on to |
columns.adj |
Column names or indices in the table of phenotypic information to be used for confounder adjustment in the differential methylation analysis. |
adjust.sva |
flag indicating whether the adjustment table should also contain surrogate variables (SVs) for the given target variable. |
pheno.cols.adjust.sva |
Column names or indices in the table of phenotypic information to be used for SVA adjustment in the differential methylation analysis. |
adjust.celltype |
flag indicating whether the resulting table should also contain estimated celltype contributions.
See |
skip.sites |
flag indicating whether differential methylation in regions should be computed directly and not from sites. This leads to skipping of site-specific differential methylation |
disk.dump |
Flag indicating whether the resulting differential methylation object should be file backed, ie.e the matrices dumped to disk |
disk.dump.dir |
disk location for file backing of the resulting differential methylation object. Only meaningful if |
... |
arguments passed on to binary differential methylation calling. See |
an RnBDiffMeth
object. See class description for details.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparisons(dm)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) dm <- rnb.execute.computeDiffMeth(rnb.set.example,pheno.cols=c("Sample_Group","Treatment")) get.comparisons(dm)
Removes all probes that belong to specific context from the given dataset.
rnb.execute.context.removal( rnb.set, contexts = rnb.getOption("filtering.context.removal") )
rnb.execute.context.removal( rnb.set, contexts = rnb.getOption("filtering.context.removal") )
rnb.set |
Methylation dataset as an object of type |
contexts |
Probe contexts to be filtered out. |
List of three or four elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly modified) RnBeadSet
object after performing the missing
value removal.
"filtered"
integer
vector storing the indices of all removed probes in
dataset.before
.
"contexts"
The value of the parameter contexts
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) contexts.to.ignore <- c("CC", "CAG", "CAH") rnb.set.filtered <- rnb.execute.context.removal(rnb.set.example, contexts.to.ignore)$dataset identical(rnb.set.example, rnb.set.filtered) # FALSE
library(RnBeads.hg19) data(small.example.object) contexts.to.ignore <- c("CC", "CAG", "CAH") rnb.set.filtered <- rnb.execute.context.removal(rnb.set.example, contexts.to.ignore)$dataset identical(rnb.set.example, rnb.set.filtered) # FALSE
Removes all probes defined as cross-reactive from the given dataset.
rnb.execute.cross.reactive.removal(rnb.set)
rnb.execute.cross.reactive.removal(rnb.set)
rnb.set |
Methylation dataset as an object of type inheriting |
list
of four elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly) modified dataset object after removing probes that have a high likelihood of cross-hybridization.
"filtered"
integer
vector storing the indices (in beta matrix of the unfiltered
dataset) of all removed probes.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.cross.reactive.removal(rnb.set.example)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.cross.reactive.removal(rnb.set.example)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
Perform the estimation of the cell type contributions in each analyzed sample.
rnb.execute.ct.estimation( rnb.set, cell.type.column = NA, test.max.markers = NA, top.markers = 500, method = "houseman1", verbose = TRUE )
rnb.execute.ct.estimation( rnb.set, cell.type.column = NA, test.max.markers = NA, top.markers = 500, method = "houseman1", verbose = TRUE )
rnb.set |
object of class |
cell.type.column |
integer index or character identifier of a column in sample annotation table of |
test.max.markers |
Maximal amount of CpG positions to use for marker selection. If this option is set to
|
top.markers |
the number of markers to select |
method |
algorithm used for estmation of the cell type contributions |
verbose |
flag specifying whether diagnostic output should be written to the console or to the RnBeads logger in case the latter is initialized |
The only supported method is the one from Houseman et al BMC Bioinformatics 2012
object of class CellTypeInferenceResult
Pavlo Lutsik
This routine computes sites that are differentially variable between two sample groups specified as the column name in the phenotypic table.
rnb.execute.diffVar( rnb.set, pheno.cols = rnb.getOption("differential.comparison.columns"), region.types = rnb.region.types.for.analysis(rnb.set), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), disk.dump = rnb.getOption("disk.dump.big.matrices"), disk.dump.dir = tempfile(pattern = "diffMethTables_") )
rnb.execute.diffVar( rnb.set, pheno.cols = rnb.getOption("differential.comparison.columns"), region.types = rnb.region.types.for.analysis(rnb.set), columns.adj = rnb.getOption("covariate.adjustment.columns"), adjust.celltype = rnb.getOption("differential.adjustment.celltype"), disk.dump = rnb.getOption("disk.dump.big.matrices"), disk.dump.dir = tempfile(pattern = "diffMethTables_") )
rnb.set |
Object of type |
pheno.cols |
Column names used to define the classes, whose methylation variability should be compared with each other |
region.types |
Regions types to be used for the analysis. Defaults to the results given by rnb.region.types.for.analysis of the given RnBSet. |
columns.adj |
Column names or indices in the table of phenotypic information to be used for confounder adjustment in the differential variability analysis. |
adjust.celltype |
Flag indicating whether the resulting table should also contain estimated celltype contributions. See |
disk.dump |
Flag indicating whether the resulting differential methylation object should be file backed, ie.e the matrices dumped to disk |
disk.dump.dir |
disk location for file backing of the resulting differential methylation object. Only meaningful if |
Object of type RnBDiffMeth
containing information about the differential variability analysis.
Michael Scherer
Performs principal component analysis (PCA) and multi-dimensional scaling (MDS) of the samples in the given methylation dataset.
rnb.execute.dreduction(rnb.set, target = "sites")
rnb.execute.dreduction(rnb.set, target = "sites")
rnb.set |
Methylation dataset as an object of type inheriting |
target |
|
Row names in the returned matrices are sample identifiers, determined based on the package option
"identifiers.column"
. See RnBeads Options for more information on this option.
Results of the dimension reduction in the form of a list with the following elements:
pca
Results of the PCA as returned by the function prcomp
.
mds
List of two elements - "manhattan"
and "euclidean"
, each of which is a
two-column matrix
storing the coordinates of the samples in a two-dimensional space. The
matrices are computed using the function isoMDS
.
Yassen Assenov
rnb.run.exploratory
for running the whole exploratory analysis module
library(RnBeads.hg19) data(small.example.object) regs <- c("sites", summarized.regions(rnb.set.example)) dreduction <- function(x) rnb.execute.dreduction(rnb.set.example, x) pcoordinates <- lapply(regs, dreduction) names(pcoordinates) <- regs str(pcoordinates)
library(RnBeads.hg19) data(small.example.object) regs <- c("sites", summarized.regions(rnb.set.example)) dreduction <- function(x) rnb.execute.dreduction(rnb.set.example, x) pcoordinates <- lapply(regs, dreduction) names(pcoordinates) <- regs str(pcoordinates)
Exports (selected) methylation tables of the given dataset to comma-separated value files.
rnb.execute.export.csv( rnb.set, output.location, region.types = rnb.getOption("export.types") )
rnb.execute.export.csv( rnb.set, output.location, region.types = rnb.getOption("export.types") )
rnb.set |
Methylation dataset as an object of type inheriting |
output.location |
|
region.types |
|
The names of the generated output files are formed by the prefix "betas_"
, followed by a number between
1 and length(region.types)
. The extension is .csv
or .csv.gz
, depending on the value of the
RnBeads option "gz.large.files"
. Any such files that already exist in the output directory, are
overwritten.
There are several reasons why a certain output file cannot be (fully) generated. Examples for failures are listed below:
The corresponding region type is invalid.
The corresponding region type is not supported by the dataset. If the type is loaded in RnBeads,
use the summarize.regions
method prior to calling this function,
in order to include the support of this region type in the dataset.
Due to security restrictions, the creation of files in the output directory is not allowed.
A file or directory with the same name exists and cannot be overwritten.
The disk is full or the user quota is exceeded.
character
vector containing the names of the files to which data were exported; prepended by
output.location
. In case a certain region type could not be exported (see the Details section),
the corresponding element of this vector is NA
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.execute.export.csv(rnb.set.example, "", summarized.regions(rnb.set.example))
library(RnBeads.hg19) data(small.example.object) rnb.execute.export.csv(rnb.set.example, "", summarized.regions(rnb.set.example))
Calculates a table summarizing the effect of the applied filtering procedures.
rnb.execute.filter.summary(old.set, new.set)
rnb.execute.filter.summary(old.set, new.set)
old.set |
Methylation dataset before filtering as an object of type inheriting |
new.set |
Methylation dataset after filtering as an object of type inheriting |
This function expects that the sites and samples in new.set
are subsets of the sites and samples in
old.set
, respectively. If this is not the case, it exists with an error.
matrix
summarizing the number of removed and retained sites, samples, and (optionally) reliable and
unreliable measurements.
Yassen Assenov
rnb.run.preprocessing
for running the whole preprocessing module
Deprecated function name, now called rnb.execute.sex.prediction
.
rnb.execute.gender.prediction(rnb.set)
rnb.execute.gender.prediction(rnb.set)
rnb.set |
Methylation dataset after running the sex prediction step, as an object of type
|
The possibly modified dataset. If sex could be predicted, the sample annotation table is enriched with
rnb.execute.sex.prediction
Computes genome-wide methylation levels per sample.
rnb.execute.genomewide(dataset)
rnb.execute.genomewide(dataset)
dataset |
Methylation dataset to study, provided as an object of type inheriting |
vector
of values in the range [0, 1]
, storing the average beta values per sample.
Yassen Assenov
Executes the Greedycut procedure for probe and sample filtering based on the detection p-values, and calculates statistics on its iterations.
rnb.execute.greedycut( rnb.set, pval.threshold = rnb.getOption("filtering.greedycut.pvalue.threshold"), min.coverage = rnb.getOption("filtering.coverage.threshold"), rc.ties = rnb.getOption("filtering.greedycut.rc.ties") )
rnb.execute.greedycut( rnb.set, pval.threshold = rnb.getOption("filtering.greedycut.pvalue.threshold"), min.coverage = rnb.getOption("filtering.coverage.threshold"), rc.ties = rnb.getOption("filtering.greedycut.rc.ties") )
rnb.set |
HumanMethylation450K dataset as an object of type |
pval.threshold |
The P-value threshold. For further information, see the option |
min.coverage |
The coverage threshold. For further information, see the option |
rc.ties |
Flag indicating what the behaviour of the algorithm should be in case of ties between values of rows
(probes) and columns (samples). See the corresponding parameter in
|
NULL
if rnb.set
does not contain a matrix of detection p-values, or if all p-values denote
reliable measurements. Otherwise, a list of the following elements:
Table summarizing the iterations of the algorithm, as returned by
greedycut.filter.matrix
.
Additional statistics on all iterations, as returned by
greedycut.get.statistics
.
Number of Greedycut iterations + 1
applied to the dataset, that is,
a value of 1 indicates that the dataset was not modified.
Indices of all sites to be removed.
Indices of all samples to be removed.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) greedy.result <- rnb.execute.greedycut(rnb.set.example) # Number of applied iterations greedy.result$iteration
library(RnBeads.hg19) data(small.example.object) greedy.result <- rnb.execute.greedycut(rnb.set.example) # Number of applied iterations greedy.result$iteration
Removes methylation sites with a coverage larger than 100 times the 95-percentile of coverage in each sample.
rnb.execute.high.coverage.removal(rnb.set)
rnb.execute.high.coverage.removal(rnb.set)
rnb.set |
Methylation dataset as an object of type inheriting |
list
of two elements:
"dataset"
The (possibly) modified dataset after retaining sites on autosomes only.
"filtered"
integer
vector storing the indices of all removed sites.
Fabian Mueller
Replaces all low coverage sites by NA
.
rnb.execute.high.dpval.masking(rnb.set, dpval.threshold = 0.05)
rnb.execute.high.dpval.masking(rnb.set, dpval.threshold = 0.05)
rnb.set |
Methylation dataset as an object of type inheriting |
dpval.threshold |
Threshold for maximal acceptable detection p-value, given as a non-negative |
List of three elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly) modified dataset after retaining sites on autosomes only.
"mask"
A logical matrix of dimension meth(rnb.set,type="sites")
indicating which
methylation values have been masked
Fabian Mueller
Loads the data from the specified type and encapsulates it in either an RnBSet
-inheriting object
rnb.execute.import( data.source, data.type = rnb.getOption("import.default.data.type"), dry.run = FALSE, verbose = TRUE )
rnb.execute.import( data.source, data.type = rnb.getOption("import.default.data.type"), dry.run = FALSE, verbose = TRUE )
data.source |
non-empty |
data.type |
type of the input data; must be one of |
dry.run |
if |
verbose |
flag specifying whether diagnostic output should be written to the console or to the RnBeads logger in case the latter is initialized |
The interpretation of data.source
depends on the value of data.type
and is summarized in the
following table:
data.type |
Type of data.source |
Maximal length of data.source |
Interpretation |
"infinium.idat.dir" |
list or character |
2 |
(1) Directory containing IDAT files; (2) a sample annotation table as a data.frame or the name of the corresponding file |
"infinium.data.dir" |
character |
1 |
Directory containing data tables in plain text format. The directory should contain one file with Sample|sample token in the filename
for the table of sample annotations, and one file with a token beta in the filename, with beta-values. It may also contain tables with p-values
(token pval ) and bead counts (bead ). In the latter case beta-value, p-value and bead count tables should have matching columns and rows.
The beta-value, p-value and bead-count tables should contain row names, i.e. the first column should contain the Infinium CG identifiers and not have
a column header (for that the first row should have one entry less than all other rows). Sample annotation table should contain as many rows as there are
columns in other tables. The character used as value separator in the text tables can be set using the import.table.separator option
(see rnb.options for details). |
"infinium.data.files" |
character |
2..4 |
The character vector should contain at least full paths to the sample annotation file and beta-value table. Detection p-values and bead counts table
can be added as the third and the fourth elements. The table format requirements are the same as for "data.dir" above. |
"infinium.GS.report" |
character |
1 |
Genome Studio report file |
"infinium.GEO" |
character |
1 |
GEO identifier or downloaded series matrix file |
"bs.bed.dir" |
list or character |
1..3 |
(1) Directory with BED files each giving a DNA methylation profile of a sample; (2) a sample annotation table as a data.frame or the name of the corresponding file;
(3) number of the sample annotation sheet column containing the file names. One of the first two elements have to be present. In case only the directory is specified,
it should contain a sample annotation file with a token "sample" in the file name. In case only the sample sheet is specified, one column should be giving full absolute paths
of the BED-like files with sequencing information. If both elements (1) and (2) are specified, the files should reside in the directory, specified as element (1).
If the third element is absent, an attempt will be made to find the file name containing column automatically. For this reason the file names in the sample annotation sheet
should be given with extensions (".bed", ".cov" etc). |
"rnb.set" |
RnBSet |
1 |
object of class inheriting from RnBSet
|
Loaded data as an object of type RnBSet
(when the input data type is
"data.dir"
, "data.files"
or "GEO"
) or of type MethyLumiSet
(when
the data type is "idat.dir"
or "GS.report"
).
Pavlo Lutsik
read.data.dir
, read.idat.files
, read.GS.report
,
rnb.read.geo
, read.bed.files
#'
# Directory where your data is located data.dir <- "~/RnBeads/data/Ziller2011_PLoSGen_450K" idat.dir <- file.path(data.dir, "idat") sample.annotation <- file.path(data.dir, "sample_annotation.csv") data.source <- c(idat.dir, sample.annotation) rnb.set <- rnb.execute.import(data.source = data.source, data.type = "idat.dir")
# Directory where your data is located data.dir <- "~/RnBeads/data/Ziller2011_PLoSGen_450K" idat.dir <- file.path(data.dir, "idat") sample.annotation <- file.path(data.dir, "sample_annotation.csv") data.source <- c(idat.dir, sample.annotation) rnb.set <- rnb.execute.import(data.source = data.source, data.type = "idat.dir")
Removes missing methylation values in the methylation matrix of the given object
rnb.execute.imputation( rnb.set, method = rnb.getOption("imputation.method"), update.ff = TRUE, ... )
rnb.execute.imputation( rnb.set, method = rnb.getOption("imputation.method"), update.ff = TRUE, ... )
rnb.set |
Dataset object inheriting from |
method |
Imputation method to be used, must be one of |
update.ff |
flag indicating if the disk based matrices should be updated. Should be set to FALSE, if methylation matrix should only temporarly be changed. If this value is FALSE, the region level methylation values are not updated and only the site-wise matrix is changed temporarly. |
... |
Optional arguments passed to knn.imputation |
Imputes missing values by applying on the following methods:
missing values are inferred as the average methylation value from all other (non-mising) CpGs in this sample
missing values are inferred as the average methylation value from all other (non-mising) values at this CpG sites in all other samples
missing values are inferred by randomly selecting a (non-missing) methylation value from any other sample at this CpG site
missing values are inferred by k-nearest neighbors imputation (see impute)
missing values are inferred as the median methylation value from all other (non-mising) CpGs in this sample
missing values are inferred as the median methylation value from all other (non-mising) values at this CpG sites in all other samples
imputation should not be performed
The modified rnb.set object without missing methylation values.
Michael Scherer
Replaces all low coverage sites by NA
.
rnb.execute.low.coverage.masking( rnb.set, covg.threshold = rnb.getOption("filtering.coverage.threshold") )
rnb.execute.low.coverage.masking( rnb.set, covg.threshold = rnb.getOption("filtering.coverage.threshold") )
rnb.set |
Methylation dataset as an object of type inheriting |
covg.threshold |
Threshold for minimal acceptable coverage, given as a non-negative |
List of three elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly) modified dataset after retaining sites on autosomes only.
"mask"
A logical matrix of dimension meth(rnb.set,type="sites")
indicating which
methylation values have been masked
Fabian Mueller
Implementation of the LUMP (Leukocytes UnMethylation for Purity) algorithm for purity estimation on methylation datasets.
rnb.execute.lump(dataset)
rnb.execute.lump(dataset)
dataset |
Methylation dataset to study, provided as an object of type inheriting |
The LUMP algorithm is developed by Dvir Aran, Marina Sirota and Atul J. Buttea.
Purity esimates provided as a vector
of values in the range [0, 1]
. The attribute
"sites"
contains the number of sites used in estimating the immune cell proportions. In case the
dataset does not contain measurements for any of the sites on which LUMP focuses, the return values is
NULL
.
Yassen Assenov
Removes all probes with missing value (if such exists) from the given dataset.
rnb.execute.na.removal( rnb.set, threshold = rnb.getOption("filtering.missing.value.quantile") )
rnb.execute.na.removal( rnb.set, threshold = rnb.getOption("filtering.missing.value.quantile") )
rnb.set |
Methylation dataset as an object of type inheriting |
threshold |
Maximum quantile of |
List of four or five elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly modified) dataset after performing the missing value removal.
"filtered"
integer
vector storing the indices (in beta matrix of the unfiltered
dataset) of all removed sites.
"threshold"
Copy of threshold
.
"naCounts"
Vector storing the number of NAs per site
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.na.removal(rnb.set.example, 0)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # TRUE
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.na.removal(rnb.set.example, 0)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # TRUE
Performs normalization of the provided HumanMethylation450 data set.
rnb.execute.normalization( object, method = rnb.getOption("normalization.method"), bgcorr.method = rnb.getOption("normalization.background.method"), verbose = TRUE )
rnb.execute.normalization( object, method = rnb.getOption("normalization.method"), bgcorr.method = rnb.getOption("normalization.background.method"), verbose = TRUE )
object |
Methylation dataset as an object of type |
method |
Normalization method, must be one of |
bgcorr.method |
Character singleton specifying which background subtraction should be used. Only methods impemented
in the methylumi package are supported at the moment, namely |
verbose |
flag specifying whether diagnostic output should be written to the console or to the RnBeads logger in case the latter is initialized |
Normalized dataset as an object of type RnBeadSet
.
Pavlo Lutsik
1. Triche, Timothy J., Jr., Weisenberger, Daniel J., Van Den Berg, David, Laird, Peter W. and Siegmund, Kimberly D. (2013) Low-level processing of Illumina Infinium DNA Methylation BeadArrays. Nucleic Acids Research 41(7):e90-e90.
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.set.norm<-rnb.execute.normalization(rnb.set.example, method="illumina", bgcorr.method="none")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.set.norm<-rnb.execute.normalization(rnb.set.example, method="illumina", bgcorr.method="none")
Probe signal intensities are masked based on their out-of-band signal intensities to counter hybridization failure.
rnb.execute.pOOBAH( raw.set, anno.table = NULL, pval.thresh = 0.05, verbose = FALSE )
rnb.execute.pOOBAH( raw.set, anno.table = NULL, pval.thresh = 0.05, verbose = FALSE )
raw.set |
Methylation dataset as an instance of |
anno.table |
Annotation for |
pval.thresh |
Computed detection p-values above this threshold are masked. Default value is 0.05. |
verbose |
If set to true, a short information is printed on how many probes are masked by the method. |
rnb.execute.pOOBAH is used to apply the method pOOBAH (P-value with OOB probes for Array Hybridization),
which was conceived by Zhou, Triche, Laird and Shen to mask probes associated with hybridization failures.
pOOBAH has been implemented in the R-package "sesame", a dependency needed for this function (see Zhou et al, 2018 and the respective Bioconductor/github pages).
pOOBAH computes the detection p-values by constructing 2 empirical cumulative density functions (eCDFs) based
on the out-of-band signal intensities of the red and the green channel, respectively, to detect hybridization failures.
The (in-band) green and red channel signal intensities of the probes are passed to the eCDFs and the probes with a
p-value higher than the given threshold (pval.thresh
) are masked, as they are considered background.
pOOBAH is applied separately to each sample.
Hybridization failures might occur due to somatic or germline deletions.
In addition, unreliable low-intensity probes might also be masked.
Returns a modified RnBeadRawSet
, in which signal intensities are masked, if their computed p-value
was greater than pval.thresh
. Note, in datasets with several samples, signal intensities of a specific probe
might be masked in sample A, but not in sample B, as pOOBAH is applied separately to each sample.
For example: the signal intensities of probe cg24488772 might be masked in sample 1, but not in sample 12.
pOOBAH method: Wanding Zhou. Adapted by Nathan Steenbuck.
library(RnBeads.hg19) data(small.example.object)
library(RnBeads.hg19) data(small.example.object)
Performs quality control calculations on the loaded DNA methylation data set.
rnb.execute.quality( object, type = "sites", qc.coverage.plots = rnb.getOption("qc.coverage.plots"), verbose = TRUE )
rnb.execute.quality( object, type = "sites", qc.coverage.plots = rnb.getOption("qc.coverage.plots"), verbose = TRUE )
object |
Methylation dataset as an object of class |
type |
|
qc.coverage.plots |
Flag indicating if sequencing coverage information is summarized and returned. This
parameter is considered only when |
verbose |
Flag specifying whether diagnostic output should be written to the console or to the RnBeads logger in case the latter is initialized. |
Currently, summarizing coverage for RnBiseqSet
object is the only available function.
RnBeadSet
object with imputed quality control information
Pavlo Lutsik
This function computes methylation segmentation by MethylSeekR into PMDs, UMRs/LMRs, and HMDs. It is recommened to only execute this function on WGBS data (with coverage >=10 according to the developer's recommendation), but could also be used with RRBS_HaeIII without guarantee and the results should be interpreted carefully.
rnb.execute.segmentation( rnb.set, sample.name, meth.level = 0.5, fdr = 5, min.cover = 5, n.cores = 1, chr.sel = "chr2", plot.path = getwd(), temp.dir = tempdir() )
rnb.execute.segmentation( rnb.set, sample.name, meth.level = 0.5, fdr = 5, min.cover = 5, n.cores = 1, chr.sel = "chr2", plot.path = getwd(), temp.dir = tempdir() )
rnb.set |
An object of type |
sample.name |
The sample for which segmentation is to be executed. Segemntation can only be exectued for each sample individually. |
meth.level |
Methylation cutoff to be used in UMR/LMR computation |
fdr |
False discovery rate cutoff to be used in percent |
min.cover |
The coverage threshold |
n.cores |
The number of cores available for analysis |
chr.sel |
Selected chromosome for model training in "chrAB" format. Defaults to "chr2". |
plot.path |
Location on disk on which diagnostic plots are to be stored. Defaults to the working directory. |
temp.dir |
The temporary directory. Defaults to the R temporary directory. |
For further descriptions on the methods, see MethylSeekR
-documentation. The new annotations can be accessed
via rnb.get.annotation("[PMDs,UMRs,LMRs,HMDs]_[sample.name]")
.
The input RnBSet object with segementation added as an additional region type. Furthermore, three new annotations are set globally containing segmentation into PMDs, UMRs/LMRs, and HMDs for the sample that was specified.
Michael Scherer, based on a script by Abdulrahman Salhab
1. Burger, Lukas, Gaidatzis, Dimos, Schuebeler, Dirk, and Stadler, Michael B. (2013) Identification of active regulatory regions from DNA methylation data. Nucleic Acids Research 41(16):e155.
Infers the sex of every sample in the given dataset, based on average signal intensity values on the autosomes and the sex chromosomes.
rnb.execute.sex.prediction(rnb.set)
rnb.execute.sex.prediction(rnb.set)
rnb.set |
Methylation dataset as an object of type |
The possibly modified dataset. If sex could be predicted, the sample annotation table is enriched with
two more columns - "Predicted Male Probability"
and "Predicted Sex"
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.example <- rnb.execute.sex.prediction(rnb.set.example) table(rnb.set.example[, "Predicted Sex"])
library(RnBeads.hg19) data(small.example.object) rnb.set.example <- rnb.execute.sex.prediction(rnb.set.example) table(rnb.set.example[, "Predicted Sex"])
Removes all sites in sex chromosomes from the given dataset.
rnb.execute.sex.removal(rnb.set)
rnb.execute.sex.removal(rnb.set)
rnb.set |
Methylation dataset as an object of type inheriting |
List of three elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly) modified dataset after retaining sites on autosomes only.
"filtered"
integer
vector storing the indices (in beta matrix of the unfiltered
dataset) of all removed probes.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.sex.removal(rnb.set.example)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.sex.removal(rnb.set.example)$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
Removes all probes overlapping with single nucleotide polymorphisms (SNPs) from the given dataset.
rnb.execute.snp.removal(rnb.set, snp = rnb.getOption("filtering.snp"))
rnb.execute.snp.removal(rnb.set, snp = rnb.getOption("filtering.snp"))
rnb.set |
Methylation dataset as an object of type inheriting |
snp |
Criterion for the removal of sites or probes based on overlap with SNPs. Possible values are
|
list
of four elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly) modified dataset object after removing probes that overlap with SNPs.
"filtered"
integer
vector storing the indices (in beta matrix of the unfiltered
dataset) of all removed sites or probes.
"snp"
The value of the snp
parameter.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.snp.removal(rnb.set.example, "any")$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.snp.removal(rnb.set.example, "any")$dataset identical(meth(rnb.set.example), meth(rnb.set.filtered)) # FALSE
Conduct Surrogate Variable Analysis (SVA) on the beta values of an RnBSet for given target variables
rnb.execute.sva( rnb.set, cmp.cols = rnb.getOption("inference.targets.sva"), columns.adj = rnb.getOption("covariate.adjustment.columns"), assoc = TRUE, numSVmethod = rnb.getOption("inference.sva.num.method") )
rnb.execute.sva( rnb.set, cmp.cols = rnb.getOption("inference.targets.sva"), columns.adj = rnb.getOption("covariate.adjustment.columns"), assoc = TRUE, numSVmethod = rnb.getOption("inference.sva.num.method") )
rnb.set |
The |
cmp.cols |
a vector of sample annotation column names which will be the targets of the SVA. |
columns.adj |
Column names in the table of phenotypic information to be used for confounder adjustment. |
assoc |
a flag indicating whether association information with principal components and other sample annotation should be returned |
numSVmethod |
method to estimate the number of surrogate variables. Passed to |
An object of class SvaResult
: basically a list containing the following elements:
num.components
a vector storing the number of detected SVs for each target variable
sva.performed
a vector storing whether SVA was performed on a target variable and whether more than 0 SVs were found
targets
a vector storing the names of the target variables
components
a list storing for each target variable a matrox containing the sample-wise SVs as rows
assoc
a special object containing association information of SVs with principal components and sample annotations
typically only used rnb.section.sva
.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group") has.covariates.sva(rnb.set.mod,"Treatment")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group") has.covariates.sva(rnb.set.mod,"Treatment")
export RnBSet to various output data formats
rnb.execute.tnt( rnb.set, out.dir, exp.bed = rnb.getOption("export.to.bed"), exp.trackhub = rnb.getOption("export.to.trackhub"), region.types = rnb.getOption("export.types"), ... )
rnb.execute.tnt( rnb.set, out.dir, exp.bed = rnb.getOption("export.to.bed"), exp.trackhub = rnb.getOption("export.to.trackhub"), region.types = rnb.getOption("export.types"), ... )
rnb.set |
|
out.dir |
output directory. |
exp.bed |
A character vector indicating which data types should be exported to UCSC. Possible values in the vector are |
exp.trackhub |
file types which should be exported to a trackhub structure. |
region.types |
a character vector indicating region types to be exported |
... |
Arguments passed to |
a list containing information on the export
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.execute.tnt(rnb.set.example,tempdir())
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.execute.tnt(rnb.set.example,tempdir())
Trains a new age predictor on the specified data set and writes it to the given path. Elastic net regression is to fit the input ages to the methylation values .
rnb.execute.training(object, path = "", alpha = 0.8)
rnb.execute.training(object, path = "", alpha = 0.8)
object |
a |
path |
path to which the predictor should be written out |
alpha |
alpha parameter used in the elastic net regression |
Michael Scherer
Removes all sites or probes with low variability from the given dataset.
rnb.execute.variability.removal( rnb.set, min.deviation = rnb.getOption("filtering.deviation.threshold") )
rnb.execute.variability.removal( rnb.set, min.deviation = rnb.getOption("filtering.deviation.threshold") )
rnb.set |
Methylation dataset as an object of type inheriting |
min.deviation |
Threshold for standard deviation per site. This must be a scalar between 0 and 1. All sites, for
which the standard deviation of methylation values (for all samples in |
List of four elements:
"dataset.before"
Copy of rnb.set
.
"dataset"
The (possibly modified) dataset after removing sites with low variability.
"filtered"
integer
vector storing the indices (in beta matrix of the unfiltered
dataset) of all removed sites.
"threshold"
The value of the given parameter min.deviation
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.variability.removal(rnb.set.example, 0.01)
library(RnBeads.hg19) data(small.example.object) rnb.set.filtered <- rnb.execute.variability.removal(rnb.set.example, 0.01)
Wrapper for exporting all annotation sets
rnb.export.all.annotation( out.dir, types = c("CpG", rnb.region.types(assembly)), assembly = "hg19", format = "bed" )
rnb.export.all.annotation( out.dir, types = c("CpG", rnb.region.types(assembly)), assembly = "hg19", format = "bed" )
out.dir |
The directory to write the files to |
types |
One-element |
assembly |
Genome assembly of interest. See |
format |
output format. currently only |
TRUE
, invisibly.
Fabian Mueller
logger.start(fname=NA) rnb.export.all.annotation(tempdir(),c("genes","promoters"))
logger.start(fname=NA) rnb.export.all.annotation(tempdir(),c("genes","promoters"))
Export the annotation to a defined format (currently only bed is supported
rnb.export.annotation(fname, type, assembly = "hg19", format = "bed")
rnb.export.annotation(fname, type, assembly = "hg19", format = "bed")
fname |
One-element |
type |
One-element |
assembly |
Genome assembly of interest. See |
format |
Output format. currently only |
TRUE
, invisibly.
Fabian Mueller
rnb.export.annotation(tempfile(pattern="promoters",fileext=".bed"),"promoters")
rnb.export.annotation(tempfile(pattern="promoters",fileext=".bed"),"promoters")
Data exported to a format compatible with the FaST-LMM-EWASher tool for cell-mixture adjustment. see Zou, J., et al., Nature Methods, 2014 for further details on the tool.
rnb.export.to.ewasher(rnb.set, out.dir, reg.type = "sites", ...)
rnb.export.to.ewasher(rnb.set, out.dir, reg.type = "sites", ...)
rnb.set |
Object of class |
out.dir |
output directory. If not existing, it will be created and all exported files will be placed here. If existing, this functions results in an error. |
reg.type |
region type to be exported |
... |
passed on to |
a list containing information on the export
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.export.to.ewasher(rnb.set.example,tempfile(pattern="forEwasher"))
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.export.to.ewasher(rnb.set.example,tempfile(pattern="forEwasher"))
convert an RnBSet
object to a UCSC-style track hub.
rnb.export.to.trackhub( rnb.set, out.dir, reg.type = "sites", data.type = "bigBed", ... )
rnb.export.to.trackhub( rnb.set, out.dir, reg.type = "sites", data.type = "bigBed", ... )
rnb.set |
Object of class |
out.dir |
output directory. If not existing, it will be created. otherwise files in that directory are overwritten. |
reg.type |
region type to be converted |
data.type |
either "bigBed" or "bigWig" |
... |
parameters passed on to the track hub generating procedure |
During execution the RnBSet is converted to bed files. If the operating system is supported (currently Unix and MacOS only) these are automatically converted to bigBed files. If your operating system is not supported, you need to create them manually (see the UCSC Genome Browser documentation for details). For details on UCSC track hubs see the UCSC tracks help page.
a list containing information on the export
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.export.to.trackhub(rnb.set.example,tempdir())
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.export.to.trackhub(rnb.set.example,tempdir())
given a region types, assigns sites to regions and determines relative positions of sites in the assigned region
rnb.find.relative.site.coord(rnb.set, region.type, extend.by = 0.33)
rnb.find.relative.site.coord(rnb.set, region.type, extend.by = 0.33)
rnb.set |
RnBSet object |
region.type |
Region type for which the coordinates are computed |
extend.by |
A number between 0 and 1 specifying the percentage by which a region is extended in order to capture methylation information before region start and after region end |
a data frame containing the site index, the assigned region index and the relative coordinate The relative coordinate is 0 if the site's coordinate is identical to the region start coordinate and 1 if identical to the regions end coordinate and scaled inbetween. Coordinates can be less than 0 or larger than 1 if a site is in the upstream or downstream flanking region respectively
Fabian Mueller
Extracts the requested annotation for the given genome.
rnb.get.annotation(type = "CpG", assembly = "hg19")
rnb.get.annotation(type = "CpG", assembly = "hg19")
type |
Name of annotation. |
assembly |
Genome assembly of interest. See |
When the returned value is of type GRangesList
, it defines the genomic positions of the requested sites,
probes or regions. Identifiers, if present, can be obtained using the names
method. Strand information is also
included when applicable. Any additional annotation is stored as metadata in the respective GRanges
objects.
Probe, site or region annotation table. If the specified type refers to control probes, the returned value is
a data.frame
listing all respective control probes. Otherwise, this function returns an object of type
GRangesList
- a list of consistent GRanges
objects, one per chromosome.
Fabian Mueller
rnb.set.annotation
for adding annotation;
rnb.region.types
for all loaded region types in a genome assembly
rnb.get.annotation("promoters")
rnb.get.annotation("promoters")
Gets the supported genome assemblies.
rnb.get.assemblies()
rnb.get.assemblies()
All supported genome assemblies in the form of a character
vector. These are "hg19"
,
"mm10"
, "mm9"
and "rn5"
.
Yassen Assenov
"hg19" %in% rnb.get.assemblies()
"hg19" %in% rnb.get.assemblies()
Gets the chromosome names supported for the specified assembly.
rnb.get.chromosomes(assembly = "hg19")
rnb.get.chromosomes(assembly = "hg19")
assembly |
Genome assembly of interest. See |
character
vector of supported chromosomes for the specified genome assembly. The elements of the
vector follow the Ensembl convention ("1"
, "2"
, ...), and the
names of this vector - the convention of the UCSC Genome Browser
("chr1"
, "chr2"
, ...).
Pavlo Lutsik
"chrX" %in% names(rnb.get.chromosomes())
"chrX" %in% names(rnb.get.chromosomes())
Gets the location of the given report-specific directory.
rnb.get.directory( report, dir = c("data", "images", "images-high", "pdfs"), absolute = FALSE )
rnb.get.directory( report, dir = c("data", "images", "images-high", "pdfs"), absolute = FALSE )
report |
Report of interest. |
dir |
Type of directory to get. Must be one of |
absolute |
Flag indicating if the absolute path of the directory is to be returned. If this is |
Path of the requested directory as a single-element character
vector.
Yassen Assenov
Report
for functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) rnb.get.directory(report, "data")
report <- createReport("example.html", "Example", init.configuration = TRUE) rnb.get.directory(report, "data")
Gets the mapping information used for a region type. These are structures used to map regions to the genomic loci (or Infinium probes) that target them.
rnb.get.mapping(region.type, target.type, assembly = "hg19")
rnb.get.mapping(region.type, target.type, assembly = "hg19")
region.type |
Region type. The built-in types are |
target.type |
Target type for sites. |
assembly |
Genome assembly of interest. See |
list
of mapping structures, one per chromosome. Every mapping structure is an object of type
IRanges
and stores the range of indices of all sites contained in the respective region.
Regions that do not contain sites are left out of the mapping.
Yassen Assenov
promoters2probes <- rnb.get.mapping("promoters", "probes450") promoters2probes[["chr21"]]
promoters2probes <- rnb.get.mapping("promoters", "probes450") promoters2probes[["chr21"]]
Creates a string that points to the given reference item in the specified report.
rnb.get.reference(report, txt)
rnb.get.reference(report, txt)
report |
Report that contains the reference to be cited. |
txt |
Text of the reference in the form of a non-empty |
Citation of the reference item (including a link) in the form of a one-element character
vector. If
the specified reference item is not found in the report, this method returns an empty string.
Yassen Assenov
rnb.add.reference
for adding a reference item to a report; Report
for
other functions adding contents to an HTML report
report <- createReport("example.html", "Example", init.configuration = TRUE) txt.reference <- c("Bird A. ", "<i>Nucleic Acids Res.</i> <b>8</b> (1980)") report <- rnb.add.reference(report, txt.reference) txt <- c("This was shown in ", rnb.get.reference(report, txt.reference), ".") rnb.add.paragraph(report, txt)
report <- createReport("example.html", "Example", init.configuration = TRUE) txt.reference <- c("Bird A. ", "<i>Nucleic Acids Res.</i> <b>8</b> (1980)") report <- rnb.add.reference(report, txt.reference) txt <- c("This was shown in ", rnb.get.reference(report, txt.reference), ".") rnb.add.paragraph(report, txt)
Gets a matrix of reliability indications for every measurement in the given dataset.
rnb.get.reliability.matrix(rnb.set, row.names = FALSE)
rnb.get.reliability.matrix(rnb.set, row.names = FALSE)
rnb.set |
Methylation dataset as an object of type inheriting |
row.names |
Flag indicating of row names are to be generated in the result. |
logical
matrix in which every row corresponds to a CpG site or probe and every column - to a patient.
If the dataset does not contain coverage or detection p-value information, the returned value is NULL
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) rnb.options(identifiers.column = "Sample_ID") str(rnb.get.reliability.matrix(rnb.set.example))
library(RnBeads.hg19) data(small.example.object) rnb.options(identifiers.column = "Sample_ID") str(rnb.get.reliability.matrix(rnb.set.example))
Extracts all control probe types in the HumanMethylation450 assay.
rnb.infinium.control.targets(target = "probes450")
rnb.infinium.control.targets(target = "probes450")
target |
A singleton of type |
character
vector of control targets.
Pavlo Lutsik
"NEGATIVE" %in% rnb.infinium.control.targets()
"NEGATIVE" %in% rnb.infinium.control.targets()
Creates a new directory to host HTML reports and copies the shared configuration files.
rnb.initialize.reports(dir.reports, dir.configuration = "configuration")
rnb.initialize.reports(dir.reports, dir.configuration = "configuration")
dir.reports |
Directory to host report files. This must be a |
dir.configuration |
Subdirectory to host configuration files shared by the reports. This must be a
|
TRUE
if the report directory was successfully created and the configuration files were copied to the
specified location; FALSE
otherwise.
Yassen Assenov
createReport
for initializing an HTML report
dir.reports <- "~/infinium_studies/cancer_study/reports" if (!rnb.initialize.reports(dir.reports)) { cat("ERROR: Could not initialize configuration in ", dir.reports, "\n", sep = "") }
dir.reports <- "~/infinium_studies/cancer_study/reports" if (!rnb.initialize.reports(dir.reports)) { cat("ERROR: Could not initialize configuration in ", dir.reports, "\n", sep = "") }
Checks if the specified text is an option name.
rnb.is.option(txt)
rnb.is.option(txt)
txt |
Potential option name. This should be a one-element |
TRUE
if the specified parameter is a valid analysis option name; FALSE
otherwise.
Yassen Assenov
rnb.options
for getting and setting option values
rnb.is.option("logging") # TRUE rnb.is.option("Logging") # FALSE
rnb.is.option("logging") # TRUE rnb.is.option("Logging") # FALSE
Loads a previously saved custom region annotation from a binary (RData) file.
rnb.load.annotation(fname, type)
rnb.load.annotation(fname, type)
fname |
One-element |
type |
One-element |
If the region annotation cannot be loaded from the specified location, this function exits with an error message in
the form "unable to load object from ..."
. This could happen, for example, when fname
does not refer to
a valid RData file, or the file cannot be accessed due to security restrictions.
If the file is loaded in the current session, but no annotation was added, the function returns invisibly one of the following short failure messages:
"invalid format"
The RData file does not store exactly the following three objects - assembly
,
regions
, and mapping
, or they are not of the expected type.
"unsupported assembly"
The specified assembly is unknown.
"invalid format of regions"
The specified region annotation table is invalid.
"invalid format of mappings"
The specified region mapping tables are invalid.
Invisibly, TRUE
if the annotation was loaded successfully; an error message if the objects in the
given file do not encode an annotation.
Yassen Assenov
rnb.save.annotation
for saving annotation to a binary file; rnb.set.annotation
for loading an annotation from a BED file.
Loads a previously region annotation from the RnBeads resource database
rnb.load.annotation.from.db(types, assembly = "hg19")
rnb.load.annotation.from.db(types, assembly = "hg19")
types |
One-element |
assembly |
Genome assembly of interest. See |
This function checks whether a region annotation is present in the RnBeads resources,
downloads the corresponding annotation file(s) from the and then runs rnb.load.annotation
to import the annotation.
Invisibly, TRUE
if the annotation was loaded successfully; an error message if the objects in the
given file do not encode an annotation.
Fabian Mueller
rnb.load.annotation
for loading annotation from a binary file
rnb.region.types() rnb.load.annotation.from.db(c("tiling1kb", "dynamicMethZiller2013")) rnb.region.types()
rnb.region.types() rnb.load.annotation.from.db(c("tiling1kb", "dynamicMethZiller2013")) rnb.region.types()
Loads a list of probe or site identifiers. This function is used in the preprocessing module for loading a whitelist and/or a blacklist of identifiers.
rnb.load.sitelist(fname, verbose = FALSE)
rnb.load.sitelist(fname, verbose = FALSE)
fname |
File listing the identifiers, one per line. |
verbose |
Flag indicating if messages are to be printed. If the values is |
The loaded list of identifiers, or NULL
if fname
could not be open.
Yassen Assenov
logger.start
for initializing a logger
Creates a plot, using ggplot2, with a single text message.
rnb.message.plot(txt)
rnb.message.plot(txt)
txt |
Text to be plotted. |
The newly initialized ggplot
instance.
Yassen Assenov
x11(width = 5, height = 5) rnb.message.plot("Missing data")
x11(width = 5, height = 5) rnb.message.plot("Missing data")
Transforms M values to beta values.
rnb.mval2beta(mvals)
rnb.mval2beta(mvals)
mvals |
|
The calculated beta values.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) mvals <- rnb.beta2mval(meth(rnb.set.example)) bvals <- rnb.mval2beta(mvals) all((bvals-meth(rnb.set.example))<1e-10)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) mvals <- rnb.beta2mval(meth(rnb.set.example)) bvals <- rnb.mval2beta(mvals) all((bvals-meth(rnb.set.example))<1e-10)
Allows the user to set and examine a variety of RnBeads global options. They affect the way in which the package computes and displays its results.
rnb.options(...) rnb.getOption(x)
rnb.options(...) rnb.getOption(x)
... |
Option names as |
x |
Option name in the form of a |
Invoking rnb.options()
with no arguments returns a list with the current values of the options. To access the
value of a single option, one should use, e.g., rnb.getOption("filtering.greedycut")
, rather than
rnb.options("filtering.greedycut")
which is a list of length one. Also, only a limited set of options
is available (see below). Attempting to get or set the value of a non-existing option results in an error.
For rnb.getOption
, the current value for x
. For rnb.options()
, a list of all
RnBeads options and their current values. If option names are given, a list of all requested options
and their values. If option values are set, rnb.options
returns the previous values of the modified
options, invisibly.
analysis.name
= NULL
One-element character
vector storing a short title of the analysis. If specified, this name appears at
the page title of every report.
logging
= TRUE
Flag indicating if logging functionality is enabled in the automatic runs of the pipeline.
email
= NULL
Email address associated with the analyses.
assembly
= "hg19"
Genome assembly to be used. Currently only important for bisulfite mode. The supported genomes returned by the
function rnb.get.assemblies
.
analyze.sites
= TRUE
Flag indicating if analysis on site or probe level is to be conducted. Note that the preprocessing module always operates on the site level (only), regardless of the value of this option.
preanalysis.script
no default
Path to an R script that is executed before every module. This options is useful if e.g., if you specify custom regions that have to be present in a cluster enviroment.
region.types
= NULL
Region types to carry out analysis on, in the form of a character
vector. NULL
(default value)
signifies that all available region annotations (as returned by rnb.region.types
) are summarized
upon loading and normalization, and the other modules analyze all regions summarized in the dataset. If this
option is set to an empty vector, analysis on the region level is skipped.
region.aggregation
= "mean"
Aggregation function to apply when calculating the methylation value for a region based on the values of the
CpGs associated with that region. Accepted values for this function are "min"
, "max"
,
"mean"
(default), "median"
, "sum"
, "coverage.weighted"
. The last method is
applicable only for sequencing-based methylation datasets. It computes the weighted average of the values of
the associated CpGs, whereby weights are calculated based on the coverages of the respective sites.
region.subsegments
= 0
If a number larger than 1 is specified, RnBeads will subdivide each region specified in the
region.types
option into subsegments containing on average region.subsegments
sites per
subsegment. This is done by clustering the sites within each regions according to their genomic coordinates.
These subsegments are then used for subsequent analysis.
Use cautiously as this will significantly increase the runtime of the pipeline.
region.subsegments.types
= NULL
The region types to which subsegmentation will be applied. Defaults to region.types
when set to
NULL
.
identifiers.column
= NULL
Column name or index in the table of phenotypic information to be used when plotting sample identifiers. If
this option is NULL
, it points to a non-existing column or a column that does not list IDs, the default
identifiers are used. These are the row names of the sample phenotype table (and the column names of the beta
value matrix).
colors.category
= c("#1B9E77","#D95F02",...)
character
vector of length 2 or more giving the color scheme for displaying categorical trait values in
plots. RnBeads denotes missing values (NA
) by grey, therefore, it is not recommended to include shades
of grey in this vector. The default value of this option is the result of the "Dark2"
palette of
RColorBrewer with 8 values.
colors.gradient
= c("#132B43","#56B1F7")
character
vector of length 2 or more giving the color scheme for displaying continuous (gradient) trait
values in plots. RnBeads interpolates between the color values.
min.group.size
= 2
Minimum number of samples each subgroup defined by a trait, in order for this trait to be considered in the
methylation profiles and in the differential methylation modules. This must be a positive integer
.
max.group.count
= NULL
Maximum number of subgroups defined by a trait, in order for this trait to be considered in the methylation
profiles and in the differential methylation modules. This must be an integer
of value 2
or
more. As a special case, a value of NULL
(default) indicates that the maximum number of subgroups is
the number of samples in an analysis minus 1
, i.e. traits with all unique values will be ignored.
replicate.id.column
= NULL
Column name in the sample annotation table that indicates sample replicates. Replicates are expected to
contain the same value. Samples without replicates should contain unique or missing values. If this option is
NULL
(default), replicate handling is disabled.
gz.large.files
= FALSE
Flag indicating whether large output files should be compressed (in .gz
format).
import
= TRUE
Flag controlling whether data import report should be generated. This option be set to FALSE
only when
the provided data source is an object of type RnBSet, i.e. the data has been previously loaded
by RnBeads.
import.default.data.type
= "infinium.idat.dir"
Type of data assumed to be supplied by default (Infinium 450k microarray).
For sequencing data set this to bs.bed.dir
and save the options.
See rnb.execute.import
for further details.
import.table.separator
= ","
Separator used in the plain text data tables. See rnb.execute.import
for details.
import.bed.style
= "bismarkCov"
Preset for bed-like formats. "BisSNP", "Encode","EPP", "bismarkCytosine", "bismarkCov"
are currently
supported. See the RnBeads vignette and the FAQ section on the website for more details.
import.bed.columns
Column indices in the supplied BED file with DNA methylation information.
These are represented by a named integer
vector, in which the names are: "chr"
, "start"
,
"end"
, "strand"
, "meth"
, "coverage"
, "c"
and "t"
. These names
correspond the columns for chromosome, start position, end position, strand, methylation degree, read
coverage, number of reads with C and number of reads with T, respectively. Methylation degree and/or read
coverage, if not specified, are inferred from the values in the columns "c"
and "t"
.
Further details and examples of BED files can be found in Section 4.1 of the RnBeads vignette.
import.bed.frame.shift
= 1
Singleton of type integer
specifying the frame shift between
the coordinates in the input BED file and the corresponding genomic reference. This (integer
) value
is added to the coordinates from the BED file before matching the methylation sites to the annotated ones.
import.bed.test
= TRUE
Perform a small loading test, by reading 1000 rows from each BED file, after which normal loading is performed. See RnBeads vignette and the FAQ section on the website for more details.
import.bed.test.only
= FALSE
Perform only the small loading test, and skip loading all the data.
import.skip.object.check
= FALSE
Skip the check of the loaded RnBSet object after loading. Helps with keeping the memory profile down
import.idat.platform
= NULL
Character specifying the Infinium platform that is uses. Has to be one of 'probes27'
,
'probes450'
, 'probesEPIC'
or 'probesEPICv2'
. If 'auto'
, the platform is automatically detected
from the IDAT file names.
import.sex.prediction
= TRUE
Flag indicating if sex prediction is to be performed. Sex prediction is supported for Infinium 450k, EPIC, EPICv2 and bisulfite sequencing datasets with signal intensity or coverage information. The value of this option is ignored for 27k datasets.
qc
= TRUE
Flag indicating if the quality control module is to be executed.
qc.boxplots
= TRUE
[Microarrays] Add boxplots for all types of quality control probes to the quality control report. The boxplots give signal distribution across samples.
qc.barplots
= TRUE
[Microarrays] Add barplots for each quality control probes to the quality control report.
qc.negative.boxplot
= TRUE
[Microarrays] Add boxplot of negative control probe intensities for all samples.
qc.snp.heatmap
= TRUE
[Microarrays] Flag indicating if a heatmap of the beta values for all SNP probes is to be generated.
qc.snp.barplot
= FALSE
[Microarrays] Add bar plots of the beta-values observed for each SNP-calling probe.
qc.snp.boxplot
= FALSE
[Microarrays] Add boxplot of beta-values for the SNP-calling probes.
qc.snp.distances
= TRUE
[Microarrays] Flag indicating if intersample distances based on the beta values of SNP probes are to be displayed. This can help identify genetically similar or identical samples.
qc.snp.purity
= FALSE
[Microarrays] Flag indicating if genetic purity should be estimated based on the beta values of SNP probes.
qc.sample.batch.size
= 50
[Microarrays] Maximal number of samples included in a single quality control barplot and negative control boxplot.
qc.coverage.plots
= FALSE
[Bisulfite sequencing] Add genome-wide sequencing coverage plot for each sample.
qc.coverage.threshold.plot
= 1:10
[Bisulfite sequencing] Values for coverage cutoffs to be shown in a coverage thresholds plot. This must be an integer
vector of positive values. Setting this to an empty vector disables the coverage thresholds plot.
qc.coverage.histograms
= FALSE
[Bisulfite sequencing] Add sequencing coverage histogram for each sample.
qc.coverage.violins
= FALSE
[Bisulfite sequencing] Add sequencing coverage violin plot for each sample.
qc.cnv
= FALSE
[Microarrays] Add CNV estimation for each position in each sample.
qc.cnv.refbased
= TRUE
[Microarrays] Should CNV estimation be performed with a reference (twin study) or with the mean over the samples.
preprocessing
= TRUE
Flag controlling whether the data should be preprocessed (whether quality filtering and in case of Infinium microarray data normalization should be applied).
normalization
= NULL
Flag controlling whether the data should be normalized and normalization report generated. Setting this to
NULL
(default) enables this step for analysis on Infinium datasets, but disables it in case of
sequencing-based datasets. Note that normalization is never applied in sequencing datasets; if this flag is
enabled, it will lead to a warning message.
normalization.method
= "wm.dasen"
Normalization method to be applied, or "none"
. Multiple normalization methods are supported:
"illumina"
-
methylumi-implemented
Illumina scaling normalization; "swan"
- SWAN-normalization by Gordon et al., as implemented
in minfi; "bmiq"
-
beta-mixture quantile normalization method by Teschendorff et al; as well as "wm.dasen"
(default),
"wm.nasen"
, "wm.betaqn"
, "wm.naten"
, "wm.nanet"
, "wm.nanes"
,
"wm.danes"
, "wm.danet"
, "wm.danen"
, "wm.daten1"
, "wm.daten2"
,
"wm.tost"
, "wm.fuks"
and "wm.swan"
- all normalization methods implemented in the
wateRmelon package. When
setting this option to a specific algorithm, make sure its dedicated package is installed.
"scaling.internal"
, "scalings"
- different scaling methods as implemented in the
sesame R package.
normalization.background.method
= "none"
A character singleton specifying which background subtraction is to be performed during normalization.
The following values are accepted: "none"
(default), "methylumi.noob"
, "methylumi.goob"
,
"methylumi.lumi"
, "enmix.oob"
, "sesame.noob"
and "sesame.noobsb"
.
normalization.plot.shifts
= TRUE
Flag indicating if the report on normalization should include plots of shifts (degrees of beta value correction).
filtering.whitelist
= NULL
Name of a file specifying site or probe identifiers to be
whitelisted. Every line in this file must contain exactly one identifier. The whitelisted sites are always
retained in the analysed datasets, even if filtering criteria or blacklisting requires their removal.
For Infinium studies, the file must contain Infinium probe identifiers. For bisulfite sequencing studies,
the file must contain CpG positions in the form "chromosome:coordinate" (1-based coordinate of the cytosine),
e.g. chr2:48607772
. Unknown identifiers are silently ignored.
filtering.blacklist
= NULL
Name of a file specifying site or probe identifiers to be
blacklisted. Every line in this file must contain exactly one identifier. The blacklisted sites are removed
from the analysed datasets as a first step in the preprocessing module. For Infinium studies, the file must
contain Infinium probe identifiers. For bisulfite sequencing studies, the file must contain CpG positions in
the form "chromosome:coordinate" (1-based coordinate of the cytosine), e.g. chr2:48607772
.
Unknown identifiers are silently ignored.
filtering.context.removal
= c("CC","CAG",...)
character
vector giving the list of probe context types to be removed as a filtering step. Possible
context values are "CC"
, "CG"
, "CAG"
, "CAH"
, "CTG"
, "CTH"
and
"Other"
. Probes in the second context measure CpG methylation; the last context denotes probes
dedicated to SNP detection. Setting this option to NULL
or an empty vector effectively disables the
step of context-specific probe removal.
filtering.snp
= "any"
Removal of sites or probes based on overlap with SNPs. The accepted values for this option are:
"no"
no SNP-based filtering;
"3"
filter out a probe when the last 3 bases in its target sequence overlap with SNP;
"5"
filter out a probe when the last 5 bases in its target sequence overlap with SNP;
"any"
or "yes"
filter out a CpG site or probe when any base in its target sequence overlaps with SNP.
Bisulfite sequencing datasets operate on sites instead of probes, therefore, the values "3"
and
"5"
are treated as "yes"
.
filtering.cross.reactive
= TRUE
Flag indicating if the removal of potentially cross-reactive probes should be performed as a filtering step in the preprocessing module. A probes whose sequence maps to multiple genomic locations (allowing up to 3 mismatches) is cross-reactive.
filtering.greedycut
= NULL
Flag indicating if the Greedycut procedure should be run as a filtering step in the preprocessing module.
NULL
(default) indicates that Greedycut will be run for array-based datasets, but not for
sequencing-based datasets.
filtering.greedycut.pvalue.threshold
= 0.05
Threshold for the detection p-value to be used in Greedycut. This is a value between 0 and 1. This option has
effect only when filtering.greedycut
is TRUE
.
filtering.greedycut.rc.ties
= "row"
Indicator of what the behaviour of Greedycut should be in case of ties between the scores of rows (probes) and
columns (samples). The value of this option must be one of "row"
, "column"
or "any"
; the
last one indicating random choice. This option has effect only when filtering.greedycut
is
TRUE
.
filtering.sex.chromosomes.removal
= TRUE
Flag indicating if the removal of probes located on sex chromosomes should be performed as a filtering step.
filtering.missing.value.quantile
= 0.5
Number between 0 and 1, indicating the fraction of allowed missing values per site. A site is filtered out
when its methylation beta values are NA
s in a larger fraction of samples than this threshold. Setting
this option to 1 (default) retains all sites, and thus effectively disables the missing value filtering step
in the preprocessing module. If this is set to 0, all sites that contain missing values are filtered out.
filtering.coverage.threshold
= 5
Threshold for minimal acceptable coverage. This must be a non-negative value. Setting this option to 0 (zero) effectively considers any known or unknown read coverage for sufficiently deep.
filtering.low.coverage.masking
= FALSE
Flag indicating whether methylation values for low coverage sites should be set to missing. In combination
with filtering.missing.value.quantile
this can lead to the removal of sites.
filtering.high.coverage.outliers
= FALSE
(Bisulfite sequencing mode) Flag indicating whether methylation sites with a coverage of more than 10 times the 95-percentile of coverage should be removed.
filtering.deviation.threshold
= 0
Threshold used to filter probes based on the variability of their assigned beta values. This must be a real
value between 0 and 1, denoting minimum standard deviation of the beta values in one site across all samples.
Any sites that have standard deviation lower than this threshold are filtered out. Note that sites with
undetermined varibility, that is, sites for which there are no measurements (all beta values are NA
s),
are retained. Setting this option to 0 (default) disables filtering based on methylation variability.
imputation.method
= "none"
Character indicating which imputation method should be used to replace missing values. This option has to be
one of the following values "none"
, "mean.cpgs"
, "mean.samples"
, "random"
,
"median.cpgs"
, "median.samples"
or "knn"
. Setting this option to "none"
inactivates
imputation (default).
inference
= FALSE
Flag indicating if the covariate inference analysis module is to be executed.
inference.genome.methylation
= "Genome-wide methylation"
Name of the column to add to the sample annotation, storing the genome-wide methylation level. If such a
column already exists, its values will be overwritten. Setting this option to NULL
or an empty
character
disables computing and adding genome-wide methylation levels.
inference.targets.sva
= character()
Column names in the sample annotation table for which surrogate variable analysis (SVA) should be conducted. An empty vector (default) means that SVA is skipped.
inference.reference.methylome.column
= character()
Column name in the sample annotation table giving the assignment of samples to reference methylomes.
The target samples should have NA
values in this column.
inference.max.cell.type.markers
= 50000
Number of most variable CpGs which are tested for association with the reference cell types. Setting this
option to NULL
forces the algorithm to use all available sites in the dataset, and may greatly
increase the running time for cell type comoposition estimation.
inference.top.cell.type.markers
= 500
Number of top cell type markers used for determining cell type contributions to the target DNA methylation profiles using the projection method of Houseman et al.
inference.sva.num.method
= "leek"
Name of the method to be used for estimating the number of surrogate variables.
must be either 'leek' or 'be', See sva
function for details.
inference.age.column
= "age"
Name of the column in which the ages of the donors are annotated. This function can be of numeric, string or factor format.
inference.age.prediction
= TRUE
Flag indicating if the epigenetic age prediction within the inference module is to be executed.
inference.age.prediction.training
= FALSE
Flag indicating if a new predictor should be created based on the provided data set.
inference.age.prediction.cv
= FALSE
Flag indicating if predictive power of a predictor that was trained in that run of the age prediction should
be assessed by cross-validation. This option only has an influence if
inference.age.prediction.training
= TRUE
.
inference.immune.cells
= TRUE
Flag indicating if immune cell content estimation is to be performed. Immune cell content prediction is based on the LUMP algorithm and is currently supported for the hg19 assembly only.
exploratory
= TRUE
Flag indicating if the exploratory analysis module is to be executed.
exploratory.columns
= NULL
Traits, given as column names or indices in the sample annotation table, to be used in the exploratory
analysis. These traits are used in multiple steps in the module: they are visualized using point types and
colors in the dimension reduction plots; tested for strong correlations and associations with principal
components in a methylation space; used to define groups when plotting beta distributions and/or inter-sample
methylation variability. The default value of this parameter - NULL
- indicates that columns should be
automatically selected; see rnb.sample.groups
for how this is done.
exploratory.top.dimensions
= 0
Number of most variable probes, sites or regions to select prior to performing dimension reduction techniques and tests for associations. Preselection can significantly reduce the running time and memory usage in the exploratory analysis module. Setting this number to zero (default) disables preselection.
exploratory.principal.components
= 8
Maximum number of principal components to be tested for associations with other factors, such as control probe
states and sample traits. This must be an integer
value between 0
and 10
. Setting this
option to 0
disables such tests.
exploratory.correlation.pvalue.threshold
= 0.01
Significance threshold for a p-value resulting from applying a test for association. This is a value between 0 and 1.
exploratory.correlation.permutations
= 10000
Number of permutations in tests performed to check for associations between traits, and between control probe
intensities and coordinates in the prinicipal component space. This must be a non-negative integer
.
Setting this option to 0
disables permutation tests.
exploratory.correlation.qc
= TRUE
[Infinium 450k] Flag indicating if quality-associated batch effects should be studied. This amounts to testing for
associations between intensities of quality control probes and principal components. This option has effect
only when exploratory.principal.components
is non-zero.
exploratory.beta.distribution
= TRUE
Flag indicating whether beta value distributions for sample groups and probe or site categories should be computed.
exploratory.intersample
= FALSE
Flag indicating if methylation variability in sample groups should be computed as part of the exploratory analysis module. If NULL (default), the plots are created for Bead Array data sets and deactivated for sequencing data sets.
exploratory.deviation.plots
= FALSE
Flag indicating if the inter-sample methylation variability step in the exploratory analysis module should
include deviation plots. Deviation plots show intra-group methylation variability at the covered sites and
regions. Setting this option to NULL
(default) enables deviation plots on Infinium datasets, but
disables them in case of sequencing-based datasets, because their generation can be very computationally
intensive. This option has effect only when exploratory.intersample
is TRUE
.
exploratory.clustering
= "all"
Which sites should be used by clustering algorithms in the exploraroty analysis module.
RnBeads performs several algorithms that cluster the samples in the dataset. If this option is set to
"all"
(default), clustering is performed using all sites; a value of "top"
indicates that only
the most variable sites are used (see the option exploratory.clustering.top.sites
); and "none"
disables clustering.
exploratory.clustering.top.sites
= 1000
Number of most variable sites to use when visualizing heatmaps. This must be a non-empty integer
vector
containing positive values. This option is ignored when exploratory.clustering
is "none"
.
exploratory.clustering.heatmaps.pdf
= FALSE
Flag indicating if the generated methylation value heatmaps in the clustering section of the exploratory
analysis module should be saved as PDF files. Enabling this option is not recommended for large values of
exploratory.clustering.top.sites
(more than 200), because heatmaps might generate very large PDF files.
exploratory.region.profiles
= ""
Region types for generating regional methylation profiles. If NULL
(default), regional methylation
profiles are created only for the region types that are available for the targeted assembly and summarized in
the dataset of interest. Setting this option to an empty vector disables the region profiles step in the
exploratory analysis module.
exploratory.gene.symbols
= NULL
A list of gene symbols to be used for custom locus profiling. Locus views will be generated for these genes.
exploratory.custom.loci.bed
= NULL
Path to a bed file containing custom genomic regions. Locus views will be generated for these regions.
nv.heatmap
= TRUE
[Microarrays] Flag indicating if a heatmap of the beta values for all nv probes is to be generated.
nv.beta.distribution
= TRUE
[Microarrays] Flag indicating if a density plot of the beta values for all nv probes is to be generated.
differential
= TRUE
Flag indicating if the differential methylation module is to be executed.
differential.site.test.method
= "limma"
Method to be used for calculating p-values on the site level. Currently supported options are "ttest" for a (paired)
t-test and "limma" for a linear modeling approach implemented in the limma
package for differential expression
in microarrays.
differential.variability
= FALSE
Flag indicating if differential variability analysis is to be conducted. If TRUE, the method specified in
differential.variability.method
is applied to detect sites that show differential variability between the groups
that are specified.
differential.variability.method
= "diffVar"
Method to be used for calculating p-values on the differential variable sites. Currently supported options are "diffVar"
implemented in the missMethyl
package and "iEVORA".
differential.permutations
= 0
Number of permutation tests performed to compute the p-value of rank permutation tests in the differential
methylation analysis. This must be a non-negative integer
. Setting this option to 0
(default)
disables permutation tests for rank permutations. Note that p-values for differential methylation are
computed and also considered for the ranking in any case.
differential.comparison.columns
= NULL
Column names or indices in the table of the sample annotation table to be used for group definition in the
differential methylation analysis. The default value - NULL
- indicates that columns should be
automatically selected. See rnb.sample.groups
for how this is done. By default,
the comparisons are done in a one vs. all manner if there are multiple
groups defined in a column.
differential.comparison.columns.all.pairwise
= NULL
Column names or indices in the table of sample annotation table to be used for group definition in the
differential methylation analysis in which all pairwise comparisons between groups should be conducted (the default
is one vs all if multiple groups are specified in a column).
Caution: for large numbers of sample groups this can lead to combinatorial explosion and thus to huge runtimes.
A value of NULL
(default) indicates that no column is selected for all pairwise comparisons explicitely.
If specified, the selected columns must be a subset of the columns that will be selected according to the
differential.comparison.columns
option.
covariate.adjustment.columns
= NULL
Column names or indices in the table of phenotypic information to be used for confounder adjustment in the
differential methylation analysis. Currently this is only supported for differential.site.test.method=="limma"
.
columns.pairing
= NULL
A NAMED vector containing for each column name for which paired analysis
should be performed (say columnA) the name or index of another column (say columnB) in which same values indicate
the same pairing. columnA should be the name of the value columnB in this vector.
For more details see rnb.sample.groups
differential.adjustment.sva
= FALSE
Flag indicating if the differential methylation analysis should account for Surrogate Variables. If
TRUE
, RnBeads looks for overlaps between the differential.comparison.columns
and
inference.targets.sva
options and include the surrogate variables as confounding factors only for these
columns. In other words, it will only have an effect if the corresponding inference option
(see inference.targets.sva
option for details) is enabled.
Currently this is only supported for differential.site.test.method=="limma"
.
differential.adjustment.celltype
= FALSE
Should the differential methylation analysis account for celltype using the reference based Houseman method.
It will only have an effect if the corresponding inference option is enabled (see inference.reference.methylome.column
option for details). Currently this is only supported for differential.site.test.method=="limma"
.
differential.enrichment.go
= FALSE
Flag indicating whether Gene Ontology (GO)-enrichment analysis is to be conducted on the identified differentially methylated regions.
differential.enrichment.lola
= FALSE
Flag indicating whether LOLA
-enrichment analysis is to be
conducted on the identified differentially methylated regions.
differential.enrichment.lola.dbs
= c("${LOLACore}")
Vector of directories containing LOLA databases. The following placeholders are allowed which will
automatically download corresponding databases from the internet: "${LOLACore}"
and "${LOLAExt}"
for the Core and Extended LOLA Databases respectively.
differential.report.sites
= TRUE
Flag indicating whether a section corresponding to differential site methylation should be added to the report.
Has no effect on the actual analysis, just the report. To disable differential site methylation analysis entirely
use the analyze.sites
option.
export.to.bed
= FALSE
Flag indicating whether the data should be exported to bed files.
export.to.trackhub
= NULL
character
vector specifying which data types should be exported to
Track hub directories. Possible values
in the vector are "bigBed"
and "bigWig"
. When this options is set to NULL
, track hub
export is disabled. Note that if "bigBed"
is contained in this option, bed files are created
automatically.
export.to.csv
= FALSE
Flag indicating whether methylation value matrices are to be exported to comma-separated value (CSV) files.
export.to.ewasher
= FALSE
Flag indicating whether methylation values and differential methylation analysis settings should be exported to a format compatible with FaST-LMM-EWASher, a tool for adjusting for cell-type compositions. See Zou, J., et al., Nature Methods, 2014 for further details on the tool.
export.types
= "sites"
character
vector of sites and region names to be exported. If NULL
, no region methylation values
are exported.
disk.dump.big.matrices
= TRUE
Flag indicating whether big tables should be stored on disk rather than in main memory in order to keep memory requirements down. May slow down analysis!
logging.exit.on.error
= FALSE
Flag indicating if the active R session should be terminated when an error is encountered during execution.
distribution.subsample
= 1000000
When plotting methylation value distributions, this threshold specifies the number of observations drawn per
group. Distributions are estimated and plotted based on these random subsamples. This approach can
significantly reduce the memory requirements of the preprocessing and exploratory analysis modules, where
methylation value distributions are plotted. Setting this to 0
disables subsampling. More information
is presented the Details section of rnb.step.betadistribution
.
enforce.memory.management
= FALSE
Flag indicating whether in some places of the code memory management should actively being enforced in order to achieve a better memory profile. I.e. garbage collection, variable removal is conducted actively. May slow down analysis.
enforce.destroy.disk.dumps
= FALSE
Flag indicating whether disked dumped big matrices (see disk.dump.big.matrices
option) should actively
be deleted when RnBSets are modified. You should switch it to TRUE
when disk.dump.big.matrices
is TRUE
and the amount of hard drive space is also limited.
Yassen Assenov
str(rnb.options()) rnb.getOption("filtering.greedycut")
str(rnb.options()) rnb.getOption("filtering.greedycut")
Exports all option values to an XML document.
rnb.options2xml(pretty = TRUE)
rnb.options2xml(pretty = TRUE)
pretty |
Flag indicating if the document should be formatted to be easily readable. For example, if this is set
to |
XML document in the form of a character
that encodes all options and their current values.
Yassen Assenov
cat(rnb.options2xml(), file = "rnbeads_options.xml")
cat(rnb.options2xml(), file = "rnbeads_options.xml")
Enables one of the pre-installed anlaysis option profiles.
rnb.performance.profile(data.type = "450k", profile)
rnb.performance.profile(data.type = "450k", profile)
data.type |
Type of dataset targeted; this must be one of |
profile |
Option profile; this must be one of |
Invisibly, a list
containing the previous values of all modified options.
Pavlo Lutsik
Draws plots that compare two distributions of beta values.
rnb.plot.beta.comparison( beta.values, fprefix, report = NULL, qq.length = 501L, points.per.group = rnb.getOption("distribution.subsample") )
rnb.plot.beta.comparison( beta.values, fprefix, report = NULL, qq.length = 501L, points.per.group = rnb.getOption("distribution.subsample") )
beta.values |
Two beta value sequences in the form of a named |
fprefix |
File name prefix for the plots. This function appends the suffixes |
report |
Report to which the plots are to be added. |
qq.length |
Positive |
points.per.group |
Maximum number of values to use in plotting a group's distribution. Groups that contain more
observations than this threshold are subsampled. Setting this parameter to a value less than
|
List of all generated plots, each being an object ot type ReportPlot
.
Yassen Assenov
plot beta value distrubions given probe categories
rnb.plot.betadistribution.probeCategories( beta.matrix, probe.cat, annotation = "Group", color.legend = NULL, log.str = NULL, points.per.group = rnb.getOption("distribution.subsample") )
rnb.plot.betadistribution.probeCategories( beta.matrix, probe.cat, annotation = "Group", color.legend = NULL, log.str = NULL, points.per.group = rnb.getOption("distribution.subsample") )
beta.matrix |
Beta values in the form of a non-empty |
probe.cat |
|
annotation |
Name of the annotation being visualized, in the form of a |
color.legend |
Color legend to use in the form of a |
log.str |
string specifying more details for the log file |
points.per.group |
the targeted number of points per group. Set this to a value < 1 to disable subsampling. More
information in the Details section of |
The plot as a ggplot2
object.
Fabian Mueller
rnb.plot.betadistribution.sampleGroups
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) probe.types <- annotation(rnb.set.example)[, "Design"] rnb.plot.betadistribution.probeCategories(meth.mat,probe.types,annotation="Infinium probe type")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) probe.types <- annotation(rnb.set.example)[, "Design"] rnb.plot.betadistribution.probeCategories(meth.mat,probe.types,annotation="Infinium probe type")
Plots beta value distrubions given a sample grouping.
rnb.plot.betadistribution.sampleGroups( beta.matrix, sample.group.inds, annotation = "Group", log.str = NULL, points.per.group = rnb.getOption("distribution.subsample") )
rnb.plot.betadistribution.sampleGroups( beta.matrix, sample.group.inds, annotation = "Group", log.str = NULL, points.per.group = rnb.getOption("distribution.subsample") )
beta.matrix |
Beta values in the form of a non-empty |
sample.group.inds |
Named |
annotation |
Name of the annotation being visualized, in the form of a |
log.str |
string specifying more details for the log file |
points.per.group |
the targeted number of points per group. Set this to a value < 1 to disable subsampling. More
information in the Details section of |
the plot as a ggplot2
object
Fabian Mueller
rnb.plot.betadistribution.probeCategories
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] rnb.plot.betadistribution.sampleGroups(meth.mat,sample.groups)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] rnb.plot.betadistribution.sampleGroups(meth.mat,sample.groups)
Plots the sequencing coverage of the RnBiseqSet object across the genomic coordinate
rnb.plot.biseq.coverage( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg.lists = NULL, ... )
rnb.plot.biseq.coverage( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg.lists = NULL, ... )
rnbs.set |
RnBiseqSet object |
sample |
unique sample identifier. In case |
type |
|
writeToFile |
flag specifying whether the output should be saved as |
numeric.names |
if |
covg.lists |
if available, the output of |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
Plots the histograms of the coverage
rnb.plot.biseq.coverage.hist( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg.max.percentile = 1, ... )
rnb.plot.biseq.coverage.hist( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg.max.percentile = 1, ... )
rnbs.set |
RnBiseqSet object |
sample |
unique sample identifier. In case |
type |
|
writeToFile |
a flag specifying whether the output should be saved as |
numeric.names |
if |
covg.max.percentile |
the maximum percentile of the coverage to be plotted |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
Plots the violin plots of the coverage distribution
rnb.plot.biseq.coverage.violin( rnbs.set, samples, fname = NULL, type = "sites", covg.range = NULL, ... )
rnb.plot.biseq.coverage.violin( rnbs.set, samples, fname = NULL, type = "sites", covg.range = NULL, ... )
rnbs.set |
RnBiseqSet object |
samples |
unique sample identifiers. In case |
fname |
base filename for the files to be plotted. If NULL, the plot will not be written to file |
type |
|
covg.range |
Vector of length 2 specifying the range of coverage to be plotted. if |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Fabian Mueller
Per-sample bar plots of Illumina HumanMethylation control probes
rnb.plot.control.barplot( rnb.set, probe, sample.subset = 1:length(samples(rnb.set)), writeToFile = FALSE, numeric.names = FALSE, name.prefix = NULL, verbose = FALSE, ... )
rnb.plot.control.barplot( rnb.set, probe, sample.subset = 1:length(samples(rnb.set)), writeToFile = FALSE, numeric.names = FALSE, name.prefix = NULL, verbose = FALSE, ... )
rnb.set |
|
probe |
exact id of the control probe consisting of the control probe type (see |
sample.subset |
an integer vector specifying the subset of samples for which the plotting should be performed |
writeToFile |
flag specifying whether the output should be saved as |
numeric.names |
if |
name.prefix |
in case |
verbose |
if |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) control.meta.data <- rnb.get.annotation("controls450") ctrl.probe<-paste0(unique(control.meta.data[["Target"]])[4], ".3") print(ctrl.probe) # EXTENSION.3 rnb.plot.control.barplot(rnb.set.example, ctrl.probe)
library(RnBeads.hg19) data(small.example.object) control.meta.data <- rnb.get.annotation("controls450") ctrl.probe<-paste0(unique(control.meta.data[["Target"]])[4], ".3") print(ctrl.probe) # EXTENSION.3 rnb.plot.control.barplot(rnb.set.example, ctrl.probe)
Box plots of various control probes
rnb.plot.control.boxplot( rnb.set, type = rnb.infinium.control.targets(rnb.set@target)[1], writeToFile = FALSE, numeric.names = FALSE, ... )
rnb.plot.control.boxplot( rnb.set, type = rnb.infinium.control.targets(rnb.set@target)[1], writeToFile = FALSE, numeric.names = FALSE, ... )
rnb.set |
|
type |
type of the control probe; must be one of the |
writeToFile |
flag specifying whether the output should be saved as |
numeric.names |
if |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) rnb.plot.control.boxplot(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) rnb.plot.control.boxplot(rnb.set.example)
Plots the number of remaining CpGs after applying different thresholds for coverage and support.
rnb.plot.coverage.thresholds(rnb.set, min.coverages, fname = NA, ...)
rnb.plot.coverage.thresholds(rnb.set, min.coverages, fname = NA, ...)
rnb.set |
Methylation dataset as an object of type |
min.coverages |
Non-empty |
fname |
File name to save the generated plot to. See the Details section for restrictions. |
... |
Additional named parameters related to saving the plot to files. These can include:
|
If fname
is specified, this function calls createReportPlot
to save the plot to PDF and/or PNG
files. See its documentation for information on acceptable file names. Additional
parameters - report
, width
, height
, etc. - can also be given. If image width is not specified,
it is set to a value between 4.7 and 9.2 (inches), depending on the number of samples in the dataset. The default
image height is fixed to 7.2.
If fname
is NULL
or NA
(default), the generated plot as an object of type
ggplot2
; otherwise, the initialized and closed ReportPlot
object, invisibly.
Yassen Assenov
Plot contributions of the cell types
rnb.plot.ct.heatmap(ct.obj, type = "nonnegative", writeToFile = FALSE, ...)
rnb.plot.ct.heatmap(ct.obj, type = "nonnegative", writeToFile = FALSE, ...)
ct.obj |
Object of class |
type |
Type of cell type contributions to plot. |
writeToFile |
If |
... |
Other arguments passed to |
The cell type contributions are visualized as a heatmap
if writeToFile=TRUE
an object of class ReportPlot
,
or the protted matrix otherwise
Pavlo Lutsik
Creates a dimension reduction plot based on the methylation values of the given dataset.
rnb.plot.dreduction( rnb.set, plot.type = "pca", dimensions = 1:2, distance.metric = "euclidean", target = "sites", point.types = 0L, point.colors = 0L, legend.space = 2 )
rnb.plot.dreduction( rnb.set, plot.type = "pca", dimensions = 1:2, distance.metric = "euclidean", target = "sites", point.types = 0L, point.colors = 0L, legend.space = 2 )
rnb.set |
Methylation dataset as an object of type inheriting |
plot.type |
Type of plot to be created. This must be one of |
dimensions |
Vector of two positive |
distance.metric |
Distance metric to be applied when reducing the dimensionality of the methylation data. This
must be one of |
target |
Site or region type to be used in the dimension reduction technique. This must be either
|
point.types |
Trait, specified as column name or index in the sample annnotation table of |
point.colors |
Trait, specified as column name or index in the sample annnotation table of |
legend.space |
Width, in inches, of the space dedicated for legends that will be assigned on the right side of the plot. This parameter is considered only if legends are actually included, that is, if sample traits are mapped to point types and/or colors. |
The analysis option "exploratory.top.dimensions"
controls whether dimension reduction is applied on all
probes, sites or regions available in the given dataset, or only on the most variable ones. In case a trait is mapped
to point types, the shapes to use are taken from the option "points.category"
. Similary, the option
"colors.category"
determines which colors are used when mapping sample categories to color. In cases when
numerical values are mapped to color, the option "colors.3.gradient"
is used. If the set of value contains
both positive and negative numbers, the middle point in the color legend is set to zero. See
RnBeads Options for more information on the options mentioned above.
The generated plot as an object of type ggplot
. The object also contains an
attribute "info"
, which is a list with the following elements:
"Target"
Targeted sites or regions; the value of the parameter target
.
"Technique"
Dimension reduction technique applied; one of "PCA"
or "MDS"
.
"All"
Total number of sites or regions defining the high dimensional methylation space.
"Missing"
Number of dimensions ignored because they contain (only) missing values.
"Selected"
Number of dimensions used when applying a dimension reduction technique.
"Explained"
Value between 0
and 1
showing the variance explained by the
selected dimensions, as a fraction of the total variance of all dimensions.
Yassen Assenov
summarized.regions
for listing all region types summarized
in a dataset
library(RnBeads.hg19) data(small.example.object) pdf("PCA.pdf", width = 7.2, height = 5.2) print(rnb.plot.dreduction(rnb.set.example, point.colors="Sample_Group")) dev.off()
library(RnBeads.hg19) data(small.example.object) pdf("PCA.pdf", width = 7.2, height = 5.2) print(rnb.plot.dreduction(rnb.set.example, point.colors="Sample_Group")) dev.off()
Computes methylation distributions for various region types and sample groups
rnb.plot.locus.profile( rnbSet, chrom, start, end, grps = NULL, plot.m.regions = NULL, plot.m.heatmap = TRUE, plot.m.smooth = TRUE, cvals.grps = rnb.getOption("colors.category"), cvals.meth = rnb.getOption("colors.meth"), smooth.profile = "wide" )
rnb.plot.locus.profile( rnbSet, chrom, start, end, grps = NULL, plot.m.regions = NULL, plot.m.heatmap = TRUE, plot.m.smooth = TRUE, cvals.grps = rnb.getOption("colors.category"), cvals.meth = rnb.getOption("colors.meth"), smooth.profile = "wide" )
rnbSet |
RnBSet object |
chrom |
chromosome of window to plot |
start |
start coordinate of window to plot |
end |
end coordinate of window to plot |
grps |
a list of indices for each group to be compared or NULL if no sample grouping information should be displayed |
plot.m.regions |
character vector of region types whose methylation values should be displayed If |
plot.m.heatmap |
flag indicating whether sites methylation values should be displayed in a heatmap. If |
plot.m.smooth |
flag indicating whether a scatterplot with smoothing curves should be displayed. If |
cvals.grps |
colors to be used for the different groups |
cvals.meth |
colors to be used for methylation values and heatmaps |
smooth.profile |
profile to be used for the smoothing curves. Allowed values include
|
a ggplot2
plot object containing the plot
Fabian Mueller
#see RnBeads vignette (section: 'Generating Locus Profile Plots') for examples
#see RnBeads vignette (section: 'Generating Locus Profile Plots') for examples
Plot the the cell type marker selection based on the reference methylome data
rnb.plot.marker.fstat(ct.object, writeToFile = FALSE, ...)
rnb.plot.marker.fstat(ct.object, writeToFile = FALSE, ...)
ct.object |
Object of class |
writeToFile |
If |
... |
Other arguments to |
The F-statistic values from the cell type association model (first part of eqn. (1) in [1]) are plotted in decreasing order for all tested CpG positions. A vertical line gives a cut-off for the number of selected cell type markers.
if writeToFile=TRUE
an object of class ReportPlot
,
and the plotted reordered F-statistics vector otherwise
Pavlo Lutsik
1. Houseman, Eugene and Accomando, William and Koestler, Devin and Christensen, Brock and Marsit, Carmen and Nelson, Heather and Wiencke, John and Kelsey, Karl. DNA methylation arrays as surrogate measures of cell mixture distribution. BMC Bioinformatics 2012, 13:86
Box plots of negative control probes
rnb.plot.negative.boxplot( rnb.set, sample.subset = 1:length(samples(rnb.set)), writeToFile = FALSE, name.prefix = NULL, ... )
rnb.plot.negative.boxplot( rnb.set, sample.subset = 1:length(samples(rnb.set)), writeToFile = FALSE, name.prefix = NULL, ... )
rnb.set |
|
sample.subset |
an integer vector specifying the subset of samples for which the plotting should be performed |
writeToFile |
flag specifying whether the output should be saved as |
name.prefix |
in case |
... |
other arguments to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) rnb.plot.negative.boxplot(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) rnb.plot.negative.boxplot(rnb.set.example)
plot the number of sites vs median and other percentiles of coverage
rnb.plot.num.sites.covg( rnbs, addSampleNames = (length(samples(rnbs)) < 100), bar.percentiles = c(0.25, 0.75) )
rnb.plot.num.sites.covg( rnbs, addSampleNames = (length(samples(rnbs)) < 100), bar.percentiles = c(0.25, 0.75) )
rnbs |
RnBiseqSet object |
addSampleNames |
should the sample names be added to the plot |
bar.percentiles |
the percentiles to be used for the error bars. Must be a vector of length 2 of which the first two elements will be used |
plot as an object of type ggplot
Fabian Mueller
Heatmap of beta values from nv probes.
rnb.plot.nv.heatmap(dataset, writeToFile = FALSE, ...)
rnb.plot.nv.heatmap(dataset, writeToFile = FALSE, ...)
dataset |
Dataset as an object of type inheriting |
writeToFile |
Flag specifying whether the output should be saved as |
... |
Additional named arguments passed to |
If writeToFile
is TRUE
, plot as an object of type ReportPlot
. Otherwise,
there is no value returned (invisible NULL
).
Pavlo Lutsik, Baris Kalem
Generates bar charts summarizing the categorical traits in a sample annotation table.
rnb.plot.pheno.categories( annotations, columns = NULL, fileprefix = "barchart_pheno", report = NULL, color.values = rnb.getOption("colors.category") )
rnb.plot.pheno.categories( annotations, columns = NULL, fileprefix = "barchart_pheno", report = NULL, color.values = rnb.getOption("colors.category") )
annotations |
Methylation dataset as an object of type inheriting |
columns |
Optional; predefined column names (in the form of a |
fileprefix |
|
report |
Report to contain the generated plots. If specified, this must be an object of type
|
color.values |
Non-empty |
This function identifies the traits that define sample subgroups and then generates one report plot per
trait. Every report plot consists of two files. File names are formed by appending an index and file extension to
fileprefix
. Thus, the suffixes appended are "_1.pdf"
, "_1.png"
, "_2.pdf"
,
"_2.png"
, ... Existing files with the generated filenames are overwritten.
List of report plots. The names in this list are the column names in the annotation table that were selected for visualization. In case no suitable categorical traits are found among the provided annotations, this function returns an empty list.
Yassen Assenov
rnb.sample.groups
for identifying traits in the annotation table that define sample subgroups;
createReportPlot
for the allowed symbols to be used in fileprefix
Plots the density of methylation levels accross all regions of the specified type
rnb.plot.region.profile.density( rnb.set, sample, region.type = "", region.profile = NULL, extend.by = 0.33 )
rnb.plot.region.profile.density( rnb.set, sample, region.type = "", region.profile = NULL, extend.by = 0.33 )
rnb.set |
RnBSet object |
sample |
Index or name of the sample for which the plot should be generated |
region.type |
Region type for which the plot should be generated |
region.profile |
Alternative to specifying |
extend.by |
A number between 0 and 1 specifying the percentage by which a region is extended in order to capture methylation information before region start and after region end |
a ggplot2 object for plotting the plot shows the density of methylation levels of sites accross the specified region type for all regions of that type from 0 (region start) to 1 (region end). Sites in the flanking areas are also shown (coordinates <0 and >1).
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.profile.density(rnb.set.example,1,"genes")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.profile.density(rnb.set.example,1,"genes")
Creates a composite plot showing the sample and groupwise smoothed estimates of methylation values accross all regions of the specified type
rnb.plot.region.profiles( rnb.set, group.index.list, region.type = "", region.profile = NULL, extend.by = 0.33, cvalues = rnb.getOption("colors.category") )
rnb.plot.region.profiles( rnb.set, group.index.list, region.type = "", region.profile = NULL, extend.by = 0.33, cvalues = rnb.getOption("colors.category") )
rnb.set |
RnBSet object |
group.index.list |
a list (preferably named) containing sample indices for each group
a list of such lists is for instance generated by the |
region.type |
Region type for which the plot should be generated |
region.profile |
Alternative to specifying |
extend.by |
A number between 0 and 1 specifying the percentage by which a region is extended in order to capture methylation information before region start and after region end |
cvalues |
Color values that will be assigned to sample groups |
a ggplot2 object for plotting the plot shows the smoothed methylation levels of sites accross the specified region type for all regions of that type from 0 (region start) to 1 (region end). Sites in the flanking areas are also shown (coordinates <0 and >1). Smoothing is stratified by sample (dashed lines) and sample group (thick solid lines). Cubic splines are used for smoothing
Fabian Mueller
#Careful: this might take a while library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.profiles(rnb.set.example,rnb.sample.groups(rnb.set.example)[[1]],"genes")
#Careful: this might take a while library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.profiles(rnb.set.example,rnb.sample.groups(rnb.set.example)[[1]],"genes")
Plots the density of sites accross the specified region type
rnb.plot.region.site.density(rnb.set, region.type, extend.by = 0.33)
rnb.plot.region.site.density(rnb.set, region.type, extend.by = 0.33)
rnb.set |
RnBSet object |
region.type |
Region type for which the plot should be generated |
extend.by |
A number between 0 and 1 specifying the percentage by which a region is extended in order to capture methylation information before region start and after region end |
a ggplot2 object for plotting the plot shows the density of sites accross the specified region type for all regions of that type from 0 (region start) to 1 (region end). Sites in the flanking areas are also shown (coordinates <0 and >1).
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.site.density(rnb.set.example,"genes")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.plot.region.site.density(rnb.set.example,"genes")
Creates a point-and-whisker plots showing beta value distributions at Sentrix positions for the given slide.
rnb.plot.sentrix.distribution(rnb.set, sentrix.id)
rnb.plot.sentrix.distribution(rnb.set, sentrix.id)
rnb.set |
HumanMethylation450K dataset as an object of type |
sentrix.id |
Slide number (Sentrix ID) as an |
Generated point-and-whisker plot (an instance of ggplot
) of mean methylations for the samples
on the specified slide, or FALSE
if the dataset is non-empty but does not contain samples on the
given slide. If the provided dataset does not contain valid Sentrix ID and position information (or is an
empty dataset), this method returns NULL
.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) sid<-as.character(pheno(rnb.set.example)[["Sentrix_ID"]][1]) rnb.plot.sentrix.distribution(rnb.set.example,sid)
library(RnBeads.hg19) data(small.example.object) sid<-as.character(pheno(rnb.set.example)[["Sentrix_ID"]][1]) rnb.plot.sentrix.distribution(rnb.set.example,sid)
Creates one or more point-and-whisker plots showing beta value distributions at Sentrix positions.
rnb.plot.sentrix.distributions(rnb.set, fprefix = "sentrix_whisker", ...)
rnb.plot.sentrix.distributions(rnb.set, fprefix = "sentrix_whisker", ...)
rnb.set |
HumanMethylation450K dataset as an object of type |
fprefix |
File name prefix to be used in the generated plots. In order to ensure independence of the operating
system, there are strong restrictions on the name of the file. See the documentation of
|
... |
Other arguments passed to |
If no additional parameters are specified, this function creates one PDF and one low-resolution PNG file for every generated plot.
Point-and-whisker plot (an instance of ReportPlot
), or a list of such plots - one per
slide. If the provided dataset does not contain valid Sentrix ID and position information (or is an empty
dataset), this method returns NULL
.
Yassen Assenov
rnb.plot.sentrix.distribution
for creating a single plot for a specified slide number
Bar plots of beta-values from the genotyping probes
rnb.plot.snp.barplot( dataset, probeID, writeToFile = FALSE, numeric.names = FALSE, ... )
rnb.plot.snp.barplot( dataset, probeID, writeToFile = FALSE, numeric.names = FALSE, ... )
dataset |
Dataset as an instance of |
probeID |
Probe identifier. This must be one of |
writeToFile |
Flag specifying whether the output should be saved as |
numeric.names |
if |
... |
Additional named arguments passed to |
plot as an object of type ReportPlot
if writeToFile
is TRUE
and of class
ggplot
otherwise.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) samp<-samples(rnb.set.example)[1] rnb.plot.snp.barplot(rnb.set.example, samp)
library(RnBeads.hg19) data(small.example.object) samp<-samples(rnb.set.example)[1] rnb.plot.snp.barplot(rnb.set.example, samp)
Box plots of beta-values from the genotyping probes
rnb.plot.snp.boxplot(dataset, writeToFile = FALSE, ...)
rnb.plot.snp.boxplot(dataset, writeToFile = FALSE, ...)
dataset |
Dataset as an object of type inheriting |
writeToFile |
Flag specifying whether the output should be saved as |
... |
Additional named arguments passed to |
If writeToFile
is TRUE
: plot as an object of type ReportPlot
. Otherwise:
plot as an object of type ggplot
.
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) rnb.plot.snp.boxplot(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) rnb.plot.snp.boxplot(rnb.set.example)
Heatmap of beta values from genotyping probes.
rnb.plot.snp.heatmap(dataset, writeToFile = FALSE, ...)
rnb.plot.snp.heatmap(dataset, writeToFile = FALSE, ...)
dataset |
Dataset as an object of type inheriting |
writeToFile |
Flag specifying whether the output should be saved as |
... |
Additional named arguments passed to |
If writeToFile
is TRUE
, plot as an object of type ReportPlot
. Otherwise,
there is no value returned (invisible NULL
).
Pavlo Lutsik
library(RnBeads.hg19) data(small.example.object) rnb.plot.snp.heatmap(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) rnb.plot.snp.heatmap(rnb.set.example)
Imports Infinium 450K, MethylationEPIC or MethylationEPIC2 data series from the Gene Expression Omnibus. This function uses the series matrix file.
rnb.read.geo( accession = NULL, verbose = logger.isinitialized(), destdir = tempdir() )
rnb.read.geo( accession = NULL, verbose = logger.isinitialized(), destdir = tempdir() )
accession |
Character string, starting with |
verbose |
Flag indicating if messages should be created informing about the progress. If the logger is initialized prior to calling this function, the informative messages are sent to the logger. Warnings and errors are not affected by this parameters, the function always outputs them. |
destdir |
The destination directory for any downloads. Defaults to the (architecture-dependent) temporary directory. Keep in mind that GEO series can be demanding in terms of storage space. |
RnBeadSet
object with phenotypic and beta value information.
Yassen Assenov, modified by Baris Kalem
Gets the supported region annotations for a given genome assembly.
rnb.region.types(assembly = "hg19")
rnb.region.types(assembly = "hg19")
assembly |
Genome assembly of interest. See |
Region types supported by RnBeads in the form of a character
vector. The built-in ones are
"cpgislands"
, "genes"
, "promoters"
and "tiling"
. The names of all custom region
definitions are also included in the returned vector.
Yassen Assenov
rnb.get.annotation
, rnb.set.annotation
"promoters" %in% rnb.region.types() # TRUE
"promoters" %in% rnb.region.types() # TRUE
Identifies the region types that are summarized by the given dataset and pointed to for analysis.
rnb.region.types.for.analysis(rnb.set)
rnb.region.types.for.analysis(rnb.set)
rnb.set |
Methylation dataset as an object of type inheriting |
This function intersects the value of the analysis option "region.types"
with the region types that are
summarized in the provided dataset. In case the option's value is NULL
, this function returns all summarized
region types in rnb.set
.
List of all region types to be analyzed in the current dataset in the form of a character
vector.
Yassen Assenov
rnb.getOption
for checking the value of the "region.types"
option;
summarized.regions
for obtaining the region types summarized in a
dataset
library(RnBeads.hg19) data(small.example.object) "promoters" %in% rnb.region.types.for.analysis(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) "promoters" %in% rnb.region.types.for.analysis(rnb.set.example)
Deletes a region annotation table. Use this function with caution; its operation cannot be undone.
rnb.remove.annotation(type, assembly = "hg19")
rnb.remove.annotation(type, assembly = "hg19")
type |
One-element |
assembly |
Genome assembly of interest. See |
Invisibly, TRUE
if the annotation has been successfully deleted, or FALSE
if the specified
region type is not supported.
Fabian Mueller
rnb.get.annotation
, rnb.region.types
t.regions <- rnb.get.annotation("tiling") rnb.remove.annotation("tiling")
t.regions <- rnb.get.annotation("tiling") rnb.remove.annotation("tiling")
Exports the beta values from a methylation dataset to BED files.
rnb.RnBSet.to.bed( rnb.set, out.dir, reg.type = "sites", names.quant.meth = TRUE, add.track.line = TRUE, lexicographic = FALSE, verbose = TRUE )
rnb.RnBSet.to.bed( rnb.set, out.dir, reg.type = "sites", names.quant.meth = TRUE, add.track.line = TRUE, lexicographic = FALSE, verbose = TRUE )
rnb.set |
Methylation dataset as an object of type inheriting |
out.dir |
Output directory. If not existing, it will be created. otherwise files in that directory are overwritten. |
reg.type |
Region type to be extracted. |
names.quant.meth |
should the names of the bed regions contain information on the methylation level.
If TRUE the following format is applied: meth_percent
|
add.track.line |
Add a track line to the bed file to enable browsers like IGV to display the data better |
lexicographic |
Should lexicographic ordering be used for chromosome names |
verbose |
More detailed logger output |
Details on the BED file format can be found in the UCSC Genome Browser
documentation. Each methylation site is an entry in the resulting bed file. The Score column corresponds
to a site's methylation value in the interval [0,1]
.
(invisibly) a summary list containing information on the conversion step.
elements are filenames
(a table containing information on which sample has been written to what filename)
and assembly
(a string indicating the assembly used by rnb.set
).
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.RnBSet.to.bed(rnb.set.example,tempdir())
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.RnBSet.to.bed(rnb.set.example,tempdir())
Exports the methylation data of an RnBSet
object to *.bedGraph
files.
rnb.RnBSet.to.bedGraph( rnb.set, out.dir = ".", reg.type = "sites", parameters = character(), digits = NULL )
rnb.RnBSet.to.bedGraph( rnb.set, out.dir = ".", reg.type = "sites", parameters = character(), digits = NULL )
rnb.set |
Dataset as an instance of class |
out.dir |
One-element |
reg.type |
Site or region type to be exported. |
parameters |
Named |
digits |
Optionally, number of significant digits after the decimal point to round methylation values to. If
specified, this parameter must be an |
The description of the BedGraph track format can be found here.
Each methylation site is an entry in the resulting bedGraph file. The Score column corresponds to a site's
methylation value in the interval [0,1]
.
(invisibly) a summary list containing information on the conversion step.
elements are filenames
(a table containing information on which sample has been written to what filename)
and assembly
(a string indicating the assembly used by rnb.set
).
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.RnBSet.to.bedGraph(rnb.set.example,tempdir())
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.RnBSet.to.bedGraph(rnb.set.example,tempdir())
convert an RnBSet
object to a GRangesList
object
rnb.RnBSet.to.GRangesList( rnb.set, reg.type = "sites", return.regular.list = FALSE )
rnb.RnBSet.to.GRangesList( rnb.set, reg.type = "sites", return.regular.list = FALSE )
rnb.set |
Object of class |
reg.type |
region type to be converted |
return.regular.list |
flag indicating whether a regular |
a GRangesList
or list
object with one list element (GRanges
) for each sample in rnb.set
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) result <- rnb.RnBSet.to.GRangesList(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) result <- rnb.RnBSet.to.GRangesList(rnb.set.example)
Starts the RnBeads analysis pipeline on the given dataset. It loads the dataset if it is specified as a location.
rnb.run.analysis( dir.reports, data.source = NULL, sample.sheet = NULL, data.dir = NULL, GS.report = NULL, GEO.acc = NULL, data.type = rnb.getOption("import.default.data.type"), initialize.reports = TRUE, build.index = TRUE, save.rdata = TRUE )
rnb.run.analysis( dir.reports, data.source = NULL, sample.sheet = NULL, data.dir = NULL, GS.report = NULL, GEO.acc = NULL, data.type = rnb.getOption("import.default.data.type"), initialize.reports = TRUE, build.index = TRUE, save.rdata = TRUE )
dir.reports |
Directory to host the generated report files. This must be a |
data.source |
Methylation dataset as an object of type inheriting |
sample.sheet |
A spreadsheet-like text file with sample annotations. The required columns are different
for different values of |
data.dir |
For |
GS.report |
GenomeStudio report file. |
GEO.acc |
Gene Expression Omnibus accession of the data series with HumanMethylation450 data.
|
data.type |
|
initialize.reports |
Flag indicating if the report's directory must be initialized. If this parameter is set to
|
build.index |
Flag indicating if a report index file (named |
save.rdata |
Flag indicating whether important data objects (the filtered and unfiltered RnBSets, differential methylation) should be saved to an RData file in the reports folder. |
Invisibly, the loaded, normalized and/or possibly filtered dataset as an object of type inheriting
RnBSet
.
Yassen Assenov
Starts the RnBeads Data Juggler (RnBeadsDJ) for configuring and running RnBeads analyses from the web browser
rnb.run.dj()
rnb.run.dj()
A Shiny app is launched in the web browser
Nothing of particular interest
Fabian Mueller
rnb.run.analysis
for starting an analysis pipeline
Executes the analysis pipeline for an example from the RnBeads web site.
rnb.run.example(index = 4L, dir.output = "example")
rnb.run.example(index = 4L, dir.output = "example")
index |
Example to start. This must be one of |
dir.output |
One-element |
For more information about the examples, please visit the dedicated page on the RnBeads web site.
Invisibly, the loaded, normalized and/or possibly filtered dataset as an object of type inheriting
RnBSet
.
Yassen Assenov
rnb.run.analysis
for starting the analysis pipeline from a local data source
rnb.run.example()
rnb.run.example()
Functions that start the predefined modules in the RnBeads analysis pipeline.
rnb.run.import( data.source, data.type = rnb.getOption("import.default.data.type"), dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.qc( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.preprocessing( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.inference( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.tnt( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.exploratory( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.differential( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE )
rnb.run.import( data.source, data.type = rnb.getOption("import.default.data.type"), dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.qc( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.preprocessing( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.inference( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.tnt( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.exploratory( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE ) rnb.run.differential( rnb.set, dir.reports, init.configuration = !file.exists(file.path(dir.reports, "configuration")), close.report = TRUE, show.report = FALSE )
data.source |
|
data.type |
|
dir.reports |
Directory to host the generated report file. Note that if this directory contains files, they may be overwritten. |
init.configuration |
Flag indicating if the configuration directory (usually shared among reports) should also be created. |
close.report |
Flag indicating if the created report is to be closed using the
|
show.report |
Flag indicating if the report is to be displayed after it is created. If this is,
|
rnb.set |
Methylation dataset as an object of type inheriting |
The functions start the import, quality control, preprocessing, covariate inference, tracks and tables, exploratory analysis and differential methylation modules, respectively.
For rnb.run.import
, rnb.run.preprocessing
and rnb.run.inference
, the returned value is
a list of two elements - the initialized or modified dataset and the created report. All other functions
return the created report, invisibly.
Yassen Assenov
rnb.run.analysis
which executes these modules in the order given above
### Running the modules step by step # Directory where your data is located data.dir <- "~/RnBeads/data/Ziller2011_PLoSGen_450K" idat.dir <- file.path(data.dir, "idat") sample.annotation <- file.path(data.dir, "sample_annotation.csv") # Directory where the output should be written to analysis.dir <- "~/RnBeads/analysis" # Directory where the report files should be written to report.dir <- file.path(analysis.dir, "reports_details") rnb.initialize.reports(report.dir) # Set some analysis options rnb.options(filtering.sex.chromosomes.removal = TRUE, identifiers.column = "Sample_ID") ## Restrict logging to the console only logger.start(fname = NA) ## Data import data.source <- c(idat.dir, sample.annotation) result <- rnb.run.import(data.source=data.source, data.type="idat.dir", dir.reports=report.dir) rnb.set <- result$rnb.set ## Quality Control rnb.run.qc(rnb.set, report.dir) ## Preprocessing rnb.set <- rnb.run.preprocessing(rnb.set, dir.reports=report.dir)$rnb.set ## Data export rnb.options(export.to.csv = TRUE) rnb.run.tnt(rnb.set, report.dir) ## Exploratory analysis rnb.run.exploratory(rnb.set, report.dir) ## Differential methylation rnb.run.differential(rnb.set, report.dir)
### Running the modules step by step # Directory where your data is located data.dir <- "~/RnBeads/data/Ziller2011_PLoSGen_450K" idat.dir <- file.path(data.dir, "idat") sample.annotation <- file.path(data.dir, "sample_annotation.csv") # Directory where the output should be written to analysis.dir <- "~/RnBeads/analysis" # Directory where the report files should be written to report.dir <- file.path(analysis.dir, "reports_details") rnb.initialize.reports(report.dir) # Set some analysis options rnb.options(filtering.sex.chromosomes.removal = TRUE, identifiers.column = "Sample_ID") ## Restrict logging to the console only logger.start(fname = NA) ## Data import data.source <- c(idat.dir, sample.annotation) result <- rnb.run.import(data.source=data.source, data.type="idat.dir", dir.reports=report.dir) rnb.set <- result$rnb.set ## Quality Control rnb.run.qc(rnb.set, report.dir) ## Preprocessing rnb.set <- rnb.run.preprocessing(rnb.set, dir.reports=report.dir)$rnb.set ## Data export rnb.options(export.to.csv = TRUE) rnb.run.tnt(rnb.set, report.dir) ## Exploratory analysis rnb.run.exploratory(rnb.set, report.dir) ## Differential methylation rnb.run.differential(rnb.set, report.dir)
Starts the analysis pipeline from an XML configuration file. This function uses the XML package to parse the configuration file.
rnb.run.xml(fname, create.r.command = FALSE)
rnb.run.xml(fname, create.r.command = FALSE)
fname |
XML configuration file to read. |
create.r.command |
Flag indicating if the R command(s) that correspond to the given XML configuration should be
generated. If this is set to |
Two values are required to be specified (as tags) in the configuration file - data.source
and
dir.reports
. They define the input and output directory, respectively. In addition, the file may define
analysis option values. The vignette Comprehensive DNA Methylation Analysis with RnBeads describes in details
the syntax of the XML configuration file.
The sample annotation table must be stored as a file in data.source
. For more information about the required
parameters, see the documentation of rnb.run.analysis
, which is called by this function.
Invisibly, the loaded, normalized and/or possibly filtered dataset as an object of type inheriting
RnBSet
.
Yassen Assenov
rnb.run.analysis
for starting an analysis pipeline
Identifies sample subgroups defined in the given annotation information.
rnb.sample.groups( annotations, columns = NULL, columns.pairs = NULL, min.group.size = rnb.getOption("min.group.size"), max.group.count = rnb.getOption("max.group.count") )
rnb.sample.groups( annotations, columns = NULL, columns.pairs = NULL, min.group.size = rnb.getOption("min.group.size"), max.group.count = rnb.getOption("max.group.count") )
annotations |
Methylation dataset as an object of type inheriting |
columns |
Optional; predefined column names (in the form of a |
columns.pairs |
Optional; a NAMED vector containing for each column name for which paired comparisons should be performed (say columnA) the name or index of another column (say columnB) in which same values indicate the same pairing. columnA should be the name of the value columnB in this vector. |
min.group.size |
Minimum number of samples in each subgroup. This must be a positive |
max.group.count |
Maxumum number of subgroups defined by a trait. This must be an |
List of traits that define subgroups in the dataset. For each trait, the defined subgroups are represented by
a list of integer
vectors storing the corresponding sample indices.
Yassen Assenov
library(RnBeads.hg19) data(small.example.object) str(rnb.sample.groups(rnb.set.example))
library(RnBeads.hg19) data(small.example.object) str(rnb.sample.groups(rnb.set.example))
Identifies sample replicates defined in the given sample annotation table.
rnb.sample.replicates(rnb.set, replicate.id.col)
rnb.sample.replicates(rnb.set, replicate.id.col)
rnb.set |
Methylation dataset as an object of type inheriting |
replicate.id.col |
Trait (column name in the sample annotation table) that indicates sample replicates. Replicates should have the same value for this trait, while samples without replicates are expected to have unique values or missing values. |
List of length of the number of replicates in the dataset. Each element is an integer
vector storing
the corresponding sample indices.
Fabian Mueller
Creates a sample summary table from an RnBSet object
rnb.sample.summary.table(rnbSet)
rnb.sample.summary.table(rnbSet)
rnbSet |
|
a summary table (as data.frame) with the following variables for each sample (rows):
sampleName |
Name of the sample |
*_num (* can be 'sites' or a region type) |
Number of sites or regions with coverage in the sample |
*_covgMean (RnBiseqSet only) |
Mean coverage of sites or regions in the sample |
*_covgMedian (RnBiseqSet only) |
Median coverage of sites or regions in the sample |
*_covgPerc25 (RnBiseqSet only) |
25 percentile of coverage of sites or regions in the sample |
*_covgPerc75 (RnBiseqSet only) |
75 percentile of coverage of sites or regions in the sample |
*_numCovg5 , 10 , 30 , 60 (RnBiseqSet only)
|
Number of sites or regions with coverage greater or equal to 5,10,30,60 |
sites_numDPval5em2 , 1em2 , 1em3 (RnBeadSet only)
|
Number of sites with a detection p-value smaller than 0.05,0.01,0.001 |
**_numSitesMean (** is any region type) |
Mean number of sites in a region |
**_numSitesMedian |
Median number of sites in a region |
**_numSites2 , 5 , 10 , 20
|
Number of regions with at least 2,5,10,20 sites with valid methylation measurements |
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.sample.summary.table(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) rnb.sample.summary.table(rnb.set.example)
Saves the specified region annotation table and its accompanying data structures to a binary file.
rnb.save.annotation(fname, type, assembly = "hg19")
rnb.save.annotation(fname, type, assembly = "hg19")
fname |
One-element |
type |
One-element |
assembly |
Genome assembly of interest. See |
This function is used in combination with rnb.load.annotation
to enable fast reloading of custom region
annotations. If can also be used to save a build-in region annotation (e.g. before overwriting it) but not site or
control probe annotations.
TRUE
, invisibly.
Yassen Assenov
rnb.load.annotation
for loading a saved annotation
Adds information for differentially variable regions to the report.
rnb.section.diffVar.region( rnb.set, diff.meth, report, gzTable = FALSE, level = 1 )
rnb.section.diffVar.region( rnb.set, diff.meth, report, gzTable = FALSE, level = 1 )
rnb.set |
Object of type |
diff.meth |
RnBDiffMeth object. See |
report |
Report object to which the content is added |
gzTable |
Flag indicating if tables should be gzipped |
level |
Which level of section should be created. See |
The modified report object
Michael Scherer
Adds or replaces a region annotation table.
rnb.set.annotation(type, regions, description = NULL, assembly = "hg19")
rnb.set.annotation(type, regions, description = NULL, assembly = "hg19")
type |
One-element |
regions |
BED file defining regions (see Details). Alternatively, the value of this parameter can be
a table of genomic regions in the form of a |
description |
Optional; short description in the form of a non-empty |
assembly |
Genome assembly of interest. See |
In case the parameter regions
specifies an existing BED file, regions are loaded from this file. The number of
columns defined must be at least 3. Columns after the sixth one, if present, are dropped. The columns are given the
following names: "chromosome"
, "start"
, "end"
, "id"
, "score"
and "strand"
.
The annotation tables in RnBeads focus on chromosomes "chr1"
, "chr2"
, ..., "chr22"
,
"chrX"
and "chrY"
. Regions on other chromosomes are ignored. This function also recognizes the
convention of chromosome names such as "1"
, adopted, for example, by Ensembl.
Apart from this, the region definition table is not examined in details by this function; therefore, regions located
on unsupported chromosomes or having invalid (e.g. negative) genomic coordinates are simply not mapped to any sites
or probes.
Invisibly, TRUE
if an existing annotation was replaced and FALSE
otherwise.
Yassen Assenov
rnb.get.annotation
for extracting annotation;
rnb.region.types
for all loaded region types in a genome assembly
my.regions <- data.frame( chromosome = c("chr1", "chr1"), start = c(49242278L, 49242372L), end = c(49242590L, 49242810L), rownames = c("BEND5E1", "CpG:38")) txt <- "First exon of the BEND5 gene and an overlapping CpG island." rnb.set.annotation("my regions", my.regions, txt)
my.regions <- data.frame( chromosome = c("chr1", "chr1"), start = c(49242278L, 49242372L), end = c(49242590L, 49242810L), rownames = c("BEND5E1", "CpG:38")) txt <- "First exon of the BEND5 gene and an overlapping CpG island." rnb.set.annotation("my regions", my.regions, txt)
wrapper for rnb.set.annotation
to accept the region format as output by annotation(rnb.set)
.
Additionally, CpG statistics are added to the annotation.
rnb.set.annotation.and.cpg.stats( type, regions, description = NULL, assembly = "hg19" )
rnb.set.annotation.and.cpg.stats( type, regions, description = NULL, assembly = "hg19" )
type , description , assembly
|
Parameters handled exactly as in |
regions |
a data.frame handled similarly as by |
Invisibly, TRUE
if an existing annotation was replaced and FALSE
otherwise.
Fabian Mueller
Opens the given HMTL report file in the browser.
rnb.show.report(report)
rnb.show.report(report)
report |
|
None (invisible NULL
).
Pavlo Lutsik
Computes the distributions of beta values across various sample groups and adds a corresponding section to the report.
rnb.step.betadistribution( rnb.set, report, columns = rnb.getOption("exploratory.columns"), points.per.group = rnb.getOption("distribution.subsample") )
rnb.step.betadistribution( rnb.set, report, columns = rnb.getOption("exploratory.columns"), points.per.group = rnb.getOption("distribution.subsample") )
rnb.set |
HumanMethylation450K dataset as an object of type |
report |
Report to contain the methylation deviation section. This must be an object of type
|
columns |
Optional; predefined column names (in the form of a |
points.per.group |
the targeted number of points (T) per group. Set this to a value < 1 to disable subsampling. More information in the Details section |
The modified report.
If subsampling is enabled (i.e. points.per.group
>0),
observations per group are subsampled according to the following procedure:
Given K groups and numbers of observed beta values per group
N_1,...,N_K, and the target number of points per group T: the total number of points N = sum(N_1,...,N_K) is computed
Afterwards the proportions p_k = N_k/N is computed and from each group, S_k = p_k*(K*T) observations
are randomly selected from all observations belonging to group k.
Fabian Mueller
Performs copy number calling from the Infinium intenstity data and adds the results to the report
rnb.step.cnv(rnb.set, report)
rnb.step.cnv(rnb.set, report)
rnb.set |
An object of type |
report |
Report on quality control to contain the generated sections. This must be an object of type
|
The modified report.
Pavlo Lutsik
Writes a table to a file. Different formats and compression options are available.
rnb.write.table(tt, fname, fpath = "", format = "csv", gz = FALSE, ...)
rnb.write.table(tt, fname, fpath = "", format = "csv", gz = FALSE, ...)
tt |
Table to be written to file, usually in the form of a |
fname |
Target file name. If this file already exists, it will be overwritten. |
fpath |
Target file path. If "" (default value), |
format |
Target format; one of |
gz |
Flag indicating whether the file should be zipped in |
... |
Any additional arguments to be passed on to |
The (possibly updated) target file name, invisibly. If gz
is TRUE
, the string ".gz"
will
be appended to fname
.
Fabian Mueller
data(mtcars) rnb.write.table(mtcars,tempfile(pattern="cars",fileext=".csv"))
data(mtcars) rnb.write.table(mtcars,tempfile(pattern="cars",fileext=".csv"))
Parses and partially validates parameters and RnBeads options from an XML tree.
rnb.xml2options(fname, return.full.structure = FALSE)
rnb.xml2options(fname, return.full.structure = FALSE)
fname |
File name containing the XML analysis option values. The name of the root node in this document must be
|
return.full.structure |
if enabled, return the full structure instead of just the option list |
List of two sublists - "analysis.params"
and "options"
, storing the specified analysis
parameters and previous values of the RnBeads options, respectively.
Yassen Assenov
fname <- paste0("extdata/optionProfiles/",profile,".xml") rnb.xml2options(system.file(fname,package="RnBeads"))
fname <- paste0("extdata/optionProfiles/",profile,".xml") rnb.xml2options(system.file(fname,package="RnBeads"))
A class for configuring and running RnBeads on a scientific compute cluster.
architecture
A ClusterArchitecture
object managing the settings for a scientific compute cluster
modules
A vector of pipeline modules
module.res.req
Stores the resource requirements for each module. A list containing named vectors for the resources
module.num.cores
Stores the number of cores for each module
setModuleResourceRequirements,RnBClusterRun,character,character-method
Sets the resource requirements for the different pipeline modules
setModuleNumCores,RnBClusterRun,integer,character-method
Sets the number of cores used by the different pipeline modules
getModuleNumCores,RnBClusterRun-method
Gets the number of cores used by the different pipeline modules
run,RnBClusterRun-method
Submit the pipeline modules to the cluster
Fabian Mueller
A class for storing differential methylation data.
Contains differential methylation tables (DMT) for multiple comparisons and region types. DMTs can be stored in memory as R objects or on disk
sites
List of differential methylation tables on site level (see computeDiffMeth.bin.site
for details).
Indexed by comparison.
regions
List of lists of differential methylation tables on region levels (see computeDiffMeth.bin.region
for details).
Indexed by region type on the top level and comparison on the lower level.
comparisons
character vector of all comparisons stored in the objects. Vector indices correspond to indices in the sites
and
regions
list slots.
region.types
character vector of all region types stored in the objects. Vector indices correspond to indices in
the regions
list slot.
comparison.grouplabels
A character matrix with 2 columns containing group labels of all comparisons in the object
comparison.info
A list containing comparison information for each comparison. See get.comparison.info
for details.
includesSites
Logical indicating whether the object contains site-level differential methylation information.
site.test.method
method which was applied to obtain the site-level p-values.
variability.method
method to be used to detect differentially variable sites.
covg.thres
coverage threshold. Important for certain columns of the differential methylation tables.
disk.dump
Flag indicating whether the tables should be stored on disk rather than in the main memory
disk.path
path on the disk for DMTs.Only meaningful if disk.dump
is TRUE
destroy,RnBDiffMeth-method
remove tables stored to disk from the file system
get.region.types,RnBDiffMeth-method
Gets all region types represented in the object as character vector
get.comparisons,RnBDiffMeth-method
Gets all comparisons represented in the object as character vector
get.comparison.grouplabels,RnBDiffMeth-method
Gets all comparison group names as a matrix
get.covg.thres,RnBDiffMeth-method
Gets the coverage threshold employed for obtaining statistics in the differential methylation tables
get.table,RnBDiffMeth-method
Gets a differential methylation table
addDiffMethTable,RnBDiffMeth-method
Adds a differential methylation table
reload,RnBDiffMeth-method
relink disk dumped tables. Useful if the files are manually copied or if the object is loaded again
save.tables,RnBDiffMeth-method
save disk dumped tables as binaries and zip them. Useful if the files are copied or shared.
join.diffMeth
Merges two disjoint RnBDiffMeth objects into one
Fabian Mueller
Storage class for the results of a clustering algorithm applied on an RnBSet
dataset.
Dissimilarity metric used in the form of a one-element character
vector.
Dimensionality of the clustered points in the form of a one-element integer
vector.
Clustering algorithm (and optionally, type) as a character
vector of length 1 or 2.
Resulting object after applying the clustering algorithm on a dataset.
Cluster assignments for the samples in the dataset as a matrix. Row names in this matrix are sample identifiers, and each column is dedicated to partitioning into k clusters for a fixed k.
numeric
vector of mean silhouette values for each tested value of k.
samples
Gets the identifiers of all samples used in the clustering.
Yassen Assenov
Main class for storing HumanMethylation micorarray data which includes intensity information
RnBeadRawSet( pheno, probes, M, U, M0 = NULL, U0 = NULL, bead.counts.M = NULL, bead.counts.U = NULL, p.values = NULL, qc = NULL, platform = "450k", beta.offset = 100, summarize.bead.counts = TRUE, summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(ifelse(platform == "MMBC", "mm10", ifelse(target == "probesEPICv2", "hg38", rnb.getOption("assembly")))), useff = rnb.getOption("disk.dump.big.matrices"), ffcleanup = FALSE )
RnBeadRawSet( pheno, probes, M, U, M0 = NULL, U0 = NULL, bead.counts.M = NULL, bead.counts.U = NULL, p.values = NULL, qc = NULL, platform = "450k", beta.offset = 100, summarize.bead.counts = TRUE, summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(ifelse(platform == "MMBC", "mm10", ifelse(target == "probesEPICv2", "hg38", rnb.getOption("assembly")))), useff = rnb.getOption("disk.dump.big.matrices"), ffcleanup = FALSE )
pheno |
Phenotypic data. |
probes |
|
M |
Matrix of intensities for the probes measuring the abundance of methylated molecules |
U |
Matrix of intensities for the probes measuring the abundance of unmethylated molecules |
M0 |
Matrix of "out-of-band" intensities for the probes measuring the abundance of methylated molecules |
U0 |
Matrix of "out-of-band" intensities for the probes measuring the abundance of unmethylated molecules |
bead.counts.M |
Matrix of bead counts per probe. |
bead.counts.U |
Matrix of bead counts per probe. |
p.values |
Matrix of detection p-values. |
qc |
... |
platform |
|
beta.offset |
A regularization constant which is added to the denominator at beta-value calculation |
summarize.bead.counts |
If |
summarize.regions |
... |
region.types |
A |
useff |
If |
ffcleanup |
If |
an object of class RnBeadRawSet
pheno
Phenotypic data.
M
matrix
of intensities for the probes measuring the abundance of methylated molecules.
U
matrix
of intensities for the probes measuring the abundance of unmethylated molecules.
M0
matrix
of "out-of-band" intensities for the probes measuring the abundance of methylated molecules.
U0
matrix
of "out-of-band" intensities for the probes measuring the abundance of unmethylated molecules.
bead.counts.M
matrix
of bead counts per probe.
bead.counts.U
matrix
of bead counts per probe.
samples
Gets the identifiers of all samples in the dataset.
M
Get the matrix of intensities for the probes measuring the abundance of methylated molecules.
U
Get the matrix of intensities for the probes measuring the abundance of unmethylated molecules.
intensities.by.color
Get probe intensities in each color channel.
Pavlo Lutsik
RnBeads facilitates comprehensive analysis of various types of DNA methylation data at the genome scale. It extends previous approaches for such analysis by high throughput capabilities, as well as presenting results in a comprehensive, highly interpretable fashion.
The complete analysis can be performed by calling the function rnb.run.analysis
.
Maintainer: Fabian Mueller [email protected]
Authors:
Yassen Assenov [email protected]
Christoph Bock [email protected]
Pavlo Lutsik [email protected]
Michael Scherer [email protected]
Yassen Assenov*, Fabian Mueller*, Pavlo Lutsik*, Joern Walter, Thomas Lengauer and Christoph Bock (2014) Compehensive Analysis of DNA Methylation Data with RnBeads, Nature Methods, 11(11):1138-1140.
RnBeads uses sets of annotation tables and mappings (from regions to sites) for each of the supported genomes. The structures for one assembly are stored in a separate dedicated annotation package. The following annotation packages are available in Bioconductor:
for "hg38"
for "hg19"
for "mm10"
for "mm9"
for "rn5"
list
of four elements - "regions"
, "sites"
, "controls"
and "mappings"
.
These elements are described below.
"regions"
list
of NULL
s; the names of the elements correspond to the built-in
region annotation tables. Once the default annotations are loaded, the attribute "builtin"
is
a logical
vector storing, for each region annotation, whether it is the default (built-in) or
custom.
"sites"
list
of NULL
s; the names of the elements correspond to the site and
probe annotation tables.
"controls"
list
of NULL
s; the names of the elements correspond to the control
probe annotation tables. The attribute "sites"
is a character
vector pointing to the
site annotation that encompasses the respective control probes.
"mappings"
list
of NULL
s; the names of the elements correspond to the built-in
region annotation tables.
An assembly-specific scaffold is automatically loaded upon initialization of its annotation, that is, by the first
valid call to any of the following functions: rnb.get.chromosomes
,
rnb.get.annotation
, rnb.set.annotation
, rnb.get.mapping
,
rnb.annotation.size
. Adding an annotation amounts to attaching its table(s) and mapping structures to
the scaffold.
Yassen Assenov
Stores the preprocessed information from HumanMethylation experiments
RnBeadSet( pheno, probes, betas, p.values = NULL, bead.counts = NULL, qc = NULL, platform = "450k", summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(ifelse(platform == "MMBC", "mm10", rnb.getOption("assembly"))), useff = rnb.getOption("disk.dump.big.matrices") )
RnBeadSet( pheno, probes, betas, p.values = NULL, bead.counts = NULL, qc = NULL, platform = "450k", summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(ifelse(platform == "MMBC", "mm10", rnb.getOption("assembly"))), useff = rnb.getOption("disk.dump.big.matrices") )
pheno |
Phenotypic data. |
probes |
|
betas |
|
p.values |
|
bead.counts |
... |
qc |
... |
platform |
|
summarize.regions |
... |
region.types |
A |
useff |
If |
There are multiple ways to create an object of type RnBeadSet
:
Dataset can be loaded from text or binary files. See the function
rnb.execute.import
for more details.
See the function rnb.read.geo
for details.
MethyLumiSet
...
an object of class RnBeadSet
pval.sites
matrix
of detection p-values with the same dimensions as betas
, or
NULL
if the detection p-values are not available.
pval.regions
list
of methylation matrix
objects, one per available region type. Every row in a
matrix corresponds to a methylation site, and every column - to a sample.
covg.sites
matrix
of bead counts per probe with the same dimensions as betas
, or
NULL
if this data are not available.
qc
Quality control probe information in the form of a list
of two elements - "Cy3"
and
"Cy5"
, storing intensities of probes on the green and red channels, respectively. This slot's value is
NULL
if no control probe information is available.
samples
Gets the identifiers of all samples in the dataset.
pheno
Gets the phenotypic and processing data of the dataset.
meth
Gets the matrix
of methylation beta-values of the dataset.
dpval
Gets the matrix
of detection p-values of the dataset.
covg
Gets the matrix
of bead counts of the dataset.
qc
Gets the intensities of the quality control probes.
remove.sites
Removes probes from the dataset.
remove.samples
Removes samples from the dataset.
combine
Combines two datasets.
Pavlo Lutsik
A class for storing the DNA methylation and quality information from bisulfite sequencing experiments
RnBiseqSet( pheno, sites, meth, covg = NULL, assembly = "hg19", target = "CpG", summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(assembly), useff = rnb.getOption("disk.dump.big.matrices"), usebigff = rnb.getOption("disk.dump.bigff"), verbose = FALSE )
RnBiseqSet( pheno, sites, meth, covg = NULL, assembly = "hg19", target = "CpG", summarize.regions = TRUE, region.types = rnb.region.types.for.analysis(assembly), useff = rnb.getOption("disk.dump.big.matrices"), usebigff = rnb.getOption("disk.dump.bigff"), verbose = FALSE )
pheno |
phenotypic data. |
sites |
CpG site definition, as a |
meth |
summarized methylation calls as a |
covg |
read coverage information as a |
assembly |
the genome assembly |
target |
target DNA methylation features (CpG sites) |
summarize.regions |
... |
region.types |
region annotations for which the methylation data should be summarized |
useff |
flag specifying whether the ff functionality should be used |
usebigff |
flag specifying whether the extended ff functionality should be used (large matrix support for ff) |
verbose |
flag specifying whether the diagnostic messages should be written to the console or to the RnBeads logger, if the latter is initialized |
TBA
an object of class RnBiseqSet
status
Normalization status.
combine
Combines two datasets.
Pavlo Lutsik
Basic class for storing DNA methylation and experimental quality information
It is a virtual class and objects of type RnBSet
should not be instantiated. Instead, the child classes are
used: RnBeadRawSet
and RnBeadSet
for Infinium HumanMethylation and
RnBiseqSet
for bisulfite sequencing data
pheno
Sample annotations (phenotypic and processing data) in the form of a data.frame
.
sites
A matrix
object storing the identifiers of the methylation sites for which the
methylation information is present
meth.sites
matrix
of methylation values. Every row corresponds to a methylation site,
and every column - to a sample.
covg.sites
matrix
of coverage values. Every row corresponds to a methylation site,
and every column - to a sample.
regions
list
of all identifiers of methylation sites for which methylation information
is available.
meth.regions
list
of methylation matrix
objects, one per available region type. Every row in a
matrix corresponds to a methylation site, and every column - to a sample.
covg.regions
list
of coverage matrix
objects, one per available region type.
Every row corresponds to a region, and every column - to a sample.
status
list
with meta-information about the object.
assembly
character
vector of length one, specifying the genome assembly which the object is linked to, e.g. "hg19".
target
character
vector of length one, specifying the feature class:
"CpG"
for sequencing data, "probes450"
and "probes27"
for
HumanMethylation450 and HumanMethylation27 microarrays respectively.
inferred.covariates
list
with covariate information.
Can contain elements "sva"
and "cell.types"
.
version
Package version in which the dataset was created.
imputed
Flag indicating if methylation matrix has been imputed.
pheno
Gets the phenotypic and processing data of the dataset.
samples
Gets the identifiers of all samples in the dataset.
summarized.regions
Gets the genomic annotations for which methylation data is present.
meth
Gets a matrix
of methylation values in the dataset.
mval
Gets a matrix
of M values in the dataset.
covg
Gets the matrix
of coverage values of the dataset.
remove.sites
Removes sites from the dataset.
remove.samples
Removes samples from the dataset.
addPheno,RnBSet-method
Add sample annotation to the dataset.
combine
Combines two datasets.
regionMapping,RnBSet-method
Retrieve the sites mapping to a given region type
rnb.sample.summary.table
Creates a sample summary table from an RnBSet object.
isImputed,RnBSet-method
Getter for the imputation slot.
Pavlo Lutsik
performs a two-sided t-test for paired samples on each row of a matrix X with the indices inds.1 vs indices inds.g2 as group assignments.
rowOneSampleTP(X, mu = 0, alternative = "two.sided")
rowOneSampleTP(X, mu = 0, alternative = "two.sided")
X |
Matrix on which the test is performed for every row |
mu |
The mean that is tested against |
alternative |
Testing alternative. Must be one of "two.sided" (default),"less","greater" or "all". in case of "all" a data frome with corresping alternative variables is returned. Otherwise the result is a vector. |
vector (or data.frame if alternative=="all") of p-values from a paired t-test
Requires matrixStats
package
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) p.vals <- rowOneSampleTP(meth.mat,mu=0,alternative="greater")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) p.vals <- rowOneSampleTP(meth.mat,mu=0,alternative="greater")
performs a two-sided t-test for paired samples on each row of a matrix X with the indices inds.1 vs indices inds.g2 as group assignments.
rowPairedTP(X, inds.g1, inds.g2 = -inds.g1, alternative = "two.sided")
rowPairedTP(X, inds.g1, inds.g2 = -inds.g1, alternative = "two.sided")
X |
Matrix on which the test is performed for every row |
inds.g1 |
column indices of group 1 members. |
inds.g2 |
column indices of group 2 members. |
alternative |
Testing alternative. Must be one of "two.sided" (default),"less","greater" or "all". in case of "all" a data frome with corresping alternative variables is returned. Otherwise the result is a vector. |
vector (or data.frame if alternative=="all") of p-values from a paired t-test
Requires matrixStats
package
Fabian Mueller
performs a two-sided Welch's t-test (unequal variances, unequal sample sizes) on each row of a matrix X with the indices inds.1 vs indices inds.g2 as group assignments.
rowWelchP( X, inds.g1, inds.g2 = -inds.g1, na.rm = FALSE, alternative = "two.sided" )
rowWelchP( X, inds.g1, inds.g2 = -inds.g1, na.rm = FALSE, alternative = "two.sided" )
X |
Matrix on which the test is performed for every row |
inds.g1 |
column indices of group 1 members |
inds.g2 |
column indices of group 2 members |
na.rm |
Should NAs be removed (logical) |
alternative |
Testing alternative. Must be one of "two.sided" (default),"less","greater" or "all". in case of "all" a data frome with corresping alternative variables is returned. Otherwise the result is a vector. |
vector (or data.frame if alternative=="all") of p-values resulting from the Welch's t-test
Requires matrixStats
package
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] p.vals <- rowWelchP(meth.mat,sample.groups[[1]],sample.groups[[2]])
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) meth.mat <- meth(rnb.set.example) sample.groups <- rnb.sample.groups(rnb.set.example)[[1]] p.vals <- rowWelchP(meth.mat,sample.groups[[1]],sample.groups[[2]])
Runs the analysis by submitting jobs for each module to the compute cluster
## S4 method for signature 'RnBClusterRun' run( object, analysis.id, config.xml, split.differential = TRUE, dry.run = FALSE, long.cmd.thres = 1024L, queue = NULL )
## S4 method for signature 'RnBClusterRun' run( object, analysis.id, config.xml, split.differential = TRUE, dry.run = FALSE, long.cmd.thres = 1024L, queue = NULL )
object |
|
analysis.id |
analysis id. used for naming submitted jobs and log files |
config.xml |
XML file specifying the analysis options and parameter settings |
split.differential |
flag indicating whether to split the differnetial methylation module into seperate jobs according to sample annotation column and region type. |
dry.run |
Prevent the actual job submission. Rather only write to a shell script file |
long.cmd.thres |
commands that are longer than this number will be encapsulated in shell scripts rather than being submitted as direct command |
queue |
The name of the queue the jobs are going to be submitted to |
Nothing of importance
Fabian Mueller
#specify the xml file for your analysis xml.file <- "MY_ANALYSIS_SETTINGS.XML" #set the cluster architecture specific to your environment arch <- new("ClusterArchitectureSGE") rnb.cr <- new("RnBClusterRun",arch) #set up the cluster so that 32GB of memory are required (SGE resource is called "mem_free") rnb.cr <- setModuleResourceRequirements(rnb.cr,c(mem_free="32G"),"all") #set up the cluster to use 4 cores on each node for all modules rnb.cr <- setModuleNumCores(rnb.cr,4L,"all") #set up the cluster to use 2 cores for the exploratory analysis module rnb.cr <- setModuleNumCores(rnb.cr,2L,"exploratory") #run the actual analysis (remove dry.run=TRUE, to really submit the jobs) run(rnb.cr, "rnbeads_analysis", xml.file, dry.run=TRUE)
#specify the xml file for your analysis xml.file <- "MY_ANALYSIS_SETTINGS.XML" #set the cluster architecture specific to your environment arch <- new("ClusterArchitectureSGE") rnb.cr <- new("RnBClusterRun",arch) #set up the cluster so that 32GB of memory are required (SGE resource is called "mem_free") rnb.cr <- setModuleResourceRequirements(rnb.cr,c(mem_free="32G"),"all") #set up the cluster to use 4 cores on each node for all modules rnb.cr <- setModuleNumCores(rnb.cr,4L,"all") #set up the cluster to use 2 cores for the exploratory analysis module rnb.cr <- setModuleNumCores(rnb.cr,2L,"exploratory") #run the actual analysis (remove dry.run=TRUE, to really submit the jobs) run(rnb.cr, "rnbeads_analysis", xml.file, dry.run=TRUE)
This function performs 10-fold cross validation to estimate the performance of a
newly trained predictor. If parallel.isEnabled()
, the function perfoms cross
validation in parallel. The function adds a table to the specified report
containing
the result of the 10-fold cross validation.
run.cross.validation(rnbSet, report, alpha = 0.8)
run.cross.validation(rnbSet, report, alpha = 0.8)
rnbSet |
a |
report |
report to which the table should be added |
alpha |
alpha parameter used in the elastic net regression |
modified report object
Michael Scherer
Applies a function over the coverage values for all samples in an RnBSet
using a low memory footprint.
## S4 method for signature 'RnBSet' sampleCovgApply(object, fn, type = "sites", ...)
## S4 method for signature 'RnBSet' sampleCovgApply(object, fn, type = "sites", ...)
object |
object inheriting from |
fn |
function to be applied |
type |
|
... |
arguments passed on to the function |
Result analogous to apply(covg(rnbSet, type), 2, FUN=FUN)
covg
Retrieving the matrix of coverage values
Applies a function over the methylation values for all samples in an RnBSet
using a low memory footprint.
## S4 method for signature 'RnBSet' sampleMethApply(object, fn, type = "sites", ...)
## S4 method for signature 'RnBSet' sampleMethApply(object, fn, type = "sites", ...)
object |
object inheriting from |
fn |
function to be applied |
type |
|
... |
arguments passed on to the function |
Result analogous to apply(meth(rnbSet, type), 2, FUN=FUN)
meth
Retrieving the matrix of methylation values
Extracts sample identifiers
## S4 method for signature 'RnBSet' samples(object) ## S4 method for signature 'RnBeadClustering' samples(object)
## S4 method for signature 'RnBSet' samples(object) ## S4 method for signature 'RnBeadClustering' samples(object)
object |
Dataset of interest. |
The column of the sample annotation table which contains identifiers is globally controlled via the
"identifiers.column"
option. In case the latter is NULL
column names of the matrix returned
by the meth
method are treated as sample identifiers. In case the latter are also missing, a character
vector with sample numbers is returned.
character
vector of sample identifiers.
library(RnBeads.hg19) data(small.example.object) samples(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) samples(rnb.set.example)
save an RnBDiffMeth
object to disk
save.rnb.diffmeth(object, path)
save.rnb.diffmeth(object, path)
object |
|
path |
path on the disk to save to. |
Fabian Mueller
Consistent saving of an RnBSet
objects with large matrices of type ff.
save.rnb.set(object, path, archive = TRUE)
save.rnb.set(object, path, archive = TRUE)
object |
|
path |
the name of the output file (or directory if |
archive |
if |
The saved object can be reloaded with the load.rnb.set function.
invisibly, the full path to the ZIP file (if archive
is TRUE
),
or to the output directory (otherwise)
Pavlo Lutsik
save the disk dumped tables to an ff archive for later reloading
## S4 method for signature 'RnBDiffMeth' save.tables(object, file)
## S4 method for signature 'RnBDiffMeth' save.tables(object, file)
object |
|
file |
path on the disk to save to. |
success
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) pcols <- c("Sample_Group","Treatment") tdir <- tempfile() dm <- rnb.execute.computeDiffMeth(rnb.set.example,pcols,disk.dump=TRUE,disk.dump.dir=tdir) save.tables(dm,tempfile())
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) pcols <- c("Sample_Group","Treatment") tdir <- tempfile() dm <- rnb.execute.computeDiffMeth(rnb.set.example,pcols,disk.dump=TRUE,disk.dump.dir=tdir) save.tables(dm,tempfile())
Adds the results of cell type estimation to an RnBSet
set.covariates.ct(rnb.set, ct.obj)
set.covariates.ct(rnb.set, ct.obj)
rnb.set |
The |
ct.obj |
An object of class |
The modified RnBSet
.
Adds the results of Surrogate Variable Analysis (SVA) to an RnBSet
set.covariates.sva(rnb.set, sva.obj)
set.covariates.sva(rnb.set, sva.obj)
rnb.set |
The |
sva.obj |
An object of class |
The modified RnBSet
. Note that the association information will not be stored.
Fabian Mueller
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group")
library(RnBeads.hg19) data(small.example.object) logger.start(fname=NA) sva.obj <- rnb.execute.sva(rnb.set.example,c("Sample_Group","Treatment"),numSVmethod="be") sva.obj$sva.performed sva.obj$num.components rnb.set.mod <- set.covariates.sva(rnb.set.example, sva.obj) has.covariates.sva(rnb.set.example,"Sample_Group") has.covariates.sva(rnb.set.mod,"Sample_Group")
Tells the cluster architecture about an executable that can be submitted as job
## S4 method for signature 'ClusterArchitecture,character,character' setExecutable(object, exec.name, exec.loc)
## S4 method for signature 'ClusterArchitecture,character,character' setExecutable(object, exec.name, exec.loc)
object |
|
exec.name |
A name/identifier that will be associated with the given executable |
exec.loc |
The executable's location |
The modified object
Fabian Mueller
Specifies the number of cores used by the different pipeline modules
## S4 method for signature 'RnBClusterRun,integer,character' setModuleNumCores(object, num.cores, modules = "all")
## S4 method for signature 'RnBClusterRun,integer,character' setModuleNumCores(object, num.cores, modules = "all")
object |
|
num.cores |
an integer specifying the number of cores to be used |
modules |
vector of applicable pipeline modules. Can be |
The modified object
Fabian Mueller
Specifies resource requirements for the different pipeline modules
## S4 method for signature 'RnBClusterRun,character,character' setModuleResourceRequirements(object, resources, modules = "all")
## S4 method for signature 'RnBClusterRun,character,character' setModuleResourceRequirements(object, resources, modules = "all")
object |
|
resources |
A NAMED character vector containing the resource reuirements as value and the resource name as name |
modules |
vector of applicable pipeline modules. Can be |
The modified object
Fabian Mueller
Methylation sites object information for which is present in the RnBSet
object.
## S4 method for signature 'RnBSet' sites(object)
## S4 method for signature 'RnBSet' sites(object)
object |
Dataset of interest. |
A matrix of type integer
describing the sites, information for which is
present in the object
library(RnBeads.hg19) data(small.example.object) sites(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) sites(rnb.set.example)
Summarize DNA methylation information for which is present in the RnBSet
object.
## S4 method for signature 'RnBSet' summarize.regions( object, region.type, aggregation = rnb.getOption("region.aggregation"), overwrite = TRUE )
## S4 method for signature 'RnBSet' summarize.regions( object, region.type, aggregation = rnb.getOption("region.aggregation"), overwrite = TRUE )
object |
Dataset of interest. |
region.type |
Type of the region annotation for which the summarization will be performed or |
aggregation |
Operation to summarize the methylation values. Currently supported values are |
overwrite |
If |
object of the same class as the supplied one containing the summarized methylation information for the specified region types
library(RnBeads.hg19) data(small.example.object) rnb.set.summarized<-summarize.regions(rnb.set.example, "genes", overwrite=TRUE) head(meth(rnb.set.summarized, type="genes", row.names=TRUE))
library(RnBeads.hg19) data(small.example.object) rnb.set.summarized<-summarize.regions(rnb.set.example, "genes", overwrite=TRUE) head(meth(rnb.set.summarized, type="genes", row.names=TRUE))
Gets the genomic annotations for which methylation data is present in the RnBSet
object.
## S4 method for signature 'RnBSet' summarized.regions(object)
## S4 method for signature 'RnBSet' summarized.regions(object)
object |
Methylation dataset of interest. |
character
vector listing all genomic annotations summarized in the given dataset. If the dataset
contains methylation in sites only, an empty vector is returned.
Yassen Assenov
summarize.regions
for calculating region-wise methylation in a dataset;
rnb.set.annotation
for adding or replacing a region annotation table
library(RnBeads.hg19) data(small.example.object) summarized.regions(rnb.set.example)
library(RnBeads.hg19) data(small.example.object) summarized.regions(rnb.set.example)
Extract raw unmethylated probe intensity from an object of RnBeadRawSet
class.
## S4 method for signature 'RnBeadRawSet' U(object, row.names = FALSE)
## S4 method for signature 'RnBeadRawSet' U(object, row.names = FALSE)
object |
Dataset of interest. |
row.names |
Flag indicating whether the resulting matrix will be assigned row names |
matrix
of the unmethylated probe intensities
library(RnBeads.hg19) data(small.example.object) U.intensity<-U(rnb.set.example) head(U.intensity)
library(RnBeads.hg19) data(small.example.object) U.intensity<-U(rnb.set.example) head(U.intensity)
Replaces the methylation info with the specified data frame.
## S4 method for signature 'RnBSet' updateMethylationSites(object, meth.data, verbose = FALSE)
## S4 method for signature 'RnBSet' updateMethylationSites(object, meth.data, verbose = FALSE)
object |
Dataset of interest. |
meth.data |
This object has to be a |
verbose |
if |
The modified dataset. #'
Updates the region information present in an RnBSet by invoking summarize.regions on all region types present in the object
## S4 method for signature 'RnBSet' updateRegionSummaries(object)
## S4 method for signature 'RnBSet' updateRegionSummaries(object)
object |
Dataset of interest. |
Sample annotation information available for the dataset in the form of a data.frame
.