Description Usage Arguments Value Author(s) References Examples
This function applies quantile normalization on the distance matrix (dissimilarity matrix) and return the corrected distance matrix.
1 2 |
dat |
The original p*n batch effect data with n subjects and p RNA-seq measurements or the n by n distance matrix. |
batch |
The vector of length n indicating which batch the subjects belong to. |
method |
Method for the quantile normalization. There are two options: "row/column" and "vectorize". |
cor_method |
Method to calculate the correlation matrix, can be 'spearman'(default), 'pearson' or 'kendall'. |
tol |
The tolerance for the iterative method "row/column", which is the Euclidean distance of the vectorized two dissimilarity matrices before and after each iteration. |
max |
Maximum number of the iteration if the tolerance is not reached. |
logdat |
Whether conducting log transformation to data or not. |
standardize |
Whether conducting standardization [(dat - mean)/sqrt(var)] to data or not. |
Returns the corrected 1-correlation matrix between subjects.
Teng Fei. Email: tfei@emory.edu
Fei et al (2018), Mitigating the adverse impact of batch effects in sample pattern detection, Bioinformatics, <https://doi.org/10.1093/bioinformatics/bty117>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(pheatmap) #drawing heatmap
data("ENCODE") #load the ENCODE data
#Before correction, the subjects are clustered by species
pheatmap(cor(ENCODE))
#Assigning the batches based on species
batches <- c(rep(1,13),rep(2,13))
#QuantNorm correction
corrected.distance.matrix <- QuantNorm(ENCODE,batches,method='row/column', cor_method='pearson',
logdat=FALSE, standardize = TRUE, tol=1e-4)
pheatmap(1-corrected.distance.matrix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.