View source: R/managing_batch_effects.R
percentileofscore | R Documentation |
This function converts the relative abundance of microbial variables
(i.e. bacterial taxa) in case (i.e. disease) samples to percentiles of
the equivalent variables in control (i.e. healthy) samples.
It is a built-in function of percentile_norm
.
percentileofscore(df, control.index)
df |
A data frame that contains the microbial variables and required to be converted into percentile scores. Samples as rows and variables as columns. |
control.index |
A numeric vector that contains the indexes of control samples. |
A data frame of percentile scores for each microbial variable and each sample.
gibbons2018correctingPLSDAbatch
# A built-in function of percentile_norm, not separately used.
# Not run
library(TreeSummarizedExperiment)
data('AD_data')
ad.clr <- assays(AD_data$EgData)$Clr_value
ad.batch <- rowData(AD_data$EgData)$Y.bat
ad.trt <- rowData(AD_data$EgData)$Y.trt
names(ad.batch) <- names(ad.trt) <- rownames(AD_data$EgData)
trt.first.b <- ad.trt[ad.batch == '09/04/2015']
ad.first.b.pn <- percentileofscore(ad.clr[ad.batch == '09/04/2015', ],
which(trt.first.b == '0-0.5'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.