createPlotList | R Documentation |
createPlotList()
is a plotting function which combines detected fluorescent spot localization with mesh outline information to plot demographs, projections, histograms and a data summary in one go. These functions are all combined because they need similar data preparation. The idea is that after using this function, you have a good overview of the localization of your protein inside the cells. Sometimes this analysis can be enough to show where a protein localizes, but in other cases (when proteins are very mobile or localize heterogeneously, for instance), this may rather serve as a starting point for more detailed analysis. Therefore, the data generated to make these plots is also returned by the function.
createPlotList(spotdata,
meshdata,
groups=4,
colorpalette="GreenYellow",
lineColor="white",
mag="No_PixelCorrection",
AllPlot=F,
Xm="X",
Ym="Y",
viridis=FALSE,
showPlot=TRUE,
getData=FALSE,
getSummary=TRUE)
spotdata |
Data frame containing -at least- column with spot x-localizations, y-localizations and frame number. When the variable meshdata is not given, additional required columns are cell ID, relative x-localization ("l" or "Lmid") and relative y-localization ("d" or "Dum"). |
meshdata |
Data frame containing -at least- the x and y coordinates of the cell meshes, the maximum cell width, maximum cell length, cell ID and frame. Optional. |
groups |
Number of groups the data will be divided in. Default = 4. |
colorpalette |
Color palette the heatmap plots will be plotted in. Default is "GreenYellow". Check which palettes are loaded by |
lineColor |
to be able to change the outlines of the cell and pole localizations in demographs, set lineColor. Default is "white". |
mag |
The name of the conversion factor for pixel to micrometer. Default is "No_PixelCorrection" which is 1. Check |
AllPlot |
When |
Xm |
By default, the column names of the x/y coordinates in the MESH data frames are "X" and "Y". When this is not the case, one can tell the function by using |
Ym |
See Xm |
viridis |
when |
showPlot |
when |
getData |
when |
getSummary |
when |
A list consisting of the following items:
$lengthplot |
Heatmap histogram plot of the length-axis localizations of the spots ordered by the length of the cell. |
$widthplot |
Heatmap histogram plot of the width-axis localizations of the spots ordered by the length of the cell. |
$qplots_separate |
If the outlines of the cell are not added to the function (dataframe |
$qplots |
for easy use, qplots is a |
$plottotal |
Relative x/y coordinates of all spots with average cell outline overlayed. If |
$histograms |
1D density plots of the spot localization on the length axis of the cells, grouped by |
$spotdata |
data frame containing the groups, relative x/y localizations of the spots and cell length/width |
$meshdata |
if |
$data_summary |
a character vector, or when |
This function is meant to give an overview of the data. Check the tutorials on the wiki page for examples of modifying individual plots.
Renske van Raaphorst
These plotting functions were developed for:
## Not run:
##use data from example dataset
##download example datasets DnaX_tracks.rda & DnaX_mesh.rda
##from https://veeninglab.com/f/example_datasets.zip
load("DnaX_tracks.rda")
load("DnaX_mesh.rda")
##create list of plots, ordered by length, grouped in 6 groups.
GFPlist <- createPlotList(DnaX_tracks, DnaX_mesh, groups=6, colorpalette="GreenYellow", AllPlot=T)
#have a look at the "plottotal" plot
plot(GFPlist$plottotal)
#save PDF of the 6 grouped plots (qplots)
ggplot2::ggsave(GFPlist$qplots, filename="GroupPlots.PDF")
#see summary:
GFPlist$data_summary
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.