Description Usage Arguments Value Implementation Examples
Plots distributions for each combination of FUNS, channels and sampleColors. By default, samples are ordered according to the sampleColors (if provided). Colors should be provided as factors with a preset order of levels; the order of colors is determined by the order of levels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
expLog2 |
Expression matrix (preferably in log2 scale) with genes in rows and samples in columns |
targets |
Table with columns names with a prefix colorsFrom='color_' |
colorsFrom |
Character, non-empty prefix of names of columns with colors, default 'color_' |
rename |
Logical, default TRUE: rename colors using associated variables or variable namesFrom (default) FALSE: use existing names from 'color_' variables, or, if missing, use values from associated variables |
namesFrom |
Either NULL for using variables that share suffixes with colors or a variable from targets that is used for setting names to colors, e.g. HybName |
FUNS |
Vector, geom_functions from ggplot2, default |
probeTypeVec |
Vector of probe types |
probeTypeValue |
Value from probeTypeVec to use for plotting |
numProbes |
Number of randomly select probes |
orderByColors |
Logical for ordering samples by colors (coded as a factor with levels in order); default TRUE |
scale_x_limits |
NULL for auto-scale; use c(0,16) or less for log2(intensities) |
filePath |
NULL or character; if given, output a PDF; default NULL |
width |
PDF width, default 16/9*7=12.44 |
height |
PDF height, default 7 |
... |
Passed to ggplot2::FUN, e.g.: bins, binwidth, show.legend |
Invisibly a list of ggplot2 objects, one per a combination of FUNS and colors; PDF if filePath is given
See https://www.tidyverse.org/blog/2020/02/glue-strings-and-tidy-eval/ for bracing variables.
Evaluation of expression: https://adv-r.hadley.nz/evaluation.html.
For bquote(a +. (b))
: http://adv-r.had.co.nz/Expressions.html.
Errors: - dplyr::rename(!!purrr::set_names(oldColNames, newColNames))
- colnames(expLog2) <- newColNames
TODO: - titlePfx <- paste("Distribution of", as.character(rlang::fn_fmls()$'expLog2'), "on", numProbes, "probes", titleSfx)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ## Not run:
expLog2 <- log2(dataRG$R)[1:100,]
## rename=TRUE (default)
## namesFrom=NULL, orderByColors=TRUE
plotDistrTargets2(expLog2, targets, colorsFrom="color_", namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-NULL.pdf"))
## namesFrom=HybName
plotDistrTargets2(expLog2, targets, colorsFrom="color_", namesFrom=HybName, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-HybName.pdf"))
## namesFrom=Birth3WHO
plotDistrTargets2(expLog2, targets, colorsFrom="color_", namesFrom=Birth3WHO, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-Birth3WHO.pdf"))
## namesFrom=HybName, orderByColors=FALSE
plotDistrTargets2(expLog2, targets, colorsFrom="color_", namesFrom=HybName, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-HybName-noReorder.pdf"))
## rename=FALSE () (implies namesFrom=NULL)
## orderByColors=TRUE
plotDistrTargets2(expLog2, targets, colorsFrom="color_", rename=FALSE, namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-noRename.pdf"))
## orderByColors=FALSE
plotDistrTargets2(expLog2, targets, colorsFrom="color_", rename=FALSE, namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-noRename-noReorder.pdf"))
## warning: rename=FALSE $ namesFrom!=NULL
plotDistrTargets2(expLog2, targets, colorsFrom="color_", rename=FALSE, namesFrom=Birth2, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-warning.pdf"))
## w/o targets
getColPats2(NULL, unique=TRUE)
plotDistrTargets2(expLog2, NULL, colorsFrom="color_", rename=TRUE, namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-noTargets.pdf"))
## non-unique column names
exxx <- expLog2
colnames(exxx) <- names(getColPats2(targets, namesFrom=Birth3WHO, pullVar=Birth3WHO))
plotDistrTargets2(exxx, NULL, colorsFrom="color_", rename=TRUE, namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-euqalSampleNames-noTargets-.pdf"))
plotDistrTargets2(exxx, targets, colorsFrom="color_", rename=TRUE, namesFrom=NULL, FUNS = c(geom_density, geom_boxplot),
probeTypeVec = probeTypeVec, probeTypeValue = 0, numProbes = NULL, orderByColors = FALSE,
scale_x_limits = NULL, filePath = file.path(resultDir, "_debug3_plotDistrTargets2-euqalSampleNames.pdf"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.