# LiveFly: A Toolbox for the Analysis of Transcription Dynamics in Live Drosophila Embryos

Huy Tran, Carmina Angelica Perez-Romero, Teresa Ferraro, Cécile Fradin, Nathalie Dostatni, Mathieu Coppey, Aleksandra Walczak

► To cite this version:

Huy Tran, Carmina Angelica Perez-Romero, Teresa Ferraro, Cécile Fradin, Nathalie Dostatni, et al. LiveFly: A Toolbox for the Analysis of Transcription Dynamics in Live Drosophila Embryos. Morphogen Gradients, 1863, Springer New York, pp.183-195, 2018, Methods in Molecular Biology, 10.1007/978-1-4939-8772-6_11. hal-03987706

HAL Id: hal-03987706

https://hal.science/hal-03987706

Submitted on 17 May 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# LiveFly - a toolbox for the analysis of transcription dynamics in live

## *Drosophila* embryos

Huy Tran¹,², Carmina Angelica Perez-Romero²,³, Teresa Ferraro¹,⁵, Cecile Fradin²,³, Nathalie Dostatni²,
Mathieu Coppey⁴* and Aleksandra M. Walczak¹*

### Affiliations

¹Ecole Normale Supérieure, PSL Research University, CNRS, Sorbonne Université, Physique Théorique, Paris, France.

²Institut Curie, PSL Research University, CNRS, Sorbonne Université, Nuclear Dynamics, Paris, France.

³McMaster University, Hamilton, Ontario, Canada.

⁴Institut Curie, PSL Research University, CNRS, Sorbonne Université, Physico Chimie, Paris, France.

⁵Institut de Biologie Paris-Seine, Sorbonne Université, CNRS, Developmental Biology, Paris, France.

* Equal contribution

### Corresponding authors:

awalczak@lpt.ens.fr and Mathieu.Coppey@curie.fr

Running head : live-transcription Movies Analysis Tool
**Summary**

We present the *LiveFly* toolbox for quantitative analysis of transcription dynamics in live *Drosophila* embryos. The toolbox allows users to process two-color 3D confocal movies acquired using nuclei-labeling and the fluorescent RNA-tagging system described in the previous chapter and export the nuclei's position as a function of time, their lineages and the intensity traces of the active loci. The toolbox, which is tailored for the context of *Drosophila* early development, is semi-automatic, and requires minimal user intervention. It also includes a tool to combine data from multiple movies and visualize several features of the intensity traces and the expression pattern.

**Key words:** Drosophila melanogaster, real-time monitoring, transcription dynamics, image analysis, early development

**1. Introduction**

The adaptation of the RNA fluorescent tagging system to fly embryos allows us to capture the temporal aspects of transcription [1, 2]. This system makes use of interactions between a specific Coat Protein (e.g. MCP) and an RNA stem loop generally derived from viral systems (e.g. MS2 stem loop) to monitor the dynamics of nascent RNA at the active transcription loci (see previous Chapter). These constructs, such as the MCP-GFP [1, 2] and PP7 [3] systems have been successfully implemented in the *Drosophila* embryo and used to reveal several important features of gene expression in the early phase of development [1-6].

Obtaining biological information from the unprecedented real-time observations of transcription dynamics using the MCP-MS2 system requires processing of the movies obtained from microscopy.
Many available tools [7, 8] were developed for bacterial colonies and are not well adapted for the
analysis of fly images. They lack the flexibility of switching between a specialized automatic mode, which
is essential for efficient processing, to manual intervention mode, which are often required to maximize
the amount of samples acquired from each time-consuming experiment.

In this chapter, we present the *LiveFly* toolbox, which provides an interface for the analysis of the MCP-MS2 movies acquired in the early nuclear cycles, from nuclear cycle (nc) 10 to nc 14, using the confocal microscope. From the movie's two colored channels, one for nuclear labeling and one for observations of nascent mRNA dynamics, the interface exports the nuclei's position, lineage and the intensity of the active loci as a function of time. The processing is semi-automatic: it requires user input only at the beginning of the process, but allows users to intervene for manual corrections if needed. It also includes a Visualizer to combine the data from multiple movies and visualize several features of the intensity traces and the pattern. The toolbox has been used to study the hunchback patterning system [9, 10], reducing processing time for each movie from days to hours.

The *LiveFly* toolbox has three modules as shown in Fig. 1, forming a pipeline for movie processing and analysis. We present the functions and guide the reader through each module in the following sections.

## 2. Materials

### 2.1 System requirements

1. MATLAB 2013 or above, with the Image Processing Toolbox

2. The *LiveFly* toolbox: available for download from:
https://github.com/huytran216/LiveFly_toolbox (see Note 1)
We opted to combine popular cell segmentation methods for static images [8, 11, 12] with frame-by-frame image registration for precise and efficient nuclei tracking. For fast computation, we perform nuclei segmentation on 2D images created by a maximum projection of the image stacks onto the Z-axis (optical axis).

### 3.1.1 Maximum projection

This step creates a 2D movie from the histone/NUP channel of the original 3D movie for nuclei segmentation. The image in each frame of the 2D movie is the maximum projection of the corresponding 3D image. Added to this, between every two consecutive frames, an image registration, which records the displacement of image regions from one frame to another, is computed. This registration will be used to predict the movement of nuclei in the subsequent nuclei tracking and lineage construction.

1. In the LiveFly toolbox's main folder, open `Cell segmentation/LiveFly_CREATE_PROJECTION.m` with the MATLAB editor.

2. Specify the 3D movie file name and path (Line 4-6), the output 2D movie name and the frame range of interest (Line 8-9) (see **Note 4**).

3. Run the script (Press F5).

This process will create two files in the input folder: a maximum projection file of the nuclei in TIF format (hereby referred as **RED.tif**), and a MATLAB data file containing the frame registration information (named **REDCourtMat**).
### 3.1.2 Nuclei Segmentation

The nuclei segmentation process is performed on the Segmentation platform. The user interface layout is shown in Fig. 2. At any time, you can load and save the segmentation progress. The segmentation in each frame is automatic based on the specified parameters, followed by manual correction if necessary.

#### Step by step (see Note 5):

1. In the LiveFly toolbox's main folder, run `Cell segmentation/LiveFlySEGMENTATION.m` to start the nuclei segmentation user interface.

2. Load the 2D maximum projection movie via `Menu> File> Load image...`

3. Specify the average nuclear size and intensity threshold for nuclear segmentation. You will see the preview of the segmentation result in the Mask Panel.

4. Click on **Segment** for automatic segmentation of the current frame with the specified parameters. You can examine the segmentation result by cycling through the View Modes using **View>Cycle** | **View (X)** (see Note 6). The View Mode 4 is recommended to check both the segmentation result and the overlap of nuclei masks between frames (which is critical in nuclei tracking).

5. Manually increase or decrease the size of all masks by one pixel by pressing `BW+/BW-` respectively (see Note 7).

6. Update the number of pixels needed to be added to the mask's size in the **Auto-size** section (use negative numbers to decrease the mask size). This will enable automatic mask size adjustment following the segmentation process. The **Auto-size** parameter is generally constant throughout the processing of the whole movie.
7. Select **Menu> Edit> Realign** for image re-registration if necessary. You can opt for automatic registration or manual registration using the MATLAB built-in tool (see **Note 8**).

8. Manually correct the masks if needed. You can add new nuclei masks or remove existing masks by accessing **Menu> Edit**

9. Apply the automatic segmentation and mask size adjustment to the next frame by selecting **Menu> Edit> Propagate Next/Prev** (see **Note 9**). Continue this frame-by-frame automatic segmentation until parameter adjustments and manual corrections are required.

### 3.1.3 Nuclei tracking

In the nuclei tracking process, the program uses the image registration to determine a nucleus's ancestor in the previous frame. Two nuclei in two consecutive frames are considered ancestor-descendant if their masks, realigned based on the image registration, overlap (see **Note 10**). If this nucleus has only one descendant in the next frame, this descendant is treated as the same nucleus. If it has more than one descendant in the next frame, the two most overlapping descendants are considered as the two daughters of that nucleus.

1. Press **Menu> Track** to begin nuclei tracking across frames.

2. Check the lineage tree by selecting **Menu> Track> Plot Lineage Tree** (as shown in Fig. 3) for abnormalities in the timing of nuclear divisions. You can identify the frames and nuclear ID with abnormalities by clicking on the lineage tree.

3. Most abnormalities are caused by imperfect image registration and nuclei masks being too small (there is no overlap between a nucleus and its intended ancestor). Examine the frames
and nuclei with abnormalities by selecting **Menu>Track>Check Track** and perform manual corrections with the provided tool (add/remove/resize masks) on them if needed (see **Note 11**).

4. Once all the abnormalities are corrected, rerun the tracking process.

5. Reassign the nuclear cycle by selecting **Menu>Track>Reassign nuclear cycle**. You will be asked to specify the frame range for each nuclear cycle. The input will be used to determine which nuclear cycle each nucleus belongs to.

## 3.2. Spot detection

The spot detection module extracts the fluorescent spot location and intensity from the 3D green channel. Spots are first identified using the threshold method (see below) and then fitted with a 2D Gaussian landscape, from which the spot intensity is extracted. This module will also combine the spot information and the nuclei segmentation result to create the movie's complete output file, which is used in subsequent analyses.

1. In **LiveFly** toolbox's main folder, open **Spot detection> main_Spot_detection.m** in the MATLAB editor. Set the raw 3D movie and 2D nuclei movie path (line 7-9).

2. Determine the threshold **th=[th(1) th(2)]** for spot detection. Here, **th(1)** is the minimum absolute spot intensity and **th(2)** is the minimum absolute spot intensity above the local background level (determined using a median filter). These two values are used for the initial identification of the fluorescent spots. Only the brightest spot(s) located in the nucleus space are considered active transcription loci. The threshold values are determined as follows:

2-a Run the script. An input dialog will appear asking you to either enter the debug mode to determine **th** or proceed with the spot detection. Select "Yes" to enter the debug mode.
2-b Select the frame in which you know that there is a spot in the next input dialog.

2-c Zoom into the spot location and determine the threshold values, based on the two panels (see **Note 12**) (Fig. 4) using the built-in MATLAB Zoom In and Data Cursor.

2-d Quit the script by pressing Ctrl+C.

3- Set the value of `th(1)` and `th(2)` in the editor. Set the frame range of interest by modifying both `it_start` and `it_end` (line 15-16). Run the script. Skip the debug mode this time.

4- The complete movie output file, containing frame-by-frame nuclei locations, lineages and its spot intensity, are stored in the subfolder `table_summary` of the 3D movie's directory (see **Note 13**). check `Spot_detection/Header.txt` for the output file's header. A MATLAB file (in the format `_config.m`) specifying the movie's time and spatial resolutions, and the parameters for spot detection is also generated.

5- Check the spot detection results by opening the newly generated movie, located in the subfolder `<output_images>` folder (see **Note 14**).

### 3.3 Post-analysis correction

The exported output file is generally ready for subsequent analysis. However, due to many reasons, such as nuclei moving in and out of the captured region, it may be necessary to crop the movie frame, ignore specific nuclei, or a whole nuclear cycle.

1- Copy the file `Data analysis/correction.m` to the output file folder.

2- Specify the output file name and possible exceptions (e.g. bad nuclei, frames, nuclear cycles) in this file. See the comments in the correction file for details (see **Note 15**).
### 3.4. Pattern visualizer

The pattern visualizer is a graphical user interface that aids users to merge data from multiple fly movies of the same strain and genetic construct and visualize them, either individually or together. The interface is shown Fig. 5 in with examples of data.

To access the visualizer, run `Data analysis/ LiveFly_VISUALIZER.m`

#### 3.4.1 Managing the dataset

1. Create a new dataset by selecting **Menu>File>Create dataset**.

2. Select **Add...** to add a new movie to the dataset. A dialog will appear inquiring for the movie correction file.

3. Edit the movie list with **Remove/Move Up/Move Down** buttons.

4. Select the nuclear cycle of interest in each movie by editing the tick boxes.

5. save/load the dataset any time using **Menu>File** (see **Note16**)

#### 3.4.2 Initial analysis

1. Click on **Load movies** to load data from all the movies.

This step will read the movie output files, and extract information about each nucleus, including its position, nuclear cycle, lineage, and the intensity traces of active transcription loci. The exceptions specified in the correction file are taken into account. The program will extract several features of the traces, such as the total spot intensity (ΣI), the mean spot intensity (μI), time of first spot appearance (t init ), the total spot appearance duration (t active ), etc. See

`<Menu>Help>Show feature description>` for the feature list and description.
2. Select a range of proper interphase duration for each nuclear cycle (see **Note 17**) by selecting **Refine interphase**.

3. Extract the feature pattern by clicking **Extract feature**.

This step will fit the trace feature values along the embryo anterior-posterior (AP) axis in each movie with a Hill function, from which the maximum intensity level, the pattern's border position (coordinate of the half-maximum expression point) along the AP axis and the Hill coefficient are extracted. It is possible to impose the same Hill coefficient or maximum intensity level on all movies by selecting the options in **Hill fitting option**. Note that only patterns in the movies that are selected in tick boxes will be fitted.

4. Following this step, all the nuclei information and the Hill fitting results can be exported in an excel file by selecting **Menu>Export xls**. It is recommended to save the dataset after this step to save time in future analysis.

### 3.4.3 Pattern Viewer

Once the movie data have been imported and processed, the trace feature patterns can be viewed in individual embryos (using **Show single movie feature** buttons) (Example in Fig. 6) or the movie patterns can be merged together (using **Show all movie feature** buttons) (Example in Fig. 7).

Edit the tick boxes list at the bottom of the interface to select the features of interest and determine how to visualize their patterns.

## 4. Notes
Note 1. The `README.md` file contains a link to a 3D sample movie and the microscopy configurations, which can be used to familiarize oneself with the whole process.

Note 2. The color of the nuclei or MCP channel is not necessarily fixed. The nuclei channel can be specified in the variable `channel` (line 8).

Note 3. The information on exceptions (e.g. bad nuclei, frames, nuclear cycles) is only needed after analysis of the raw movie and can be updated anytime.

Note 4. It is possible to analyze only a subsection of the movie by specifying the frame range (`it_start`, `it_end` variables (line 35-36)). In general, incomplete nuclear cycles or the second half of nuclear cycle 14 (after cellularization) are ignored.

Note 5. Once the basics of the segmentation process is understood, it is advisable to familiarize oneself with the hotkeys. The segmentation tool is designed so that most frames can be segmented with hotkeys alone. Actions involving pointers, such as mask adding/removing, are required infrequently during mitosis.

Note 6. There are 4 view modes, accessible from the menu or the hotkey X.

1. Mode 1 shows the original nuclei image.

2. Mode 2 shows the original image with the overlays of the nuclei masks in red.

3. Mode 3 shows the original image with nuclei masks as wireframes. This is useful when visualizing densely populating masks (e.g. nuclear cycle 14).

4. Mode 4 shows in wireframe the nuclei mask plus the previous frame masks as red overlay.

Mode 4 is useful to recognize new cells that appear during segmentation. If a nucleus is
detected in the current frame but has no overlap with any nuclei in the previous frame, its mask
will appear as a blue wireframe instead of white.

Note 7. The nuclei real radius is generally a few pixels larger than the detected size. It is advisable to adjust the mask size to the real size to minimize errors in the subsequent spot detection process.

Note 8. View mode 4 is useful to check for the displacement of the nuclei between frames. While the image registration should work properly throughout the cycle interphase, it may fail during mitosis due to rapid mitotic waves. In this case, manual registration, which is done by a few clicks, is needed.

Note 9. This step can be done with the hotkey *Space*. Generally, the automatic segmentation parameters require few adjustments during the whole process. The whole nuclear cycle interphase can be analyzed by using *Space*, *inspection*, *Space*, *inspection* etc.

Note 10. Given the movement of nuclei during the development phase, it is recommended that the movie time resolution is kept below 20 s per frame if the users want to track nuclei across mitosis. However, if users are only interested in specific nuclear cycles, the time resolution can be as slow as 40 s per frame.

Note 11. Due to the fast movement of nuclei during mitosis, nuclei masks between frames may not overlap with one another leading to bad nuclei tracking. In this case, you should increase the mask size (using BW+) until they overlap. View Mode 4 is very useful for this correction.

Note 12. The first spots that are visually detected are typically bright spots, the threshold values should therefore be slightly lower than half of their peak intensity. Note that setting the value of `th(1)` and `th(2)` too low will increase the rate of false positive detections (there is no spot in the nucleus but the program detects that there is), resulting in detected spots with near-zero intensity. This does not affect the spot intensity traces drastically but it may be computationally more expensive, due to the high
Note 17. This step will retain the nuclei that are detected within a certain time range. It is helpful to remove nuclei that move in and out of the captured image region.

**5. Acknowledgements**

This work was supported by a Marie Curie MCCIG grant No. 303561 (AMW), PSL IDEX REFLEX (ND, AMW, MC), ANR-11-LABX-0044 DEEP Labex (ND), ANR-11-BSV2-0024 Axomorph (ND and AMW) and PSL ANR-10-IDEX-0001-02. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
6. References

1. Garcia HG, Tikhonov M, Lin A, and Gregor T (2013) Quantitative Imaging of Transcription in Living Drosophila Embryos Links Polymerase Activity to Patterning. Curr Biol 23: 2140-2145. doi: 10.1016/j.cub.2013.08.054

2. Lucas T, Ferraro T, Roelens B et al (2013) Live imaging of Bicoid-dependent transcription in Drosophila embryos Curr Biol 23: 2135-2139. doi: 10.1016/j.cub.2013.08.053.

3. Fukaya T, Lim B, Levine M. (2016) Enhancer Control of Transcriptional Bursting. Cell 166: 358-368. doi: 10.1016/j.cell.2016.05.025

4. Bothma JP, Garcia HG, Esposito E et al (2014) Dynamic regulation of eve stripe 2 expression reveals transcriptional bursts in living Drosophila embryos. Proc Natl Acad Sci USA 111: 10598-10603. doi: 10.1073/pnas.1410022111

5. Desponds J, Tran H, Ferraro T et al (2016) Precision of Readout at the hunchback Gene: Analyzing Short Transcription Time Traces in Living Fly Embryos. PLOS Comp Biol 12: e1005256. doi: 10.1371/journal.pcbi.1005256

6. Ferraro T, Esposito E, Mancini L et al (2016) Transcriptional Memory in the Drosophila Embryo. Curr Biol 26: 212-218. doi: 10.1002/wdev.221

7. Santinha J, Martins L, Häkkinen A et al (2016). iCellFusion: Tool for fusion and analysis of live-cell images from time lapse multimodal mycroscopy. In: Karâa WBA, Dey N (ed), Biomedical image analysis and mining techniques for improved health outcomes, IGI Global. doi: 10.4018/978-1-4666-8811-7

8. Young JW, Locke JCW, Altinok A et al (2011) Measuring single-cell gene expression dynamics in bacteria using fluorescence time-lapse microscopy. Nat Protoc 7: 80. doi: 10.1038/nprot.2011.432

9. Driever W, and Nusslein-Volhard C (1988) A gradient of bicoid protein in Drosophila embryos. Cell 54: 83-93. doi: 10.1016/0092-8674(88)90183-3
10.Porcher A, and Dostatni N (2010) The Bicoid morphogen system. Curr Biol 20: R249-R254. doi: 10.1016/j.cub.2010.01.026

11.Häkkinen A, Muthukrishnan AB, Mora A et al (2013) CellAging: a tool to study segregation and partitioning in division in cell lineages of Escherichia coli. BMC Bioinformatics 24: 1708-1709. doi: 10.1093/bioinformatics/btt194

12.Otsu N (1979) A threshold Selection Method from Gray-Level Histograms. IEEE Trans Syst Man Cybern C 62-66.
## Figure Captions

**Figure 1. Modules of the LiveFly toolbox.** (A) The Nuclei segmentation module extracts from the 3D movie's nuclei channel (marked by either fluorescent histones or NUP) the temporal position and lineage of each nucleus. (B) The Spot detection module extracts the intensity trace of active transcription loci in each nucleus. (C) The Visualizer module allows users to manage the data from multiple movies and to visualize the pattern of several features of the transcription dynamics.

**Figure 2. Nuclei segmentation user interface.** The interface allows users to observe the segmentation (performed automatically) result, illustrated in the Mask panel and the Original image panel, in each frame. Users can adjust the segmentation parameters or perform manual corrections through a range of tools accessible via the Menu and hotkey.

**Figure 3. Example of a nuclei lineage tree.** The y-axis denotes the frame number. Each data point (circle) marks the birth of a new nucleus (either by division or by entering the captured image region). The data point's x-coordinate is set to the nucleus' ID. Mother and daughter nuclei are linked by solid lines. The textbox and the colored column on the right side specify the frames' nuclear cycle: Frames of the same nuclear cycle will have the same color. The tag specifying the selected frame and nucleus ID is accessed via MATLAB's Data Cursor.

**Figure 4: Determining the threshold value for spot detection.** Example of a zoomed-in spot in a specific z stack, from which the value of *th(1)* and *th(2)* from the original image panel (left) and median filtered image panel (right) are retrieved, respectively. The pixel intensities are scaled on a color map for easy spot identification. The data on the spot intensity (Index) is shown using the MATLAB built-in Data Cursor.
**Figure 5. Pattern Visualizer.** The interface allows the user to manage movies acquired with similar conditions, extract features from the trace intensity of active transcription loci and visualize their pattern in individual or merged embryos.

**Figure 6. Examples of individual movie transcription patterns in different nuclear cycles:**

Shown are examples of patterns for the relative promoter active time ($t_{active}$, A) and the mean spot intensity (µl, B) for each nuclear cycle. The subplots on the left show the nuclei's 2D position (brighter nuclei corresponds to higher feature values, as in the color bars). The y-axis can be either side-by-side or ventral-dorsal axis, with unit in percentage of embryo length. The subplots on the right show the feature values (blue cross) along the AP axis along with the fitted Hill function (dashed). The x-axis describes the nuclei position along the embryo AP axis, with the middle point at position 0%.

**Figure 7. Examples of merged movie transcription patterns in nuclear cycle 13: (A) Example patterns for the relative promoter active time ($t_{active}$) and the mean spot intensity (µl) for 4 selected movies, accessed by <Summary> button. (B) Merged patterns from 4 selected movies, accessed by the <View pattern> button. Also shown are the mean and standard deviation (solid black line) of the feature values at each position along the AP axis.**
<figure><img src="image_2.png" /><figcaption>Figure 2 :</figcaption></figure>

<figure><img src="image_3.png" /></figure>
<figure><img src="image_4.png" /><figcaption>Figure 4 :</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Figure 5 :</figcaption></figure>
<figure><img src="image_6.png" /><figcaption>Figure 6:</figcaption></figure>

<figure><img src="image_7.png" /></figure>
<figure><img src="image_8.png" /><figcaption>Figure 7:</figcaption></figure>