plotSphereIntensity {cydar} | R Documentation |
Visualize cells or hyperspheres in low-dimensional space, coloured by marker intensities or log-fold changes.
plotSphereIntensity(x, y, intensity, irange=NULL, length.out=100, pch=16, ...) # Deprecated - all parameters passed to plotCellIntensity. plotCellIntensity(...)
x, y |
A numeric vector of coordinates for each hypersphere. |
intensity |
A numeric vector specifying the marker intensities for each hypersphere. |
irange |
A numeric vector of length 2, specifying the upper and lower bound for the intensities. |
length.out |
An integer scalar specifying the resolution of the colour bar. |
pch, ... |
Additional arguments to pass to |
Each hypersphere is represented by a point in the two-dimensional embedding, colored using the viridis colour scheme, i.e., purple (low intensity) to green (medium) to yellow (high).
If irange
is not NULL
, extreme values in intensity
will be winsorized to lie within irange
.
This preserves the resolution of colours for smaller changes at low intensities.
Users should consider using intensityRanges
to define appropriate values of irange
for each marker.
A plot of the low-dimensional embedding of the hypersphere locations is made on the current graphics device.
A vector of colours of length length.out
is returned, containing the colour gradient used for the intensities.
The vector names contains the numeric values associated with each colour.
This can be used to construct a colour bar with createColorBar
.
Aaron Lun
viridis
,
intensityRanges
,
createColorBar
# Making up some coordinates. x <- rnorm(100) y <- rnorm(100) # Intensity plot and colour bar. intensities <- rgamma(100, 2, 2) out <- plotSphereIntensity(x, y, intensities) out <- plotSphereIntensity(x, y, intensities, irange=c(0, 2)) plot(0,0, type="n", axes=FALSE, ylab="", xlab="", ylim=c(-1, 1), xlim=c(-1, 0.5)) createColorBar(out) text(-0.6, 0, srt=90, "Intensity", cex=1.2)