The software identifies and visualises collective protein activation in 2- and 3D cell cultures over time. Such collective phenomena have been recently identified in various biological systems. They have been demonstrated to play an important role in the: (1) maintenance of the epithelial homeostasis (Gagliardi et al., 2020, Takeuchi et al., 2020, Aikin et al., 2020), (2) acinar morphogenesis (Ender et al., 2020), (3) osteoblast regeneration (De Simone et al., 2021), and (4) coordination of collective cell migration (Aoki et al., 2017, Hino et al., 2020).
Despite its focus on cell signalling, the framework can be also applied to other spatially correlated phenomena that occur over time in an arbitrary spatial dimension.
This repository covers the R implementation. For other implementations check:
Documentation for the entire ARCOS project can be found on gitbook.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("dmattek/ARCOS")
The minimal input comprises time series arranged in long format, where each row defines object’s location and time.
ARCOS defines an
arcosTS object that extends the
data.table class. In practice, additional attributes are added to the existing
data.table object to define column names relevant for the analysis.
The following synthetic dataset contains 81 objects (e.g., biological cells) spaced on a 2D 9x9 lattice with a spacing of 1x1 length units. Each object has an ID (column
id) and can assume values 0 and 1 (column
m), which correspond to an inactive and active state. The evolution of active states takes place over 8 consecutive time points (column
t). Each object wiggles slightly around its position.
library(ARCOS) library(ggplot2) # Generate a synthetic dataset with a single event evolving over 8 frames dts = ARCOS::genSynthSingle2D(inSeed = 7)
In the plot below, grey circles correspond to inactive and black to active states of objects and their collective activation (wave) develops over 8 time points.
The following R code will identify the collective event and store the result in a
dcoll variable. We are interested in a collective event comprised of active objects, hence we select rows with
m > 0. The parameter
eps sets the threshold radius for the spatial clustering (
dbscan algorithm). Here, we set
eps = 2, which is enough to find all the nearest active objects in the cluster, given the 1x1 horizontal and vertical spacing of objects in the lattice.
# Track collective events dcoll = ARCOS::trackColl(dts[m > 0], eps = 2.)
dcoll table contains the results of spatio-temporal clustering. Column
collid stores a unique identifier of the collective event. The
collid.frame column stores an identifier of collective event that is unique only within a frame.
For better visualisation, we add convex hulls around collective events using the
chull function from the
# Create convex hulls around collective events for visualisation dcollch = dcoll[, .SD[grDevices::chull(x, y)], by = .(t, collid)]
In the following plot, objects that participate in the collective event are indicated by red dots. The red polygon indicates a convex hull.
The code below saves individual time frames as
png files in the
frames folder located in the current working directory.
ARCOS::savePlotColl2D(dts, dcoll, outdir = "./frames", xlim = c(-.5,9), ylim = c(-.5,9), plotwh = c(4,3), imtype = "png")
Individual files can be later combined into a movie using software such as ffmpeg.
For example, if you have
ffmpeg installed on your system, create an
mp4 movie at 2 frames/second and a 520x420 pixel resolution by typing the following line in the command line:
ffmpeg -framerate 2 -i "frames/F%04d.png" -vcodec libx264 -s 560x420 -pix_fmt yuv420p frames-all.mp4