Skip to content
forked from dmattek/ARCOS

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

majpark21/ARCOS

 
 

Repository files navigation

ARCOS

ARCOS stands for Automated Recognition of Collective Signalling.

The goal of ARCOS is to identify and track spatially clustered objects in time series data in 1-, 2-, and 3D geometries. The algorithm tackles the problem of identification of protein activation in 2- and 3D cell cultures that occur collectively in neighbouring cells over time. Despite its focus on cell signalling, the algorithm can be also applied to other spatially correlated phenomena that occur over time.

Collective waves of protein activation have been recently identified in various biological systems. They have been demonstrated to play an important role in the maintenance of epithelial homeostasis (Gagliardi et al., 2020, Takeuchi et al., 2020, Aikin et al., 2020), in the acinar morphogenesis (Ender et al., 2020), osteoblast regeneration (De Simone et al., 2021), and in the coordination of collective cell migration (Aoki et al., 2017, Hino et al., 2020).

Key features of the aggregative tracking algorithm implemented in the ARCOS::trackCollEvents function:

  • data for tracking should be organised in the long format where each row is object's location and time,
  • the function accepts objects in a long-format data.table,
  • the data.table package is used as the main data structure throughout the ARCOS package,
  • the dbscan package is used for the spatial clustering.

General flow of the algorithm:

  1. In the first frame, every available object becomes a seed of a collective event.
  2. The dbscan algorithm aims to cluster all objects in the current frame. Objects within a threshold distance are clustered into collective events with a minimum threshold size.
  3. Move to the next frame and match objects to collective events identified in previous frames. To match objects between frames, calculate the Cartesian product of two long-format tables. One holds all current objects, the other holds all objects from collective events in the previous frame(s).
  4. All unmatched objects in the current frame form seeds of new collective events.

The algorithm flow prepared with the code2flow web app.

The algorithm flow

Installation

You can install the source version of ARCOS from GitHub with:

install.packages("devtools")
devtools::install_github("dmattek/ARCOS")

Example

In this example 4 distinct objects are moving in 1 dimension over 5 time points. We aim to identify clusters of objects moving close to each other.

Time sequence

The minimal data in the long format consists of 3 columns:

  • frame with the frame number that corresponds to the time point,
  • objid with the unique identifier of every object,
  • x with the position of the object.
library(ARCOS)
library(data.table)

dtIn = data.table(frame = c(1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5),
                  objid = c(1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 4, 1, 4),
                  x = c(1, 3, 1.2, 2.5, 3.5, 0.9, 2.6, 2.9, 3.2, 1.1, 2.8, 3.1, 1, 3))
> head(dtIn, 3)
    frame objid   x
 1:     1     1 1.0
 2:     1     2 3.0
 3:     2     1 1.2

Each object has a distinct identifier represented by a different colour in the plot:

Input data

Detection and tracking

In this step 3 objects on the right are grouped into a single collective event that spans 5 frames. A single object on the left forms a trivial single-object event.

The most important parameter of the trackCollEvents function is the search radius inEps, which sets the distance for:

  • the dbscan spatial clustering in a single time frame,
  • possible objects that can be part of collective events identified in previous frame(s).

The minimum size of the spatial cluster is set using the inMinPts parameter, which is also passed to dbscan. The parameter inNprev determines the number of previous frames that are searched for collective events in order to match them to objects in the current frame.

The parameter inCols contains a list with column names of the input data (frame, id, x, y, z) and the name of the column with identifiers of collective events in the output (collid). The trackCollEvents function works in 1-, 2-, or 3D, therefore the names of respective position columns x/y/z need to be supplied depending on the geometry.

dtColl = trackCollEvents(dtIn,
                         inEps = 0.6,
                         inMinPts = 1L,
                         inNprev = 1L,
                         inCols = list(frame = "frame",
                                       x = "x",
                                       id = "objid",
                                       collid = "collid"),
                         inDeb = F)

The output contains 3 columns with the frame number, object identifier, and the calculated identifier of the collective event:

> head(dtColl, 3)
   frame objid collid
1:     1     1      1
2:     1     2      2
3:     2     1      1

Visualisation

In order to visualise collective events we merge the table computed by the trackCollEvents function with the original table by the frame number (column time) and the object identifier (column objid):

dtIn = merge(dtIn, 
             dtColl, 
             by = c("frame", "objid"))
> head(dtIn, 3)
   frame objid   x collid
1:     1     1 1.0      1
2:     1     2 3.0      2
3:     2     1 1.2      1

Each trace is assigned an identifier of the collective event, which is represented by the shape of the point in the plot:

Visualisation of collective events

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • R 95.5%
  • C++ 4.5%