Tracking: announcing new R package TrackMateR
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
A short post to announce TrackMateR, a new R package to analyse TrackMate XML outputs.
Background
TrackMate is a plug-in for ImageJ which ships with Fiji. It’s essential for single particle tracking work, particularly for microscopy movies. For example, tracking the movement of fluorescent vesicles inside cells.
A tracking session generates a TrackMate XML file. The idea was to write something for R that could load these XML files and do some analysis.
Features
The package has functions to display tracks and to analyse:
- speed, displacement, cumulative distance
- mean squared displacement, alpha
- jump distance
- fractal dimension
- track density (number of neighbouring tracks with a search radius)
Usage
Full instructions are here. Briefly, install via devtools
.
# install.packages("devtools") devtools::install_github("quantixed/TrackMateR")
The idea is that a user would have either one TrackMate file to analyse or many.
One TrackMate file
The user can load and process the file automatically to generate a report:
library(ggplot2) library(TrackMateR) # an example file is provided, otherwise use file.choose() xmlPath <- system.file("extdata", "ExampleTrackMateData.xml", package="TrackMateR") # read the TrackMate XML file into R using tmObj <- readTrackMateXML(XMLpath = xmlPath) # Pixel size is 0.04 um and original data was 1 pixel, xyscalar = 0.04 tmObj <- correctTrackMateData(dataList = tmObj, xyscalar = 0.04, xyunit = "um") # automatically generate report using reportDataset(tmObj)
or they can fine tune the parameters to generate a report using different settings (details here).
Multiple TrackMate files
Using compareDatasets()
it is possible to analyse multiple datasets using different conditions. This workflow will generate:
- one report per dataset
- one summary per condition
- one comparison of all conditions
- a number of text file outputs for reuse
Thanks
The code builds on initial work on a package called TrackR from Julien Godet. Some test data generated by Méghane Sittewelle is included to get started.
—
The post title comes from “Tracking” by Ambush which comes from a compilation “Sonics Everywhere”
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.