plotTracks: Plot tracked spots and/or objects over time in 1 or 2...

View source: R/plotTracks.R

plotTracksR Documentation

Plot tracked spots and/or objects over time in 1 or 2 dimensions.

Description

With this function, you can plot spot and/or objects over time, either as a plot over time (x axis) versus localiton on the length or width axis of the cell, or as a cell projection, where color indicates time. When only one spatial dimension is displayed, it is possible to plot trajectories of different fluorescence channels. When the function detects that different conditions are used, the plots will be faceted by condition.

Usage

plotTracks( meshdata,
            spotdata,
            objectdata,
            tracks = FALSE,
            ignore_singles = FALSE,
            movie = FALSE,
            timepalette_lines = "viridis",
            timepalette_fill = "magma",
            dimension = c("length", "width"),
            turn_cells = TRUE,
            mag,
            cell = "all",
            transparency = 0.2
            )

Arguments

meshdata

A mesh dataframe containing cell outlines.

spotdata

A Spot Data dataframe containing spot localizations.

objectdata

A object dataframe containing fluorescent object outlines.

tracks

When tracks == TRUE, the track of individual spots over time will be shown. When tracks == FALSE, only the spots will be shown.

ignore_singles

When ignore_singles == FALSE, all detected spots will be shown. When ignore_singles ==TRUE, only those spots will be shown which are tracked over time.

movie

When movie==FALSE (default), the output will be a static plot. When movie == TRUE, gganimate (version => 1.0.3) will be used to make a GIF animation.

timepalette_lines

A viridis palette for both the spots & tracks as the outlines of the meshes, where color indicates the time in frames. Default = "viridis".

timepalette_fill

A viridis palette for the fill of the objects, where color indicates the time in frames. Default = "magma".

dimension

Either "length", "width", or c("length", "width")(default). Indicates the dimensions which will be plotted next to time (frames).

turn_cells

When cell projections are plotted (both cell length & width), it is possible to plot cells with their original x/y coordinates, or turn them so their length axis is parallel to the x-axis with mid-cell at 0. When plotting only one cell dimension, this command is ignored and cells are turned by default.

mag

The magnification converter (see pixels2um).

cell

The cell number or numbers as a numeric vector (e.g. c(1,2,10)), or (default) "all". When more then one cell are indicated, the function returns a plot faceted by cell number.

transparency

Transparency of both the objects as the cell polygons. The cell polygons are set to be 5 times more transparent than the object polygons.

Value

A plot or a faceted plot of the trajectory of the cell shape, fluorescent spots and/or the localization of detected fluorescent objects in the cell over time. The plots can either by location on the length-axis over time, location on the width-axis over time, or x/y location and shape over time.

Author(s)

Renske van Raaphorst

Examples

## Not run: 
  ##Get example data from bactMAP on https://veeninglab.com/f/example_datasets.zip

  ##tracked FtsZ
  load("FtsZ_tracks.rda")

  ##and corresponding meshes
  load("DnaX_mesh.rda")

  #plot ftsZ on length axis/time
  plotTracks(meshdata=meshes,
              spotdata=FtsZ_tracks,
              dimension="length",
              mag="100x_DVMolgen",
              tracks=TRUE,
              cell=4)

## End(Not run)


vrrenske/shinyspots documentation built on Oct. 28, 2023, 12:26 p.m.