View source: R/batch_correction.R
pca_bhattacharyya_dist | R Documentation |
Computes Bhattacharyya distance between all pairs of batches after projecting the samples into PCA space with pcaMethods::pca
pca_bhattacharyya_dist(
object,
batch,
all_features = FALSE,
center = TRUE,
scale = "uv",
nPcs = 3,
...
)
object |
a MetaboSet object |
batch |
column name of pData givinh the batch labels |
all_features |
logical, should all features be used? If FALSE (the default), flagged features are removed before imputation. |
center |
logical, should the data be centered prior to PCA? (usually yes) |
scale |
scaling used, as in pcaMethods::prep. Default is "uv" for unit variance |
nPcs |
the number of principal components to use |
... |
other parameters to pcaMethods::pca |
matrix of Bhattacharyya distances between batches
# Batch correction
## Not run:
batch_corrected <- normalize_batches(merged_sample, batch = "Batch", group = "QC", ref_label = "QC")
# Evaluate batch correction
pca_bhattacharyya_dist(merged_sample, batch = "Batch")
pca_bhattacharyya_dist(batch_corrected, batch = "Batch")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.