View source: R/batch_detection.R
Scatter_Density | R Documentation |
This function draws a PCA sample plot with density plots per principal component.
Scatter_Density(
object,
batch = NULL,
trt = NULL,
xlim = NULL,
ylim = NULL,
color.set = NULL,
batch.legend.title = "Batch",
trt.legend.title = "Treatment",
density.lwd = 0.2,
title = NULL,
title.cex = 1.5,
legend.cex = 0.7,
legend.title.cex = 0.75
)
object |
The object of class PCA. |
batch |
A factor or a class vector for the batch grouping information (categorical outcome variable). |
trt |
A factor or a class vector for the treatment grouping information (categorical outcome variable). |
xlim |
A numeric vector of length 2, indicating the x coordinate ranges. |
ylim |
A numeric vector of length 2, indicating the y coordinate ranges. |
color.set |
A vector of character, indicating the set of colors to use. The colors are represented by hexadecimal color code. |
batch.legend.title |
Character, the legend title of batches. |
trt.legend.title |
Character, the legend title of treatments. |
density.lwd |
Numeric, the thickness of density lines. |
title |
Character, the plot title. |
title.cex |
Numeric, the size of plot title. |
legend.cex |
Numeric, the size of legends. |
legend.title.cex |
Numeric, the size of legend title. |
None.
Yiwen Wang, Kim-Anh LĂȘ Cao
box_plot
, density_plot
,
alignment_score
and partVar_plot
as the other
methods for batch effect detection and batch effect removal assessment.
# The first example
library(mixOmics) # for function pca()
library(TreeSummarizedExperiment) # for functions assays(),rowData()
data('AD_data')
# centered log ratio transformed data
ad.clr <- assays(AD_data$EgData)$Clr_value
ad.pca.before <- pca(ad.clr, ncomp = 3, scale = TRUE)
ad.batch <- rowData(AD_data$EgData)$Y.bat # batch information
ad.trt <- rowData(AD_data$EgData)$Y.trt # treatment information
names(ad.batch) <- names(ad.trt) <- rownames(AD_data$EgData)
Scatter_Density(object = ad.pca.before, batch = ad.batch, trt = ad.trt)
# The second example
colorlist <- rainbow(10)
Scatter_Density(object = ad.pca.before, batch = ad.batch, trt = ad.trt,
color.set = colorlist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.