getCorrelation | R Documentation |
The functions returns a matrix of correlation coefficients and/or a set
of scatterplots showing the relationship between samples. The scatterplots
will contain also fitted lines using lm()
for linear regression
and lowess
for polynomial regression.
getCorrelation(object,method="pearson",plot=FALSE,nrow)
## S4 method for signature 'methylBase'
getCorrelation(object, method = c("pearson", "kendall", "spearman"), plot)
## S4 method for signature 'methylBaseDB'
getCorrelation(object, method = "pearson", plot = FALSE, nrow = 2e+06)
object |
a methylBase or methylBaseDB object |
method |
a character string indicating which correlation coefficient (or covariance) is to be computed (default:"pearson", other options are "kendall" and "spearman") |
plot |
scatterPlot if TRUE (default:FALSE) |
nrow |
a numeric giving the number of lines to read in of methylBaseDB object, defaults to 2e6 |
a correlation matrix object and plot scatterPlot
The argument 'nrow' is only evaluated if the
input is a methylBaseDB
object.
If 'nrow' is not specified getCorrelation
will read the
first 2M records of the given object,
but if you want to read all records 'nrow' has to be NULL.
You should change 'nrow' if using getCorrelation
with
all records of the methylBaseDB object would take too long.
If the scatter plot is plotted, the red line in the plot is from linear
regression fit and the green line is from polynomial regression fit with
stats::lowess
.
data(methylKit)
getCorrelation(methylBase.obj,method="pearson",plot=FALSE)
# create methylBaseDB
methylBaseDB.obj <- unite(methylRawList.obj,save.db=TRUE,dbdir="methylDB")
getCorrelation(methylBaseDB.obj,method="pearson",plot=FALSE,nrow=10000)
# remove Database again
rm(methylBaseDB.obj)
unlink("methylDB",recursive=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.