View source: R/cell profiles function.R
cellProfiles | R Documentation |
cellProfiles
processes fluorescence intensity profiles from, eg, ImageJ, and prepares them for graphing as length-ordered demographs by ggplot
cellProfiles(data = NULL, position = "center", align = "native",
reverse = FALSE, contrast = "native", range = c(0.02, 0.98))
data |
wide-formated input data consisting of paired columns depicting (1) fluorescent intensity and (2) cell length. Accepts output directly from, eg, ImageJ |
position |
character string (default is "left"), matching either "left" or "center". Determines alignment of stacked profiles |
align |
character string (default is "native"), matching either "native", "orient", or "random", OR to reuse previous alignments, the results of a prior 'cellProfiles()' run. Determines orientations of individual profiles. |
reverse |
logical (default is FALSE). Globally reverses alignment of profiles. |
contrast |
character string (default is "native"), matching either "native", "norm", or "max". Controls contrast of individual profiles; "norm" and "max" assist in visualizing profiles with heterogeneous intensity levels |
range |
vector of length 2 (default is c(0.02,0.98) ), defining the lower and upper percentile boundaries of the color scale. Equivalent to adjusting the min/max displayed contrast in ImageJ |
a list of the following values:
interpolated |
processed interpolated data using supplied range values. Columns consist of: x: fluorescence profile x-coordinates intensity: fluorescence profile value y: cell number / total cells. Ordered by height for demograph plots |
native |
as above, but using native resolution |
proportional |
as above, with absolute cell length converted to fraction of cell length |
wide |
wide-formatted table for human eyes; NOT for ggplot2 |
fliplist |
a simple vector that records orientations of each cell profile |
The cellProfiles vignette for detailed usage instructions: vignette("cellProfiles")
cellProfileTruncate
for trimming input
ggplot
for plotting output
#calculate cell profiles
data_path <- system.file("extdata", "ftsZ_profiles.csv", package = "cellProfiles")
dtable <- read.table(data_path, header=FALSE, sep=",")
profileResults <- cellProfiles(data=dtable)
#calculate cell profiles, orienting brightest poles on the right & normalizing cell-cell contrast
profileResults <- cellProfiles(data=dtable, align="orient", reverse=TRUE, contrast="norm")
#plot with ggplot
ggplot2::ggplot(data=profileResults$interpolated, mapping=aes(x=x, y=y, fill=intensity, color=intensity) ) + geom_tile() + theme_classic() + scale_y_continuous(expand=c(0.0,0.0), breaks=seq(0,1,0.25), trans="reverse") + scale_fill_gradient(na.value = NA) + scale_color_gradient(na.value=NA) + labs(x="distance from midcell (um)", y="fraction of cell cycle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.