Skip to content

Commit

Permalink
Merge pull request #107 from mastodon-sc/multi_project_classification
Browse files Browse the repository at this point in the history
Add multi project lineage classification
  • Loading branch information
stefanhahmann authored Jul 24, 2024
2 parents 1c693dd + cdaf1f7 commit 3b8a4b1
Show file tree
Hide file tree
Showing 22 changed files with 1,076 additions and 334 deletions.
35 changes: 22 additions & 13 deletions doc/classification/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## Lineage Tree Classification

* This plugin is capable of grouping similar lineage trees together.
* This command is capable of grouping similar lineage trees together.
* The linage classification operates on Mastodon's branch graph.
* Lineage trees are considered similar, if they share a similar structure and thus represent a similar cell division
pattern. The structure of a lineage tree is represented by the tree topology.
This tree topology consists of the actual branching pattern and the cell lifetimes,
i.e. the time points between two subsequent cell divisions.
* The similarity of a pair of lineage trees is computed based on the Zhang edit distance for unordered
trees ([Zhang, K. Algorithmica 15, 205–222, 1996](https://doi.org/10.1007/BF01975866)). This method captures the cost
of the transformation of one tree into the other.
* The cost function applied for the tree edit distance uses the attribute branch spot duration, which is computed as a
difference of time points between to subsequent divisions reflecting the start and the end of a spot's lifetime.
* Thus, the linage classification operates on Mastodon's branch graph.
* The Zhang unordered edit distance allows the following edit operations. The edit operations are defined in a way that
they satisfy the constraints elaborated in section 3.1 ("Constrained Edit Distance Mappings") of the paper:
they satisfy the constraints elaborated in section 3.1 ("Constrained Edit Distance Mappings") of the
paper: [Zhang, K. Algorithmica 15, 205–222, 1996](https://doi.org/10.1007/BF01975866)

```
Note: The prefix T may represent a node or a complete subtree. Nodes without this prefix are just nodes.
Expand Down Expand Up @@ -98,26 +101,32 @@ Tree2
```

* Edit distance of 69, because:

* one node has a difference of 1
* two nodes have a difference of 24 each
* two extra nodes are added with a weight of 10 each
* ![zhang_example.gif](zhang_example.gif)
* The tree edit distances are computed between all possible combinations of lineage trees leading to a two-dimensional
matrix. The values in this matrix are considered to reflect similarities of lineage trees. Low tree edit distances
represent a high similarity between a discrete pair of lineage trees.
* This similarity matrix is then used to perform
an [agglomerative hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) into a specifiable

* The similarity measure uses the attribute cell lifetime, which is computed as a difference of time points between to
subsequent divisions. There are multiple ways to compute the similarity measure between two lineage trees (cf. below).
* The similarities are computed between all possible combinations of lineage trees leading to a two-dimensional
similarity matrix. The values in this matrix are considered to reflect similarities of lineage trees. Low tree edit
distances represent a high similarity between a discrete pair of lineage trees. This matrix is then used to perform
an [Agglomerative Hierarchical Clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) into a specifiable
number of classes.
* For the clustering three
different [linkage methods](https://en.wikipedia.org/wiki/Hierarchical_clustering#Cluster_Linkage) can be chosen.

### Parameters

* Crop criterion:
* Time point (default)
* Number of spots
* Number of spots (default)
* Time point
* Crop start
* At which number of spots or time point the analysis should start
* Crop end
* At which number of spots or time point the analysis should end
* Number of classes
* The number of classes the lineage trees should be grouped into
* Must not be greater than the number of lineage trees
* Minimum number of divisions
* The minimum number of divisions a lineage tree must have to be considered in the classification
Expand Down
14 changes: 8 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

<mastodon.version>1.0.0-beta-30</mastodon.version>
<mastodon.group>org.mastodon</mastodon.group>
<!-- with pom-scijava >= 37.1.0, this can be removed again -->
<scijava-common.version>2.97.1</scijava-common.version>
<!-- when a pom-scijava exists that references the scijava-common 2.99.1 release, this can be removed again -->
<scijava-common.version>2.99.1-SNAPSHOT</scijava-common.version>
<!-- with pom-scijava >= 38.0.2, this can be removed again -->
<scijava-ui-swing.version>1.0.2</scijava-ui-swing.version>

<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

Expand Down Expand Up @@ -210,13 +212,13 @@
</activation>
<build>
<plugins>
<!-- Configure the maven-surefire-plugin to use a heap size of 2gb while running tests. -->
<!-- Configure the maven-surefire-plugin to use a heap size of 3gb while running tests. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<argLine>-Xmx2g</argLine>
<argLine>-Xmx3g</argLine>
</configuration>
</plugin>
</plugins>
Expand All @@ -226,13 +228,13 @@
<id>coverage</id>
<build>
<plugins>
<!-- Configure the maven-surefire-plugin to use a heap size of 2gb while running tests for jacoco coverage analysis. -->
<!-- Configure the maven-surefire-plugin to use a heap size of 3gb while running tests for jacoco coverage analysis. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<argLine>@{argLine} -Xmx2g</argLine>
<argLine>@{argLine} -Xmx3g</argLine>
</configuration>
</plugin>
<plugin>
Expand Down
Loading

0 comments on commit 3b8a4b1

Please sign in to comment.