dataesr/scientific-paragraphs-categorization huggingface dataset:
e. the MRCA likely also contained evidence of that recombination event), the ancestral sequences were inferred with partitions at the identified recombination breakpoint sites, across which tree topologies were free to vary. 2. For all other recombination events (i. e. those with no evidence of being present within the MRCA sequence being inferred), every nucleotide within all recombinationally-derived genome fragments were replaced in the sequences being analysed using '-" symbols (in this case denoting missing data). The inference of MRCA sequences was carried out on subsets of between 252 and 346 of the original 871 sequences, as the full 871 sequence alignment could not be processed in a reasonable amount of time (Supplementary file 4; alignments in Supplementary Data 1-3). These subsets were selected based on both the phylogenetic relatedness of sequences to the MRCA being inferred, and the degrees of relatedness of sequences to others in the analysed dataset.
Phylogenetic inference of past virus infection symptoms Prior to fitting a dated-tip molecular clock model in a Bayesian inference approach, we evaluated the temporal signal using regressions of root-to-tip genetic distances against sequence sampling times. The analyses were based on maximum likelihood trees inferred with the program FastTree  (Price et al. , 2010)  and the determination coefficients (R 2 ) of the linear regression were estimated with the program TempEst  (Rambaut et al. , 2016). The p-values were calculated using the approach of  Murray et al. (2016)  and based on 1000 random permutations of the sequence sampling dates  (Navascues et al. , 2010). This root-to-tip regression analysis confirmed the presence of a significant temporal signal (R 2 = 0. 196, p-value<0. 001). Phylogenetic inference was performed with BEAST 1.
We analysed an alignment of 60 sequences from which recombinant regions were removed. The alignment -containing the 59 phenotyped MSV-A isolates and a single phenotyped MSV-B isolate used as an outgroup (alignment in Supplementary Data 4) -was constructed as above using MUSCLE and edited using IMPALE. During phylogenetic inference, clades descending from inferred ancestral sequences were constrained in order to ensure that the node corresponding to the seven reconstructed ancestral sequences existed within the final trees. We ran an MCMC of 500 million generations, sampling every 0. 1 million generations and removing the first 2% of samples as burn-in. A maximum clade credibility tree (MCC tree) was then inferred from the posterior tree distribution using TreeAnnotator 1. 10 from the BEAST package  (Suchard et al.
Acknowledgements ALM was supported by a  Swedish   Institute scholarship  ( 00448/2014 ) to conduct this research at The  Swedish University of Agricultural Sciences (Uppsala) , and is currently supported by the  Research Council of Norway  ( 267978/E40 ). SD is supported by the  Fonds National de la Recherche Scientifique  ( FNRS, Belgium ) and was previously funded by the  Fonds Wetenschappelijk Onderzoek (FWO, Belgium). KAO is supported by the  South African National Research Foundation (NRF)  and The  World Academy of Science (TWAS). PL1 is supported by the  European Union :  European Regional Development Fund (ERDF) , by the  Conseil Regional de La Reunion  and by the  Centre de cooperation Internationale en Recherche Agronomique pour le Developpement (CIRAD). GWH is supported by a  South African National Research Foundation  Grant number  TTK1207122745.
While deep learning-based methods define the state-of-the-art for all image segmentation problems, only a handful of software packages strives to make them accessible to non-expert users in biology (reviewed in  [20] ). Notably, the U-Net segmentation plugin for ImageJ  [21]  conveniently exposes U-Net predictions and computes the final segmentation from simple thresholding of the probability maps. CDeep3M  [22]  and DeepCell  [23]  enable, via the command-line, the thresholding of the probability maps given by the network, and DeepCell allows instance segmentation as described in  [19]. More advanced post-processing methods are provided by the ilastik Multicut workflow  [24] , however, these are not integrated with CNN-based prediction. Here, we present PlantSeg, a deep learning-based pipeline for volumetric instance segmentation of dense plant tissues at single-cell resolution.
PlantSeg processes the output from the microscope with a CNN to produce an accurate prediction of cell boundaries. Building on the insights from previous work on cell segmentation in electron microscopy volumes of neural tissue  [13, 15] , the second step of the pipeline delivers an accurate segmentation by solving a graph partitioning problem. We trained PlantSeg on 3D confocal images of fixed Arabidopsis thaliana ovules and 3D+t light sheet microscope images of developing lateral roots, two standard imaging modalities in the studies of plant morphogenesis. We investigated a range of network architectures and graph partitioning algorithms and selected the ones which performed best with regard to extensive manually annotated groundtruth. We benchmarked PlantSeg on a variety of datasets covering a range of plant organs and image resolutions.
Overall, PlantSeg delivers excellent results on unseen data, and, as we show through quantitative and qualitative evaluation, new datasets do not necessarily require network retraining. PlantSeg is a free and open source tool which contains the complete pipeline for segmenting large volumes. Each step of the pipeline can optionally be adjusted via a convenient graphical user interface while expert users can modify the Python code or provide their own pre-trained networks for the first step of the pipeline. Besides the tool itself, we provide all the networks we trained for the confocal and light sheet modalities at different resolution levels and make all our training and validation data publicly available.
Datasets To make our tool as generic as possible, we used both fixed and live samples as core datasets for design, validation and testing. Two microscope modalities common in studies of morphogenesis were employed, followed by manual and semi-automated annotation of groundtruth segmentations. The first dataset consists of fixed Arabidopsis thaliana ovules at all developmental stages acquired by confocal laser scanning microscopy with a voxel size of 0. 075×0. 075×0. 235 µm. 48 volumetric stacks with hand-curated groundtruth segmentation were used. A complete description of the image acquisition settings and the groundtruth creation protocol is reported in  [26]. The second dataset consists of three time-lapse videos showing the development of Arabidopsis thaliana lateral root primordia (LRP).
Each recording was obtained by imaging wild-type Arabidopsis plants expressing markers for the plasma membrane and the nuclei  [27]  using a light sheet fluorescence microscope (LSFM). Stacks of images were acquired every 30 minutes with constant settings across movies and time points, with a voxel size of 0. 1625 × 0. 1625 × 0. 250 µm. The first movie consists of 52 time points of size 2048 × 1050 × 486 voxels. The second movie consists of 90 time points of size 1940 × 1396 × 403 voxels and the third one of 92 time points of size 2048 × 1195 × 566 voxels. The groundtruth was generated for 27 images depicting different developmental stages of LRP coming from the three movies (see Supp. Appendix A ). The two datasets were acquired on different types of microscopes and differ in image quality.
Input Boundary Predictions Segmentation The average PSNR measured on the light sheet dataset was 22. 5 ± 6. 5 dB (average ± SD, n = 4), 3. 4 dB lower than the average PSNR computed on the confocal dataset (25. 9 ± 5. 7, n = 7). Similarly, the average SSIM is 0. 53 ± 0. 12 for the light sheet, 0. 1 lower than 0. 63 ± 0. 13 value measured on the confocal images. Both datasets thus contain a significant amount of noise. LSFM images are noisier and more difficult to segment, not only because of the noise, but also due to part of nuclear labels being in the same channel as membrane staining. In the following we describe in detail the design and performance of each of the two steps of the pipeline.
Step 1: cell boundary detection We performed quantitative comparison of several design choices in the network architecture, loss function and training protocol. We trained one set of CNNs for each dataset as the ovule and lateral root datasets are substantially different. In more detail, we compared the regular 3D U-Net as described in  [10]  with a Residual U-Net from  [29]. We tested two loss functions commonly used for the semantic segmentation task: binary cross-entropy (L BCE )  [9]  and Dice loss (L Dice ). We additionally investigated whether the size of patches used for training influenced the performance. For this, we compared training on a single large patch, versus training on multiple smaller patches per network iteration. For single patch we used group normalization  [30]  whereas standard batch normalization  [31]  was used for the multiple patches.
Finally, besides the regular data augmentation techniques, we add more training data by corrupting the training volumes by additive Gaussian and Poisson noise with random settings. In the ovule dataset, 39 stacks were randomly selected for training, two for validation and seven for testing. In the LRP dataset, 27 time points were randomly selected from the three videos for training, two time points were used for validation and four for testing. The performance of different CNNs is illustrated by the precision/recall curves evaluated at different threshold levels of the predicted boundary probability maps (Figure  2 ). All models performed well on both the ovule and the LRP datasets (see also Supp. Figure  3  and Supp. Table  2  ). On the ovule dataset training with several smaller patches and batch normalisation performed better.
We tested four different partitioning strategies: Multicut  [32] , hierarchical agglomeration as implemented in GASP average (GASP)  [33] , Mutex watershed (Mutex)  [14]  as well as the distance transform (DT) watershed  [34]  as a baseline since similar methods have been proposed previously  [18, 19]. To quantify the accuracy of the four segmentation strategies we use Adapted Rand error (ARand) for the overall segmentation quality and two other metrics based on the variation of information  [35] , measuring the tendency to over-split (VOI split ) or over-merge (VOI merge ), see section 4. 4. GASP, Multicut and Mutex watershed consistently produced accurate segmentation on both datasets with low ARand errors and low rates of merge and split errors (Figure  3A -C and Supp. Table  3  ). As expected DT watershed tends to over-segment with higher split error and resulting higher ARand error.
Multicut solves the graph partitioning problem in a globally optimal way and is therefore expected to perform better compared to greedy algorithms such as GASP and Mutex watershed. However, in our case the gain was marginal, probably due to the high quality of the boundary predictions. The performance of PlantSeg was also assessed qualitatively by expert biologists. The segmentation quality for both datasets is very satisfactory. For example in the lateral root dataset, even in cases where the boundary appeared masked by the high brightness of the nuclear signal, the network correctly detected it and separated the two cells (Figure  3D , green box). On the ovule dataset, the network is able to detect weak boundaries and correctly separate cells in regions where the human expert fails (Figure  3E  , green box).
The main mode of error identified in the lateral root dataset is due to the ability of the network to remove the nuclear signal which can weaken or remove part of the adjacent boundary signal leading to missing or blurry cell contour. For example, the weak signal of a newly formed cell wall close to two nuclei was not detected by the network and the cells were merged (Figure  3D , red box). For the ovule dataset, in rare cases of very weak boundary signal, failure to correctly separate cells could also be observed (Figure  3E , red box). Taken together, our data suggest that segmentation using graph partitioning is a good choice for the plant tissue segmentation problem, where boundary discontinuities can sometimes be present.
Performance of PlantSeg on external datasets To test the generalization capacity of PlantSeg, we assessed its performance on data for which no network training was performed. To this end, we took advantage of the publicly available (https://osf. io/fzr56) Arabidopsis 3D    1 : Quantification of PlantSeg performance on the 3D Digital Tissue Atlas. The Adapted Rand error (ARand) assesses the overall segmentation quality whereas VOI merge and VOI split assess erroneous merge and splitting events. Digital Tissue Atlas dataset composed of eight confocal stacks of eight different Arabidopsis thaliana organs with hand-curated groundtruth  [36]. The input images from the digital tissue atlas are similar to the images of the Arabidopsis ovules (confocal stacks of fixed tissue with stained cell contours).
We fed the input confocal stacks to PlantSeg and quantitatively and qualitatively assessed the resulting segmentation against the groundtruth. The petal images were not included in our analysis as they are very similar to the leaf and the groundtruth is fragmented, making it difficult to evaluate the results from the pipeline in a reproducible way. Qualitatively, PlantSeg performed well on the 3D Digital Tissue Atlas, giving satisfactory results on all organs, correctly segmenting even the oval non-touching cells of the anther and leaf: a cell shape not present in the training data (Figure  4 ). Quantitatively, the performance of PlantSeg is on par with the scores reported on the LRP and ovules datasets on the anther, leaf, sepal and the root, but lower for the other three tissues (Table  1 ).
Open benchmark performance For completeness, we have also compared PlantSeg performance with state-of-the-art methods on a non-plant open benchmark consisting of epithelial cells of the Drosophila wing disc. Visually, the benchmark images are quite similar to the ovules dataset: membrane staining is used along with a confocal microscope, and the cell shapes are compact and relatively regular. To ensure a fair comparison with the reported benchmark results, we retrain the neural network on the training set provided by the  [37] , following the same training protocol with a standard 3D U-Net architecture. We found that PlantSeg is very competitive qualitatively and quantitatively (see Supp. Appendix C ).
A package for plant tissue segmentation and benchmarking We release PlantSeg as an open-source software for the 3D segmentation of cells with cell contour staining. PlantSeg allows for data pre-processing, boundary prediction with neural networks and segmentation of the network output with a choice of four partitioning methods: Multicut, GASP, Mutex watershed and DT watershed. PlantSeg can be executed via a simple graphical user interface (see Figure  5 ) or via the command line. The critical parameters of the pipeline are specified in a configuration file. Running PlantSeg from the graphical user interface is well suited for processing of single experiments, while the use of the command line utility enables large scale batch processing and remote execution. PlantSeg comes with several networks pre-trained on different voxel size of the Arabidopsis ovule and LRP datasets.
Users can select from the available set of pre-trained networks the one with features most similar to their datasets. Alternatively, users can let PlantSeg select the pre-trained network based on the microscope modality (light sheet or confocal) and voxel size. PlantSeg also provides a command-line tool for training the network on new data when none of the pre-trained network is suitable to the user's needs. PlantSeg is open-source and publicly available https://github. com/hci-unihd/plant-seg. The repository includes a complete user guide, the evaluation scripts used for quantitative analysis, and the employed datasets. Besides the source code, we provide a conda package and a docker image to simplify the installation. The software is written in Python, the neural networks use the PyTorch framework.
Asymmetric division of lateral root founder cells Arabidopsis thaliana constantly forms lateral roots (LRs) that branch from the main root. These LRs arise from a handful of founder cells located in the pericycle, a layer of cells located deep within the primary root. Upon lateral root initiation, these founder cells invariably undergo a first asymmetric division giving rise to one small and one large daughter cell. Although the asymmetric nature of this division has long been reported  [40, 41]  and its importance realised  [42] , it is still unknown how regular the volume partitioning is between the daughter cells. We used the segmentation of the LR dataset produced by PlantSeg to quantify this ratio. The asymmetric divisions were identified by visual examination during the first 12 hours of the recording and the volumes of the two daughter cells retrieved (Figure  7B ).
Epidermal cell volumes in a shoot apical meristem Epidermal cell morphologies in the shoot apical meristem of Arabidopsis thaliana are genetically controlled and even subtle changes can have an impact on organogenesis and pattern formation. To quantify respective cell shapes and volumes in the newly identified big cells in epidermis (bce) mutant we used the PlantSeg package to analyze image volumes of six Arabidopsis thaliana meristems (three wild type and three bce specimens). Inflorescence meristems of Arabidopsis thaliana were imaged using confocal laser scanning microscopy after staining cell walls with DAPI. Image volumes (167 × 167 × 45) µm were used to obtain 3D cell segmentations using PlantSeg: in this case a 3D UNet trained on the Arabidopsis ovules was used in combination with the Multicut algorithm.
Discussion Taking advantage of the latest developments in machine learning and computer vision we created PlantSeg, a simple, powerful, and versatile tool for plant cell segmentation. Internally, it implements a two-step algorithm: the images are first passed through a state-of-the-art convolutional neural network to detect cell boundaries. In the second step, the detected boundaries are used to over-segment the image using the distance transform watershed and then a region adjacency graph of the image superpixels is constructed. The graph is partitioned to deliver accurate segmentation even for noisy live imaging of dense plant tissue. PlantSeg was trained on confocal images of Arabidopsis thaliana ovules and light sheet images of the lateral root primordia and delivers high-quality segmentation on images from these datasets never seen during training as attested by both qualitative and quantitative benchmarks.
We experimented with different U-Net designs and hyperparameters, as well as with different graph partitioning algorithms, to equip PlantSeg with the ones that generalize the best. This is illustrated by the excellent performance of PlantSeg without retraining of the CNN on a variety of plant tissues and organs imaged using confocal microscopy (3D Cell Atlas Dataset). This feature underlines the versatility of our approach for images presenting similar features to the ones trained upon. Of importance, PlantSeg also comes with scripts to train and evaluate the performance of CNN trained de novo on a new set of images. Given the importance of groundtruth for training of CNNs we also provide instructions on how to generate groundtruth (Supp. Appendix A ). Besides the plant data, we compared PlantSeg to the state-of-the-art on an open benchmark for the segmentation of epithelial cells in the Drosophila wing disc.
The segmentation results produced by PlantSeg are not fully perfect and still require proof-reading to reach 100 % accuracy. If nuclei are imaged along with cell contours, nuclear signal can be leveraged for automatic proof-reading as we have explored in  [44]. In future work, we envision developing new semi-supervised approaches that would exploit the vast amounts of unlabeled data available in the plant imaging community. During the development of PlantSeg, we realised that very few benchmark datasets were available to the community for plant cell segmentation tasks, a notable exception being the 3D Tissue Atlas  [36]. To address this gap, we publicly release our sets of images and the corresponding hand-curated groundtruth in the hope to catalyse future development and evaluation of cell instance segmentation algorithms.
Training A 3D U-Net was trained to predict the binary mask of cell boundaries. Groundtruth cell contours where obtained by taking the groundtruth label volume, finding a 2 voxels thick boundaries between labeled regions (f ind_boundaries(•) function from the Scikit-image package  [50] ) and applying a Gaussian blur on the resulting boundary image. Gaussian smoothing reduces the high frequency components in the boundary image, which helps to prevent over-fitting and makes the boundaries thicker, increasing the number of foreground signal during training. Transforming the label image I label (x) into the boundary image I boundary (x) is depicted in Equation  1. I boundary (x) = 1 if F B(I label (x)) * G σ > 0. 5 0 otherwise (1) Where F B(•) transforms the labeled volume into the boundary image and G σ is the isotropic Gaussian kernel.
We found out that noise augmentations in the form of additive Gaussian and additive Poisson noise improve the performance of all tested network variants. The performance of CNNs is sensitive to changes in voxel size and object sizes between training and test images  [54]. We thus also trained the networks using version of the dataset down scaled 2× in XY. The 16 networks resulting from the combination of scaling, loss function and architecture can be used by PlantSeg to fit best to the user's data.
Inference During inference we used mirror padding on the input image to improve the prediction at the boundaries of the volume. We kept the same patch sizes as during training since increasing it during inference might lead to decreased quality of   3 : Average segmentation accuracy for different segmentation algorithms. The average is computed from a set of seven specimen for the ovules and four for the lateral root primordia (LRP), while the error is measured by standard deviation. The segmentation is produced by multicut, GASP, mutex watershed (Mutex) and DT watershed (DTWS) clustering strategies. We additionally report the scores given by the lifted multicut on the LRP dataset. The Metrics used are the Adapted Rand error to asses the overall segmentation quality, the VOI merge and VOI split respectively assessing erroneous merge and splitting events (lower is better for all metrics).
We thank  Kerem Celikay ,  Melanie Holzapfel  and  Boyko Vodenicharski  for their help in the early steps of the project. We further acknowledge the support of the  Center for Advanced Light Microscopy (CALM)  at the  TUM School of Life Sciences. GWB and SD-N were funded by  Leverhulme  Grant  RPG-2016-049. CP and AK were funded by  Baden-Wuerttemberg Stiftung. This work was supported by the  DFG FOR2581  to the Hamprecht (P3),  Kreshuk  ( P3 ), Lohmann ( P5 ), Maizel ( P6 ) and Schneitz (P7) labs.
Phylogenetic Analyses The newly obtained sequences were aligned with reference sequences representing the overall genetic diversity of HIV-1 in West and Central Africa (available from Los Alamos HIV sequence database: http://hiv-web. lanl. gov/), by using MAFFT version 7 (https://mafft. cbrc. jp/alignment/server/) and G-Blocks to eliminate poorly aligned positions and divergent regions (molevol. cmima. csic. es/castresana/Gblocks_server). Phylogenetic tree reconstruction was done by the maximum likelihood method with the GTR+I+G model as implemented in Seaview v4. 4. 2  [13]. In addition, bootscanning analysis was done to explore any eventual mosaic structure for each strain with Simplot software and con rmed by phylogenetic analysis of the corresponding sub-segments in case of mosaic viruses  [14].