plot_QC_repl_var: Replicates variation plot

Description Usage Arguments Value Author(s) Examples

View source: R/plot_QC_repl_var.R

Description

Draw the plot that shows the distribution of variation statistics (e.g. coefficient of variation(CV)) of replicates

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_QC_repl_var(
  baf,
  i_repl = 1:nrow(baf),
  by_s = batch_colname(baf, "sample"),
  varFUN = function(x) {     sd(x, na.rm = T)/mean(x, na.rm = T) },
  col_lines = palette(),
  main = deparse(substitute(baf)),
  xlab = "Coef. of var.",
  ylab = "Density",
  xlim = c(0, 0.5),
  ylim = NULL,
  lty = c("solid", "dashed"),
  lwd = c(2, 1),
  ...
)

Arguments

baf

an object of the BAf-class

i_repl

an integer or logical index vector of the rows that have replicated samples

by_s

by which the samples are grouped. The varFUN is applied to each group and the results are combined. This should be given by a character string of a column name in @sinfo.

varFUN

a function to compute a variation statistics. The default is the function to compute the coefficienct of variation.

col_lines

a named vector of line colors in character strings

main, xlab, ylab, xlim, ylim

same as those for plot

lty, lwd

the first value is for the line to show the variation of replicates, while the second is for the other samples. Individual values are same those for plot

...

the arguments passed over to plot and lines

Value

a list that contains computed varaition statistics of the replicates and all the other samples

Author(s)

Mun-Gwan Hong <mun-gwan.hong@scilifelab.se>

Examples

1
2
3
data(sba)
sba2 <- sba[sba@sinfo$cohort != "EMPTY", ]
plot_QC_repl_var(sba2, sba2@sinfo$cohort == "MIX_1")

Rundmus/BAf-R_package documentation built on May 18, 2020, 12:59 p.m.