CeLaVi: an interactive cell lineage visualization tool

Abstract Recent innovations in genetics and imaging are providing the means to reconstruct cell lineages, either by tracking cell divisions using live microscopy, or by deducing the history of cells using molecular recorders. A cell lineage on its own, however, is simply a description of cell divisions as branching events. A major goal of current research is to integrate this description of cell relationships with information about the spatial distribution and identities of the cells those divisions produce. Visualizing, interpreting and exploring these complex data in an intuitive manner requires the development of new tools. Here we present CeLaVi, a web-based visualization tool that allows users to navigate and interact with a representation of cell lineages, whilst simultaneously visualizing the spatial distribution, identities and properties of cells. CeLaVi’s principal functions include the ability to explore and manipulate the cell lineage tree; to visualise the spatial distribution of cell clones at different depths of the tree; to colour cells in the 3D viewer based on lineage relationships; to visualise various cell qualities on the 3D viewer (e.g. gene expression, cell type) and to annotate selected cells/clones. All these capabilities are demonstrated with four different example data sets. CeLaVi is available at http://www.celavi.pro.


INTRODUCTION
Multicellular organisms start their development as a single cell that undergoes a coordinated process of cell division, morphogenesis and cell differentiation.The cell divisions constitute a genealogical tree--a cell lineage which can provide the framework for understanding how and when cell fate decisions are made.For many years descriptions of cell lineages have been produced by following successive cell divisions of developing organisms under the microscope (1)(2)(3).
Recent years have seen development of imaging technologies that have simplified this process and made possible its application to larger numbers of cells.In parallel has been the development of genetic lineage recorders, which register the genealogical history of cells based on somatic mutations, opening up the possibility of reconstructing the entire lineage history of complex organisms (e.g.(4)(5)(6)(7)(8)).The visualization and integration of these complex data re- quires new specialised tools.Here we present CeLaVi (Cell Lineage Visualization tool), a web based visualization tool for exploring a cell lineage while viewing a 3D representation of the same cells, which can be annotated in any way required.
CeLaVi is an open-source web tool that requires no installation of software.Example data sets, and text and video tutorials are provided (http://www.celavi.pro/tutorial.html).The simple requirements for using CeLaVi, namely a personal computer with a modern browser, makes it easy to use by cell lineage researchers, but also opens the possibility of exploring the data emerging from the new cell lineaging technologies to the wider developmental biology community, and to the general public.

General description of CeLaVi
CeLaVi is built using HTML5, Ajax, jQuery, CSS and the visualization libraries D3.js (9) and Plotly.js(https://plot.ly).It does not need to be installed and has been tested on the browsers and operating systems listed in Table 1.
The user interface of CeLaVi consists of two interactive spaces that are connected in real time: the 'Lineage viewer' and the '3D viewer' (Figure 1).The two areas are tightly integrated so that the user can interact with the cells or cell clones on the lineage tree and observe the same cells/clones in 3D.Potential uses include exploring the cell lineage tree by collapsing/expanding individual branches; exploring the spatial distribution of the cells in 3D; visualizing the spatial distribution of cell clones (descendants of an ancestral cell) by selecting an ancestral node in the lineage viewer and visualizing its progeny in 3D; selecting cells in the 3D viewer to display their lineage history; visualizing the clonal relationships/distances of selected cells to all the other cells in 3D.

Input/output
To visualise a cell lineage tree and to relate it to a 3D representation of the positions of each cell, the user must provide two files: one containing the lineage tree and one containing the 3D coordinates of the same cells (with identical labels).
The lineage tree file describes the topology of the tree either in Newick or Json format.When uploading a file (Figure 1A), CeLaVi automatically identifies the format of the lineage tree file and displays the tree in the Lineage tree viewer (Figure 1E).To ensure the format of the lineage tree is correct, Json and Newick files are parsed with the Javascript standard method JSON.parse() or with the newick-tools software (available at https://github.com/xflouris/newick-tools), respectively.Branch lengths can be recorded in the input file, either as 'absolute' branch lengths (distances of each node from the root) or as 'relative' blanch lengths (distances between nodes of the tree) and the user must identify the appropriate mode.
To visualise the same cells in the 3D viewer, the user needs to upload a file of the 3D coordinates of cells (Figure 1B) in comma-separated-value (csv) format.The first row of the file is a header specifying the identities of each column ('cell', 'X', 'Y' and 'Z') and each subsequent row giving the name/ID and 3D coordinates (X, Y, Z) of each cell.The cells are represented in an interactive visualization (Figure 1F) in the 3D viewer.The image of the lineage tree or the 3D cells, as currently displayed in the visualization areas, can be exported as an image file (in SVG or PNG format) at any time.
For MaMuT (10) users, it is possible to convert a Ma-MuT single XML output file into CeLaVi lineage and 3D coordinates input files (in json and csv formats respectively) using the python script 'mamut to celavi' by Ko Sugawara, available at https://github.com/ksugar/celavi-tools.

Lineage tree viewer
CeLaVi's lineage tree viewer (Figure 1E) has been built to be scalable in order to accommodate very large trees while retaining tree legibility.To reduce the computational burden, CeLaVi has an option to plot only a subset of the tree branches.This option is automatically activated when the number of cells in the tree is greater than 500.This function is only applicable to lineage trees that are not completely resolved, i.e. with internal nodes giving rise to more than two branches (polytomies).The CeLaVi lineage viewer also allows the user to focus on specific branches of the lineage tree by expanding, collapsing or pruning selected branches, or by exporting a selected clone as a JSON file for further analysis.
Interacting with each cell in the lineage tree (including ancestral cells at nodes within the tree) allows the user to display a number of functions: hovering the pointer over a cell will display the cell ID, total number of descendants and number of descendants on the 3D viewer, and highlight the corresponding cell (or clone) in the 3D viewer; clicking cells marks the corresponding cells/clones with distinct colours in the 3D viewer; right-clicking allows a choice of expanding, collapsing, pruning or saving the selected cells/clones.For cell lineages containing branch length information (reflecting the relative timing of cell divisions), it is possible to change the visualization mode from a cladogram with fixed branch lengths, to a branch-length based representation.

3D viewer
CeLaVi's 3D viewer renders cells as spheres.The user can zoom in/out using the scroll wheel of the mouse, rotate the image by left-clicking and dragging, panning the 3D scatterplot by right-clicking and dragging.Clicking any cell in the 3D viewer highlights its full lineage, in the lineage viewer.The 'Show lineage' option allows the user to visualise the degree of lineage relationship of all cells relative to one selected cell showing the nested set of clones to which the cell belongs.

Visualizing cell clones
The spatial distribution of cell clones in CeLaVi can be visualized by clicking on any ancestral cell in the lineage tree.This attributes a colour to all the descendants of that cell on the 3D viewer.Multiple clones can be selected and visualized at the same time with unique colours.All the clones originating at a given tree depth (i.e. after a certain number of divisions or, for trees with branch lengths, existing at a certain time point) can be marked with distinct colours by using the 'Tree depth' area below the lineage tree (Figure 1K).
CeLaVi allows the user to save selected cells or cell clones, with customized annotations, in a dropdown list that can be used later to visualize them (Figure 1I).Sets of cells/clones can also be saved as a .csvfile that can later be reloaded as a cell annotation file (see below).

Visualizing cell annotations and gene expression
Two additional files can be loaded to provide information associated with the cells in the two viewer windows.
Cell type information (or indeed any other cell annotation) can be uploaded as a csv file using the 'Cell annotations file' input box (Figure 1C).The information from this file is displayed as an interactive table with the annotations as coloured rows (Figure 1G).For example, selecting the 'muscle' annotation in the Ciona dataset, labels the muscle cells in both the 3D viewer and the lineage viewer.
Gene expression data (Figure 1D), can be uploaded as a .csvfile using the 'Gene expression file' input box.To see the relative expression levels of a gene of interest, the user types the gene name in the search box (which has an autofill function) and clicks 'submit'.The gene expression levels will be represented on both the 3D and lineage viewers using a heatmap.Figure 2 shows the expression levels of gene Sox14 in the C. intestinalis gastrula.The gene expression highlighting option can be used to plot any other quantitative data associated with the cells (UMIs, overall gene expression, etc).For details on the format requirements visit the tutorial (http://www.celavi.pro/tutorial.html).

Example datasets
We include four example datasets that demonstrate CeLaVi's features (see Table 2).
Caenorhabditis elegans L1 larva.The embryonic cell lineage of the nematode Caenorhabditis elegans was first described by Sulston and collaborators in 1983 (2).The data used for the cell lineage and the cell types were extracted from a json file made available by Nikhil Bhatla at wormweb.org/celllineage.The complete cell lineage was trimmed back to the L1 larval stage.The 3D coordinates come from the study of Long and collaborators (11), where they mapped the positions of 357 cells (out of the 558 cells) of the L1 larval stage, using confocal image stacks from 15 individual worms.
Ciona intestinalis gastrula.The cell lineage of the ascidian Ciona intestinalis was described by Conklin in 1905 ( 12).The cell lineage example/test file (in newick format) was created using Conklin's lineage and nomenclature, from the zygote to the 110-cell stage.The 3D coordinates of the cells in the Ciona gastrula were obtained from a reconstructed 3D embryo model (Mid 112-cell stage Amira 1.obj file; (13)), available in the Aniseed database (14).
The 3D embryo model contains information in cell shapes.We used the cell centroid to represent each cell as a single point in 3D space.The gene expression data were obtained from the single-cell sequencing dataset published by Levine and collaborators (15).We used the raw expression data matrix (expression matrix C110.1.tsv),containing the expression levels of 15 307 genes in 1731 cells, together with the associated metadata file (C110.1.clusters.upload.rename.1.txt)that contains the cell type identity of each cell at the early gastrula stage.We used the R software version 3.6.3(https://www.R-project.org/) with the Seurat package version 3.1.4(16) to identify the 500 genes with the most variable expression between cells and to obtain their average expression values for each cell.The gene names correspond to human gene IDs, derived from the Ciona intestinalis genome assembly KH2012 with NCBI Gene Model to Best Blast Hit mapping, available in the Aniseed database.Only the gene ID with the highest Blast e-value is shown.
Parhyale hawaiensis limb.The cell lineage and 3D coordinates of the limb of the crustacean Parhyale hawaiensis were obtained by Pavlopoulos and collaborators (10).Transgenic fluorescently-labeled embryos were imaged with multi-view light-sheet microscopy at high spatiotemporal resolution over several days of embryogenesis.The cell lineage was reconstructed with the aid of the MaMuT software.
In silico organoid.The 'organoid' dataset comes from a simulation of morphogenesis using the ya||a software (17).The organoid is the product of a simulation of branching morphogenesis with epithelium and mesenchyme (only the epithelial cells are recorded in this example).The simulation was kindly provided by Miquel Marín-Riera, coauthor of the ya||a software and is based on the example 'branching.cu'available in https://github.com/germannp/yalla.

Comparison with other software
CeLaVi is, to our knowledge, the first interactive web-based visualization of cell lineages.It was inspired by web based visualizations of phylogenetic trees, such as phylo.ioand Evolview3 (18,19).The most similar existing implementation of some of these features is found in Morphonet (20) which is a webserver software for visualizing morphological data.Morphonet shares some commonalities with CeLaVi but also has some important differences we discuss below.The main feature of Morphonet is the visualization of complex 3D morphological information with the possibility of including multi-time point segmentation data.The morphological units to be visualized (as mesh objects) can be organs, tissues or cells.Morphonet offers the possibility of integrating additional information like gene expression and cell lineage, but cell lineage viewing is not its main focus, and the interactive manipulation of the cell lineage data as well as its integration with the spatial information is limited.In CeLaVi, the units for 3D visualization are the cells' positions as 3D coordinates, which are rendered as spheres (users can modify sphere size).This, although an obvious over simplification of the cells' morphology, allows for (i) a highly responsive and fast-rendered 3D visualization and (ii) the storage of spatial information into a small human-readable file.As an example, the size of the Ciona gastrula 3D coordinates file, consisting of 112 cells, is 400 times smaller (6.6 kB) than the obj file (2.7 Mb) it was derived from.We believe Morphonet and CeLaVi are complementary visualization tools and that users will decide which to use depending on their visualization goals.

Limitations and perspectives
All computations in CeLaVi are performed on the client side.This makes CeLaVi scalable and responsive as the data visualized in CeLaVi are not sent to or stored in the webserver.We believe this is an advantage as it can alleviate concerns that researchers might have about uploading unpublished data to servers.The main disadvantage of client-side computing is that there is a maximum amount of data that can be handled without experiencing delays that depends on the client computer.We have noted that CeLaVi becomes less responsive when >10 000 cells are loaded.We provide some suggestions to improve the responsiveness of CeLaVi when dealing with these very large datasets in the tutorial.A second limitation of CeLaVi is that the 3D viewer shows the spatial distribution of the cells at the final time point only.We plan to implement a multi-time-point 3D viewer, together with other functions requested by users of CeLaVi, in the near future.

Figure 1 .
Figure 1.The CeLaVi user interface, loaded with the Ciona intestinalis gastrula dataset.The main areas of the interface are labelled: (A) tree file input; (B) cell coordinates file input; (C) cell annotations file input; (D) gene expression file input; (E) lineage viewer; (F) 3D viewer; (G) cell annotations table; (H) cell lineage tree controls; (I) clones controls; (J) 3D cells controls; (K) tree depth area.Cells show cell fates with a colour code based on the cell annotations table.For more details visit the tutorial (http://www.celavi.pro/tutorial.html).

Figure 2 .
Figure 2. Ciona intestinalis gastrula example dataset showing the expression pattern of gene Sox14 as a heatmap (colour code below the 3D viewer area).

Table 1 .
OS and browser compatibility

Table 2 .
Example datasets available in CeLaVi