Description Usage Arguments Details Value Discrete List Elements (if as.discrete.list=T)
View source: R/data-for-plot.R
This retrieves data to annotate points on various plots and returns either the data, or the data transformed into colors for plotting. This function is called by most of URD's plotting routines.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
object |
An URD object |
label |
(Character) The label of the data to search for |
label.type |
(Character) Where to look for the data. Default is "search" which looks in order: "meta", "group", "sig", "gene", "counts", "pseudotime", "pca", "diff.data" |
cells.use |
(Character vector) Which cells to return information for (default is NULL, which returns all cells) |
as.color |
(Logical) Return hex color values instead of the raw data |
as.single.color |
(Logical) Return on a scale from 0-1 as a "single color" to feed into |
as.discrete.list |
(Logical) If TRUE, returns a list (see below). |
continuous.colors |
(Character vector) Colors to use to produce a continuous color scale (used if data is continuous) and |
continuous.color.limits |
(Numeric vector, length 2) Limits to use for scaling continuous color data. Data outside the range is squished into range. If |
colors.use |
(Character vector) Colors to use for discrete data (default is NULL, which will use palette) |
palette |
(Function) A palette (see |
By default, it searches for a label in the following order:
metadata ("meta"
), group IDs ("group"
), gene signatures ("sig"
),
gene expression ("gene"
), unnormalized gene expression counts ("counts"
),
pseudotime ("pseudotime"
), NMF modules ("nmf"
), principal components ("pca"
),
simulated diffusion results ("diff.data"
).
However, data can be requested from a particular source by setting label.type
.
This can be used to get log-transformed but unnormalized expression data from
count.data
by setting label.type="counts"
.
The value returned depends on the flags set. A vector is returned if as.discrete.list=FALSE
or a list is returned if as.discrete.list=TRUE
(see below). The data is returned directly if as.color=F
and as.single.color=F
, or it is returned as color values to plot directly if either are TRUE
.
as.discrete.list=T
)(Logical) Is the data discrete or continuous?
(Numeric or Character Vector) Either the data itself, or colors if as.color=T
or as.single.color=T
.
(Named Character Vector) Colors used, named by the data, returned if as.color=T
and data is discrete
(Numeric Vector) If data is continuous, the range of the data, otherwise NULL.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.