View source: R/alignment_score.R
alignment_score | R Documentation |
This function evaluates the degree of mixing samples from different batches in the batch corrected data. It is based on the dissimilarity matrix from Principal Component Analysis.
alignment_score(
data,
batch,
var = 0.95,
k = round(0.1 * nrow(data)),
ncomp = 20
)
data |
A numeric matrix. Samples are in rows, while variables are in
columns. |
batch |
A factor or a class vector for the batch grouping information (categorical outcome variable). The length should be equal to the number of samples in the data. |
var |
The proportion of data variance explained by
the principal components,
ranging from |
k |
Integer, the number of nearest neighbours.
By default |
ncomp |
Integer, the number of components for
principal component analysis.
Default value is |
A numeric alignment score that ranges from 0
to 1
,
representing poor to perfect
performance of mixing the samples from different batches.
Yiwen Wang, Kim-Anh LĂȘ Cao
butler2018integratingPLSDAbatch
Scatter_Density
, box_plot
,
density_plot
and partVar_plot
as the other
methods for batch effect detection and batch effect removal assessment.
library(TreeSummarizedExperiment) # for functions assays(),rowData()
data('sponge_data')
X <- assays(sponge_data)$Clr_value # centered log ratio transformed data
batch <- rowData(sponge_data)$Y.bat # batch information
names(batch) <- rownames(sponge_data)
alignment_score(data = X, batch = batch, var = 0.95, k = 3, ncomp = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.