pdmw: Plot density of each replicate in a dataset, together for...

Description Usage Arguments Value See Also Examples

Description

Computes a kernel density per replicate and well type in a dataset and makes a single plot with appropriate limits of all densities together, per replicate.

Usage

1
2
3
4
5
pdmw(data_rscreen, pdata = NULL, use.wt = c("sample", "pos", "neg"),
  na.rm = TRUE, sel.reps = scr.names(data_rscreen), plot = TRUE,
  rescale = FALSE, scale.fun = c("asinh", "log2"), myxlab = "",
  mytitle = NULL, add.text = FALSE, add.leg = TRUE, lcex = 1,
  col.types = c("red", "blue"))

Arguments

data_rscreen

typically an rscreen.object, from which the columns of the 'data_only' slot are to be made density plots of. Otherwise a numeric matrix or a data frame with only numeric columns, in which case density plots are made of their columns. In the latter case, all entries (rows) are assumed to be of type 'sample'.

pdata

a pdata object.

use.wt

character vector giving the unique well type labels to be used to group features. Must contain at least one label, and all labels given must exist in all replicates. The first label is assumed to correspond to library features, internally coded as 'sample'. One density is computed per label in 'use.wt' and all densities for the unique well type labels are plotted in a single graph, for each replicate.

na.rm

logical - should NAs per column be removed? Its value is passed on to the call to density.

sel.reps

either a character vector containing labels for replicates to be used, or indices of columns from the 'data_only' slot of the data_rscreen object to be used. The default is to use all replicates in the 'data_rscreen' object.

plot

logical, indicating whether or not a plot is to be produced.

rescale

logical, indicating whether or not the data is to be rescaled. Defaults to FALSE. If TRUE, the screen data will be rescaled per replicate using the function indicated in 'scale.fun'.

scale.fun

the name of the function to be used to rescale the data. Currently the only choices are 'asinh' for the hyperbolic-arc sine transformation, and 'log2' for the log2 transformation. Note that the hyperbolic-arc sine is equivalent to the logarithm for intermediate and high values, and to a linear transformation for low values. This transformation allows for zeros, which is a useful property when transforming count data. Ignored if 'rescale' is FALSE.

myxlab

the label to be used for the x-axis.

mytitle

string containing the title to be used. Its default value is NULL, in which case the replicate label is used, the same as the column name in the original data. It may also be FALSE, in which no title is plotted.

add.text

logical, indicating whether a text label is to be added to the plot. If TRUE, the replicate label will be displayed.

add.leg

logical, indicating whether or not a legend indicating lines corresponding to the well types in use.wt is to be added.

lcex

cex parameter for legend, if used. Must be numeric.

col.types

character vector, indicating the colours to be used for the second and third well types given in use.wt. The colour used for the first well type is the one given in the 'cols_list' slot of 'pdata'.

Value

A plot including one density for each column of values in mydata, using plot limits that allow for a complete displ)ay of each density, by default.

See Also

density for how densities are computed, pdw for making plots using values for a single well type per replicate, for all replicates in a single graph.

Examples

1
2
3
4
5
6
7
8
9
mydata <- cbind(replicate(5, rnorm(500)), replicate(5, rnorm(500, mean=0.5, sd = 2)))
mycont <- rbind(replicate(10, rnorm(100)), replicate(10, rnorm(100, mean=1)))
mydata <- rbind(mydata, mycont)
colnames(mydata) <- paste("Data", 1:10)
data.ann <- data.frame(geneID = paste("G", 1:700),
                       wtype = c(rep("sample", 500), rep("neg", 100), rep("pos", 100)) )
data.screen <- list(data_ann = data.ann, data_only = mydata)
class(data.screen) <- "rscreen.object"
pdmw(data.screen)

rxmenezes/rscreenorm documentation built on May 15, 2019, 1:19 p.m.