Code Monkey home page Code Monkey logo

mastodon-deep-lineage's Introduction

Build Status License Coverage Lines of Code DOI YouTube

Mastodon Deep Lineage - a collection of plugins to analyse lineages of tracked objects in Mastodon

Table of Contents

Documentation of Mastodon

mastodon.readthedocs.io

Installation Instructions

  • Add the listed Mastodon update sites in Fiji:
    • Help > Update > Manage update sites
      1. Mastodon
      2. Mastodon-DeepLineage Mastodon Update sites

Maintainer

Contributors

License

Contribute Code or Provide Feedback

  • You are welcome to submit Pull Requests to this repository. This repository runs code analyses on every Pull Request using SonarCloud.
  • Please read the general advice re contributing to Mastodon and its plugins.

Contribute Documentation

  • If you would like to contribute to this documentation, feel free to open a pull request. The documentation is written in Markdown format.

Acknowledgements

mastodon-deep-lineage's People

Contributors

stefanhahmann avatar maarzt avatar tinevez avatar

Stargazers

Judith Garcia-Gonzalez avatar Manan Lalit avatar Sugawara Ko avatar  avatar Mara Lampert avatar

Watchers

James Cloos avatar  avatar  avatar Robert Haase avatar

Forkers

noam-dori

mastodon-deep-lineage's Issues

Speed of cell division

UserStory

From a biological perspective, the Speed of cell division of a cell during its life cycle may be a good descriptor for the cell type or Cell state (e.g.: wound). Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the Time between successiv cell divisions in tree

Tasks

Movement directionality

UserStory

From a biological perspective, the Movement directionality of a cell during its life cycle may be a good descriptor for the cell type. Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the Angle of displacement from initial position. Intermediate points of BranchSpots are not considered. The angle should be represented as 3 dimensional vector.
  3. Computation: vector of end point - vector start point. The vector resulting from this should be normalized to length 1.

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test
  • Write documentation

Estimate cell nucleis

User Story

I would like to be able that cell nucleis are determined automatically by means of segmentation approaches

Acceptance Criteria

  1. Use StarDIST Python implementation (https://github.com/stardist/stardist) to estimate cell nuclei positions and forms
  2. StarDIST may be combined with algorithmic approaches, such as MorphoLibJ/CLIJ
  3. Derive ellipsoids params (center, lengths of axes) of nucleis from StarDIST star-convex polygons
  4. Allow Mastodon/BDV to show StarDIST star-convex polygons

Further Applications of lineage tree matching

User Story

A biologist would like to learn how similar lineage trees of the same or event different species are.

Cells that have been found to be corresponding cells in 2 samples of the same species may be used to generate spatial landmarks. For this purpose, it would be interesting to find corresponding lineage tree patterns that are similar to a certain degree.

Additional information

https://docs.google.com/document/d/1hQSD3yBIlqfgqypUhRN11fEK6VEc8UVlL-aIqzTJ9YI/edit#heading=h.yspfsl4eri0i

  • Look at one lineage and try to predict the name of the root cell from another lineage

  • Networkx / Christophe Godin Library

  • Michalis: top-down approach (predicting the root) may work for stereotypic cell developments (as in Platynereis), but bottom-up would be more general (would also work in cases that are less stereotypic, e.g. SOP lineages in flies and regeneration in Parhyale)

  • Pavel: also involve the spatial arrangement of the progenitor cells and/or the terminal cells; explore with sublineages rather than entire trees

  • Jean-Yves Tinevez:

    • There are some recent work that are related to this idea (but do not overlap nor preclude it). For instance Jan Funke proposed machine learning to create lineages from sparse annotations: https://www.nature.com/articles/s41587-022-01427-7
    • Of course it would be awesome to see this implemented in Mastodon, but maybe some components of this work would be useful. 
    • For instance, they use some metrics, maybe derived from Léo Guignard work, to assess a distance from one lineage to another. If we have a metric, then we can produce an optimizer for it or learn it.
    • Léo once proposed a simpler version of this metrics in the MaMuT paper: https://elifesciences.org/articles/34410 (figure 7). At the time he said he was working on a more formal definition of it but I could not find it.
  • Robert: Consider graph neural networks for prediction

  • Illustration:
    grafik

SpotEllipsoidFeature

UserStory

From a biological perspective, the shape (approximated by an ellipsoid with 3 semi-axes and a resulting volume) of a cell during an individual timepoint may be a good descriptor for the cell type. Thus, it would be useful to have this information as a feature.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the volume of the Spot
  3. Computes all 3 semi-axes of the Spot/Ellipsoid

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test

Additional information

Code example for deriving ellipsoid axes and volume from Spot covariance matrix
https://github.com/mastodon-sc/mastodon/blob/master/src/main/java/org/mastodon/mamut/feature/SpotRadiusFeature.java#L136

Lineage Classification is not working for some cases

Description

In special classification cases, the lineage classification did not work correctly.

E.g.:

The Model contains two pairwise identical lineages, i.e. non-dividing and non-dividing 2 as well as single division 2 and single division 3.

grafik

When trying to classify this scenario into 4 classes, the result was no classification at all.

It would be better, if the result in this scenario was 3 classes, i.e. single division 1, non-dividing and non-dividing 2, single division 2 and single division 3.

A visualization of the intended result is here:
grafik

Dataset for testing

lineage_classification_bugfix_example.zip

Settings to reproduce

grafik

Movement speed BranchSpot Feature

UserStory

From a biological perspective, the Movement speed of a cell during its life cycle may be a good descriptor for the cell type (e.g. epidermal vs. mesodermal vs. macrophage). Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the Mean (average) Displacement for a BranchSpot, e.g. if a BranchSpot has 10 Spots, all 10 displacements are computed, summed and divided by 10.

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test

Add similarity metric published in Guignard et al. to list of available similarity metrics

User Story

In Guignard et al. 2020 a similarity metric, which is different from the currently available similarity metrics is implemented. In order to be able to reproduce the numbers published in this paper, users would like to be able to compute lineage classifications using this metric.

Acceptance criteria

  • A locally normalized cost function is added
  • A new similarity metric is introduced

Todos

  • Add Cost function
  • Add new metric to UI
  • Add unit tests

Add computer for BranchSpot id

User Story

For external analyses, it turned out that it would be useful to have a connection between spot and branchspot available. So far, there is only a connection between spot and track via the already computable track id. However, a spot can currently not be associated with the branchspot (and its features) that the spot belongs to.

Acceptance criteria

  • There is Spot Feature Computer that is capable to compute a branchspot id for each spot

Tasks

  • Implement SpotBranchSpotIdFeatureComputer
  • Write Unit tests

UMAP

Hi @stefanhahmann et al,

as discussed today, it would be cool to have a way for computing the UMAP of extracted features, to allow dimensionality reduction and viewing complex measurements / data points in 2D. There is a potential Java library for this:

It would be interesting to know if the library can deal with big data. If it does not, I would post-pone developing a big-data version to a later point. For now, it might be most important to have a UMAP implementation we can work with to explore possibilities. A potential alternative could also be a python-wrapper using cuML, which contains a GPU-accelerated UMAP implementation.

Optionally, we could also think of t-SNE and PCA as alternatives, if not too complicated.

Let me know what you think!

Best,
Robert

Add further features for spots and branch graph

User Story

A user may want to have additional features on the branch graph for some analysis.

Further Features requests

Possible Features

Spot Features:

  • Axes lenghts, i.e. minor axis, middle axis, major axis. The axes should be derivable from this, cf. Spot#getCovariance.
  • Spot volume, spot radius already exists. The ellipsoids are shown in BigDataViewer. The axes should be derivable from this, cf. SpotRadiusFeature. #13
  • aspect ratios of ellipsoid axes
    • 3 ratios considering 2 axes each #15
    • further ratios considering all 3 axes, e.g. (b-c)/(a-c). a .. major axis, b .. middle axis, c .. minor axis
  • Descriptors of the cell in relationship to its neighbours
    • Average distance to 5(?) nearest - neighbours #6
    • Further descriptors available in CLIJ
  • Texture params, i.e. histogram analysis within spot - how to express with a few numbers??? E.g. mean, median, variance of grey values. Perhaps frequency based indicators.
  • Division orientations (a 3 dimensional vector)
  • Time-resolved lineage data
    • Moving average of intensity (e.g. average including the previous 3 and the next 3 spots)
  • Link between Spots and BranchSpots #37

BranchSpot Features:

BranchLink Features:

  • Type of Division (symmetric/asymmetric)
    • Proportion of size/volume compared to the "sister"-cell (i.e. the other "daughter"-cell of the cell division)
  • Orientation of Division for both "daughter"-cells (i.e. BranchLinks)

Discussion:

  • Which features may be useful?
  • Are there further features?

grafik

  • Extend Grapher with Branch Features?

Overall Goal:

  • Identify important params that may predict cell life fate

Sinuosity of cell during life cycle

UserStory

From a biological perspective, the directness of movement of a cell during its life cycle may be a good descriptor for the cell type. Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the total number of leaves in a subtree of a branchspot

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test

Additional information

Lineage Classification on 2 datasets with a joint Dendrogram

User Story

As a user of Mastodon, I would like to use the existing "Classifify lineage trees" method on 2 (or even multiple) datasets. With this, I would like to see, how similar the development of two embryos is.

Implementation Idea

  • Use a dialog similar to the lineage registration dialog, where two mastodon datasets can be selected
    • E.g. all dataset in a specifiable folder
  • Allow the user to set prefixes from both datasets that are used to differentiate results
  • Allow the user to set a time scale that can be applied to compensate for different timelapse frame interval or differing speed of development
  • Compute a dendrogram on the joined dataset
  • Assign the generated tagset to both datasets

Related to (but not identical) #101

Add median to dendrogram of lineage tree classification

User Story

As a user, I would like to be able to estimate what are "high" and "low" similarities. For this, it may help to have the median of all tree edit distances of all combinations of trees shown as a median line in the dendrogram

Idea

  • Compute median (+mean?) value of all tree edit distances
  • Draw a line of it to the dendrogram and label it. Also label the "cutoff" line.

Movement (speed and directionality) relative to neighbours

UserStory

From a biological perspective, the Movement (speed and directionality) relative to neighbours of a cell during its life cycle may be a good descriptor for the cell type (e.g. epidermal vs. mesodermal vs. macrophage). Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the Movement Speed and directionality relative to neighbours

Tasks

  • Implement Feature

  • Implement FeatureComputer

  • Potential approach for relative speed (Spot level):

    • Compute on spot level: n (e.g. 5) nearest neighbors (cf. nearest neighbor statistics feature).
    • Compute displacement length on spot level (equals the speed, since the time frames are assumed constant)
    • Compute average displacement of neighbors.
    • Compute the difference of these two.
  • Compute the average of this over all spots of a BranchSpot to get the equivalent measure on BranchSpot level

  • Potential approach for relative direction (Spot level):

    • Compute direction vectors (i.e. spot vs. previous spot) of all neighbours.
    • Compute the sum of these and divide by number of neighbours
    • Compute the difference between the spot vector and this sum and normalize the result.
  • Compute the average of this over all spots of a BranchSpot

  • Write Unit test

  • Write Documentation

To be discussed

  • Is anisotropy a problem for the approach? Can it be handled by setting and using scales of the axes?

Notes

grafik

Find modules in the lineage tree

User Story

As a Mastodon user, I would like to have suggestions by Mastodon for cell type labels based on "modules" that have been found in the tracking data.

Additional information

Illustration:
grafik

Potential Idea for integration:

  • Let the user allow to select a section of the lineage tree that has one root

  • Do this on the BranchGraph

  • On the BranchGraph iterate over all branchSpots and create branchTrees starting from each branchSpot with the same number of leafNodes than the tree selected by the user

  • How to select leaves?

    • Breadth first selection (rather not depth first selection)?
    • Breadth first reflects generations of cell divisions better
    • Alternative: go forward in time starting from the root node until a timepoint is reached that has the same number of leaves
      • How to cut?
        • At the n_th leave?
        • At the (n+1)th leave?
        • At the end of the respective leaves
  • Compare all such graphs against the tree selected by the user. Sort by tree edit distance.

  • Discuss this idea with Michalis/Pavel/Johannes/Mette/Christoph

1 GT9oSo0agIeIj6nTg3jFEA

Example Branch Graph:

grafik

grafik

Allow Lineage classification for the case of number of root nodes equals number of classes

User Story

Currently, the UI prevents computing a classification of lineages, which contain the same number of classes as the available roots. While this seems to be a reasonable decision, since a classification where the number of roots is the same as the number of classes would result in the trivial classification, where each root gets its own unique class, it is still sometimes interesting to see and investigate the resulting dendrogram of such a classification scenario. It would therefore be useful, if the case of number of roots = number of classes would be allowed by the UI

Acceptance Criteria

  • the case of number of roots = number of classes would is allowed by the UI

Import spots from label image

User Story

A user of mastodon may have computed a segmentation of the object he is interested already outside of Mastodon. This user would like to import the segmentation that may exist as a label image in a separate channel of the intensity image into Mastodon. The purpose is to have the segmented objects available as Spots in Mastodon.

Acceptance criteria

  • Window where to specify the channel from which to read the labels
  • Convert pixels with the same value into a spot using variance / covariance

Lineage Classification Averaging Multiple Embryos

User Story

I would like to be able to process the lineage classification averaging over multiple embryos of the same species.
With this I would like to reproduced the steps describe in Guignard et al. 2020, p. 46

grafik

grafik

Acceptance criteria

  1. Possibility for the user to select multiple Mastodon projects to be included in the analysis
  2. Filter commonly named root cells across all selected projects
  3. Crop all projects at the same given number of cells (start and end)
  4. Compute Distance matrix for all projects
  5. Compute an averaged distance matrix
  6. Use the averaged distance matrix to compute an average dendromgram/classification
  7. Save the resulting tag set in all projects included in the classification.

Tasks

  • Possibility for the user to select multiple Mastodon projects to be included in the analysis
    • Put Similarity measure, Linking method and feature into advanced options
    • Alternatively provide a dialog with only a view options and an advanced dialog with all params
    • Use Array of files as Sci Java Command param
    • Clear button for list of projects to be included
  • Filter commonly named root cells across all selected projects
  • Crop all projects at the same given number of cells (start and end)
  • Compute Distance matrix for all projects
  • Compute an averaged distance matrix
  • Use the averaged distance matrix to compute an average dendrogram/classification
  • Handle edge cases / provide user feedback
  • (Optionally) Save the resulting tag set in all projects included in the classification.
    • Name the tag set as "Average ...
  • Related PR: scijava/scijava-ui-swing#82
  • Related PR: mastodon-sc/mastodon#311
  • Related PR: scijava/scijava-common#479
  • Mention name of project from which the plugin was loaded before the list of further projects
  • Avoid loading the current open project in the list of further projects
  • Avoid that projects are loaded twice in the list of further projects

Optional

Allow Export to file for Lineage Classification Dendrogram

User Story

Sometimes, I would like to classify so many lineages at the same time that the resulting dendrogram gets to dense to be nicely drawn on my screen (the labels of the dendrogram leaves start to overlap, if there are too many lineages). This is a problem, when it comes to copying the dendrogram to a presentation, which is in these cases not really possible. It would help me, if either (or ideally both)

  • the dendrogram would be rendered bigger than the screen automatically in such situations and a scrollbar would be available as well
  • or an export function was available that would render the dendrogram into a PNG file with large enough dimensions so that all labels of the dendrogram leaves can be read and do not overlap each other

Acceptance Criteria

  • The DendrogramPanel is sized large enough automatically so that the labels of the dendrogram leaves do not overlap
  • A Scrollbar exists, if the Panel gets to high
  • The Dendrogram can be exported to a file (e.g. PNG) via a right-click context menu

Export Results of Lineage Classification to CSV

User Story

After running a lineage classification, I would like to be able to export the results of such a classification into a CSV file.
The file should contain the cell name, the tag that is selected in the dendrogram view, the class name and the similarity score.

Tasks

  • Add function to export classification results to CSV including a unit tests
  • Add entry to context menu in dendrogram to make the functionality accessible to the user

Export the similarity matrix of lineage tree classification as CSV

User Story

I would like to use the similarity matrix produced in the progress of #25 outside of Mastodon to do some data science.

Acceptance criteria

  • UI element for this action exists
  • Similarity Matrix is exported as CSV
  • Rows and Columns of CSV file start with root names

grafik

TODOs

  • Write similarity matrix as CSV
  • Add UI element
  • Add unit test

Performance of Zhang Tree Edit Distance

The computation of the Zhang Edit Distance of the trees 2aba and 1bab between timepoints 30 and 350 takes:

  • with the BranchSpotTree implementation ~60.000ms
  • with the SimpleTree implementation ~25.000ms
    both is too long.
    The purpose of this ticket is to improve this performance.

Mastodon file containing the two trees (amongst other):

Tasks

  • Add the optimization for building the flow network in case of binary trees
  • Do further profiling
  • Add further optimization if possible
  • Find reason, why BranchSpotTree so much slower than SimpleTree implementation

Export Label Image Using Spot Ellipsoids

Story

To be able to connect the image with the clusters plotter in Napari for #34 it would be good to have a label image of the same dataset available.
For this purpose, it would be good, if the use could select a property (e.g. BranchSpot ID, SpotID) that may be used as label value. The ellipsoids as segmentation source.

Acceptance criteria:

  • UI callable via Plugins
  • Dialog to select the feature to be used as label
  • Selection of Spot-Id, BranchSpot Id or Track Id
  • Values set as selected inside the ellipsoids using all timepoints
  • Result shown in BDV window
  • Result is exportable

TODO

  • Create Plugin
  • Create Menu Entry
  • Create Dialog
  • Selection Spot Id / BranchSpot Id / Track Id
  • Assign values inside ellipsoid
  • Show result
  • Possibility to save result

Export threshold of hierarchical clustering to file

User Story

I would like to know the exact values of similarity of lineages that are show in the dendrogram produced by #25

grafik

Acceptance criteria

  • UI element for export exists
  • All thresholds from dendrogram are exported
  • A user friendly output format exists (CSV)

Questions:

  • How can the user identify splitting points in the dendrogram?

Improve names for Cluster root nodes

User story

Plugin name and Dialog name for parameters should be similar.
It would help to differentiate generated Classifications, if the classifications would contain some hints to the parameters used to generated the respective tagsets

Acceptance criteria

  • Plugin name renamed to "Classify lineage trees"
  • TagSet name contains at least start/end timepoint, number of classes, minimum divisions

TODOs

  • Rename plugin
  • Add method to derive tagset name of controller params, e.g.: Classification (time: 0-490, classes: 10, min div: 1)
  • Unit test
  • Use this method

Predict cell fate in an early state of lineage tree

User Story

As a user of Mastodon, I would like to have suggestion for a cell fate label based on early stage of tracked data

Additional Information:

Axes definition

User story

As a user of Mastodon, it would make interpretation of data easier, if it was possible to define a coordinate system within the project.
Features that can be computed on the dataset may then be clearer to be communicated/interpreted (e.g. directions of cell divisions, directions of cell movements).
The coordinate system should reflect the orientation of the organism within the dataset.

Acceptance criteria

  • Definition of 3 (orthogonal?) axes is possible via the user interface
    • Lateral - Lateral axis ("left" - "right", x-axis)
    • Ventral - Dorsal axis ("front" - "rear", y-axis)
    • Animal - Vegetal axis ("top" - "bottom", z-axis)

To be discussed

  • Should there be one axes-definition per Tag-Set?
  • User interaction to define axes within Mastodon

Allow values of tag sets to be shown in the Lineage Classification Dendrogram

User Story

I would also suggest adding the ‘tag’ of a cell used in the hierarchical clustering (e.g., the fate of a cell) onto the Dendrogram.

This would replicate what has been done in the paper by Léo Guignard and Patrick Lemaire across 10 embryos (https://www.science.org/doi/10.1126/science.aar5663) (see their figure below as an example).

grafik

Tasks

  • Add possibility to dendrogram view to paint an extra label (which could be a tag value in this case)
  • Add possibility for the user to select a tag set whose values would be shown in the dendrogram
  • Unit Tests

Generation time of a BranchSpot

User Story

The generation time of a cell between to divisions be a possible descriptor of its fate already in early developmental stages. Thus, it would be good, if there was a feature computer that can compute the generation time of a cell.

Acceptance criteria

  1. Implemented as BrachSpot Feature
  2. Result is stored per BranchSpot in the feature table

Tasks

  • Create a BranchSpot Feature "generation time"
  • Compute the time between the timepoints when the cell has occurred and when it divides into 2 new cells.
  • Store computed values in the feature table

Number of total leaves of a BranchSpot

UserStory

From a biological perspective, the total number of leaves of a branch spot in a cell lineage tree may be a good descriptor for the cell type. Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the total number of leaves in a subtree of a branchspot

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test

Lineage classification does not respect start time

In the lineage classification command, there are parameter that allow to define start and end timepoints for the classification.

Currently, the end timepoint is used to control the depth of the trees and the duration of the trees, where as crop start is only used to identify trees that start after the start time point, but it is not used trim the duration of trees according to the given start.

This is inconsistent and also unexpected from the perspective of the user.

Acceptance criteria

  • The crop start parameter is also used to influence the duration at the start of a tree

SpotEllipsoidAspectRatiosFeature

UserStory

From a biological perspective, the aspect ratios of the semi-axes of the ellipsoid that approximates the cell shape may be a good descriptor for the cell type. Thus, it would be useful to have this information as a feature.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes the aspect ratios between the three semi-axes
  • $aspect\ ratio\ a\ to\ b\ = \frac{a}{b}$
  • $aspect\ ratio\ a\ to\ c\ = \frac{a}{c}$
  • $aspect\ ratio\ b\ to\ c\ = \frac{b}{c}$
  1. Computes all 3 aspect ratios of the Spot/Ellipsoid
  2. Re-uses SpotEllipsoidFeature

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test

Additional information

Ellipsoid parameters (semi-axes) do not need to be computed again, as they are already computed in the SpotEllipsoidFeature, cf.: #13

Fix bug in SciJava Command Windows

Bug description

  • When opening SciJava command windows, a bug occurs:
    grafik
  • Can be reproduced by clicking "Plugins" > "Exports" > "Export Label image"
  • Does not seem to actually cause an error, but the error message that shows up is not really important for the user

Tasks

  • Find reason
  • Fix bug

Add Link and BranchLink to UMAP dialog

User Story

In the current version of the UMAP dialog I can select Spot and BranchSpot to compute. I am yet missing the possibility to select Link and BranchLink as well. I would like to be able to compute, visualize and store the UMAP also the Link and BranchLink Features.

Implementation of Zhang Tree Edit Distance for unordered trees

Story

Users would like to be able to determine the similarity of a sub-tree of a lineage tree with other sub-trees of the same or a different lineage tree. For this purpose, it is needed to have an algorithm implemented that computes the similarity between parts of lineage trees based on the tree similarity algorithm between unordered labeled trees.

Acceptance criteria

  1. An function exists that creates a view on a ModelBranchGraph based on a (root-)branchSpot and an endtimepoint
  • This view should itself be a ReadOnlyGraph<BranchSpot, BranchLink>
  1. A function that can take the follwing inputs:
  • ReadOnlyGraph<BranchSpot, BranchLink>
  • ReadOnlyGraph<BranchSpot, BranchLink>
  • Cost function
  1. The function returns the resulting tree similarity value
  2. The tree similarity function can take a cost function
  3. The cost function can take a List of attributes into account
  4. The cost function for the lifespan exists as an example cost function

Tasks

  • Unit tests with basic examples
  • Evaluate copy to JGraphT and potentially adapt acceptance criteria to a JGraphT implementation
  • Function to create a ReadOnlyGraph from a ModelBranchGraph and a BranchSpot and endtimepoint
  • Implementation of Zhang (1996) edit distance
  • Example cost function for lifespan

Algorithm:

Context

The similarity measurement shall be used to perform hierarchical clustering for all sub-trees of the root-nodes in a lineage tree. User may enter the starting timepoint and the ending timepoint and the number of classes that should be produced. The result should be available as tag set.

Findings from Tests

Additional Information

Reuse color of tagsets in dendrogram view

User Story

When using the function "Classification of Lineage" trees tagsets with different colors are generated. It would be nice, if these colors could also be used in the dendrogram view,

Acceptance Criteria

  • The dendrogram is colored using the same colors that are use for the generated tagsets

Tasks

  • Implement Mastodon DendrogramPanel, since currently used DendrogramPanel cannot be extended to do this
  • Re-Use colors for TagSets and for Clusters in the DendrogramPanel
  • Add Unit tests

Allow importing spots from segmented timelapse

User Story

A user would like to re-use his/her existing segmentation of time lapse images. The images are assumed to be in 3d and the segmentation may have been performed outside of Mastodon (e.g. using StarDist3D).

It would be good, if there was a possibility to read the segmented 3d images (aka label image) frame by frame and create a spot for each label in each frame. The user would then have a collection of spots in different frames, which he/she could link with each other by either using the Linking tools from mastodon-tracking or from elephant

The possibility to import such existing datasets into mastodon may save the user a lot of time for tracking, if the image data has already been segmented outside of Mastodon.

Acceptance criteria

  1. Possibility to import spots from active Fiji image, if all dimensions match (i.e. x,y,z and t)
  2. Possibility to import spots from selectable BDV channel
  3. Possibility to set a sigma value which can be used to size the resulting ellipsoid
  4. Image data is processed frame by frame
  5. Each new pixel value results in a new label
  6. The collection of pixel coordinates for each label is used to compute mean and covariance and from this the ellipsoids are derived.

Tasks

  • Import command for active Fiji image
  • Check for matching dimensions
  • Import command for selectable BDV channel
  • Processing tools to create spots from image data
  • Unit tests
  • Documentation how to use the import
  • Documentation how to prepare data
  • Documentation how to use the linking after the import

Use Cluster Plotter for explorative data analysis

User Story

From a biological perspective, it would be interesting to perform an explorative study of a developmental biological dataset. The goal is to find out, which features that can already be computed (cf. #10, #11, #12, #13 and will possible to be computed in the future cf. #1, #6 / mastodon-sc/mastodon-pasteur#9, #7, #9, ) are distinctive to separate different types of cells.

The underlying research question would be to find a out if there is a clustering method to reveal biologically relevant clusters (e.g. cell types).

Tasks

  • Load data of Averof Lab into Mastodon
  • Perform ellipsoid fitting
  • Compute all currently possible features
  • Export data as CSV
    • Spots
    • (Links)
    • BranchSpots
    • (BranchLinks)
    • Add Links between Spots and BranchSpots (#37)
  • Plugin to export ellipsoids as Label Image (#40)
  • Load data into Cluster Plotter
    • Explore Spot features (Plot different features against each other)
    • Explore BranchSpot features (Plot multiple features against each other)
    • Check, if further features can be added using Napari region props
    • Perform u-MAP / dimensionality reduction
      • Try different subsets of features
      • Run on Workstation if performance on local machine is too low
    • Load image data / timelapse into Napari as well to understand potential clusters that can be seen in clusters plotter
      • Test, if HDF5 image data can be imported
      • Perhaps, convert HDF5 image data to TIFF data, if importing is easier then
    • Make screenshots with potentially relevant settings for discussion in next meeting
  • Perform tests with data by Mette
  • Export data as CSV
    • Spots
    • Links
    • BranchSpots
    • BranchLinks
  • Load data into Cluster Plotter
    • Explore Spot features (Plot different features against each other)
    • Explore BranchSpot features (Plot multiple features against each other)
    • Try to find features + clustering settings that correspond to the labels (i.e. cell types) given by Mette

Additional Information

Publicly available data by Averof lab

You can find the zenodo link to the image dataset (+tracks) on this page: https://www.averof-lab.org/pages/2923-resources

Features of interest / features that are assumed to be biologically relevant

Code for reading data exported from Mastodon into Napari Cluster plotter

Configurable dendrogram panel

User Story

Users of Mastodon would like to toggle on/off the classification threshold and the median line shown in the dendrogram. Furthermore, it would be nice to manipulate the labeling of the leaves shown in the dendrogram, i.e. toggle on/off root names, toggle on/off associated tag labels and also to select the tagset to be used.

Tasks:

  • Provide Checkboxes to toggle on/off
    • Threshold line
    • Median line
    • Root names
    • Tag labels
  • Select box to choose tagset
  • Make DendrogramView to react when tagsets are changed
  • Reflect choices in the export
  • Persist choices, if possible

Estimate cell shape descriptors

User Story

I would like to estimate cell shape descriptor using Voronoi Tesselation starting from cell nuclei positions (#4)

Acceptance criteria

  1. Use MorphoLibJ or CLIJ to estimate cell shape decriptors by Voronoi Tesselation technique (3D-Voronoi)

Average distance to n nearest neighbours

User Story

The average distance of a cell nuclei to its n nearest neighbours may be a possible descriptor of its fate already in early developmental stages. Thus, it would be good, if there was a feature computer that can compute the average distance to a configurable number of its closest neighbours.

Acceptance criteria

  1. Implemented as Spot Feature
  2. Number of neighbours is configurable
  3. Result is stored per spot in the feature table

Tasks

  • Create a Spot Feature "Average Distance"
  • Allow UI input for the number of nearest neighbours to be considered
  • Provide a method to select the n nearest neighbours of a cell nuclei
  • Compute the the average distance to the specified number of near cell nucleis (Use KD-Tree im ImgLib)
  • Store computed values in the feature table

Additional Info:

Create TagSet from root nodes based on tree similarity

Story

Users would like to be able classify lineage trees depending on how similar they are to each other. Lineage trees that fall in the same class should get the same color (tag).

Acceptance criteria

  1. Users can choose a start timepoint or a start number of cells
  2. Users can choose an end timepoint or an end number of cells
  3. Users can choose the number of classes to be generated
  4. Users can choose the similarity metrics. The default option is normalized zhang tree edit distance based on lifespan as weight.
  5. A tagset is created based on theses settings. The tagset computation is based on a similarity matrix of all lineage trees in the data set and a hierarchical clustering (wards method) derived from it.

Tasks

  • UI dialog for parameter selection
  • Find all roots starting from the selected start timepoint
  • Find all roots starting from the selected start number of cells
  • Compute the similarity matrix
  • Derive hierarchical clustering from the similarity matrix (average linkage)
  • Derive the selected number of classes from the similarity matrix
  • Create tagset from the computed classes. Assign a tag to each spot between start end endtimepoint
  • Explanations in dialog

Related:

#24

Example Image

This shows tagsets visualising the same cell fate. The visualisation of the same class could be similar:

grafik

Normalised number of cell divisions in track

UserStory

From a biological perspective, the Normalised number of cell divisions in track of a cell during its life cycle may be a good descriptor for the cell type (e.g. epidermal vs. mesodermal vs. macrophage). Thus, it would be useful to have this information as a feature that may be computed from the cell lineage tree.

Acceptance criteria

  1. Available as Feature within the Feature Computer
  2. Computes (Leaves - 1) / (Number of Spots - 1) of Tracks
  3. Computes (Leaves - 1) / Sum of all Branch Durations of BranchSpot downwards
  4. Assgin as BranchSpotFeature. Multiple BranchSpots in the same track get the same value

Tasks

  • Implement Feature
  • Implement FeatureComputer
  • Write Unit test
  • Add documentation

To be discussed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.