View source: R/batch_detection.R
density_plot | R Documentation |
This function draws an overlap of multiple density plots for each batch.
density_plot(
df,
title = NULL,
batch.legend.title = "Batch",
xlab = "Value",
color.set = NULL,
title.hjust = 0.5
)
df |
A data frame used to draw the density plots. |
title |
Character, the plot title. |
batch.legend.title |
Character, the legend title of batches. |
xlab |
Character, x-axis title. |
color.set |
A vector of character, indicating the set of colors to use. The colors are represented by hexadecimal color code. |
title.hjust |
Numeric, horizontal justification of the plot title,
in the range of |
None.
Yiwen Wang, Kim-Anh LĂȘ Cao
Scatter_Density
, box_plot
,
alignment_score
and partVar_plot
as the other
methods for batch effect detection and batch effect removal assessment.
# The first example
library(TreeSummarizedExperiment) # for functions assays(),rowData()
data('AD_data')
# centered log ratio transformed data
ad.clr <- assays(AD_data$EgData)$Clr_value
ad.batch <- rowData(AD_data$EgData)$Y.bat # batch information
names(ad.batch) <- rownames(AD_data$EgData)
ad.df <- data.frame(value = ad.clr[,1], batch = ad.batch)
density_plot(df = ad.df, title = 'OTU 12')
# The second example
colorlist <- rainbow(10)
density_plot(df = ad.df, title = 'OTU 12', color.set = colorlist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.