Skip to content

Add docs for sorting track scheme and some UI improvements #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 13, 2024
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,35 @@ place.

### Sort track scheme

#### Sort lineage tree (left-right-anchors)
#### Sort lineage tree (left-right-landmarks)

* Menu Location: `Plugins > Trees management > Sort trackscheme > Sort lineage tree (left-right-anchors)`
* Sorts the order of sub lineages in the track scheme.
* Cell closer to the left landmark, are put to the left side.
* Cells closer to the right landmark are put to the right side.
* The user can specify the left and right landmark by selecting tracks.
* The user can specify if the entire tree should be sorted, only selected subtrees or subtrees with a specific tag.
* Example: ![sort_lineage_tree_left_right_landmarks.gif](doc/treesmanagement/sort_lineage_tree_left_right_landmarks.gif)

#### Sort lineage tree (extern-intern)

* Menu Location: `Plugins > Trees management > Sort trackscheme > Sort lineage tree (extern-intern)`
* Sorts the order of the sub lineages in the track scheme.
* Cells further away from the center landmark, are put to the left side.
* Cells closer to the center landmark, are put to the right side.
* The user can specify the center landmark by selecting a track.
* The user can specify if the entire tree should be sorted, only selected subtrees or subtrees with a specific tag.
* Example: ![sort_lineage_tree_extern_intern.gif](doc/treesmanagement/sort_lineage_tree_extern_intern.gif)

#### Sort lineage tree (cell life cycle duration)

* Menu Location: `Plugins > Trees management > Sort trackscheme > Sort lineage tree (cell life cycle duration)`
* Sort selected spots such that the child cell with the longer cell cycle duration (aka branch duration) is arranged to
the left in the TrackScheme.
* If no spots are selected, the entire track scheme is sorted.
*
Example: ![sort_lineage_tree_cell_life_cycle_duration.gif](doc/treesmanagement/sort_lineage_tree_cell_life_cycle_duration.gif)

## Auxiliary displays

### Show compact lineage
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class TomancakPlugins extends AbstractContextual implements MamutPlugin
menuTexts.put( SET_RADIUS_SELECTED_SPOTS, "Set radius of selected spots" );
menuTexts.put( CHANGE_BRANCH_LABELS, "Change branch labels" );
menuTexts.put( COMPACT_LINEAGE_VIEW, "Show compact lineage" );
menuTexts.put( SORT_TREE, "Sort lineage tree (left-right-anchors)" );
menuTexts.put( SORT_TREE, "Sort lineage tree (left-right-landmarks)" );
menuTexts.put( SORT_TREE_EXTERN_INTERN, "Sort lineage tree (extern-intern)" );
menuTexts.put( SORT_TREE_LIFETIME, "Sort lineage tree (cell life cycle duration)" );
menuTexts.put( LABEL_SPOTS_SYSTEMATICALLY, "Systematically label spots (extern-intern)" );
Expand Down Expand Up @@ -180,7 +180,7 @@ public void getCommandDescriptions( final CommandDescriptions descriptions )
descriptions.add( SET_RADIUS_SELECTED_SPOTS, SET_RADIUS_SELECTED_SPOTS_KEYS, "Set radius for all selected spots." );
descriptions.add( CHANGE_BRANCH_LABELS, CHANGE_BRANCH_LABELS_KEYS, "Change the labels of all the spots between to division." );
descriptions.add( COMPACT_LINEAGE_VIEW, COMPACT_LINEAGE_VIEW_KEYS, "Show compact representation of the lineage tree.");
descriptions.add( SORT_TREE, SORT_TREE_KEYS, "Sort selected spots according to tagged anchors.");
descriptions.add( SORT_TREE, SORT_TREE_KEYS, "Sort selected spots according to selectable landmarks." );
descriptions.add( SORT_TREE_EXTERN_INTERN, SORT_TREE_EXTERN_INTERN_KEYS, "Sort selected spots according to tagged center anchor.");
descriptions.add( SORT_TREE_LIFETIME, SORT_TREE_LIFETIME_KEYS, "Sort selected spots, such that the child cell with the longer cell cycle duration is left in the TrackScheme.");
descriptions.add( LABEL_SPOTS_SYSTEMATICALLY, LABEL_SPOTS_SYSTEMATICALLY_KEYS, "Child cells are named after their parent cell, with a \"1\" or \"2\" appended to the label.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import net.miginfocom.swing.MigLayout;
import org.mastodon.mamut.ProjectModel;
import org.mastodon.mamut.model.Model;
Expand Down Expand Up @@ -123,7 +125,8 @@ private void renameButtonClicked()
Collection<Spot> center = centerLandmark.getSelectedSpots();
if ( center.isEmpty() )
{
dispose();
JOptionPane.showMessageDialog( this, "Please select a center landmark.", "Error",
JOptionPane.ERROR_MESSAGE );
return;
}
Collection<Spot> selected = selectSpots.getSelectedSpots();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import net.miginfocom.swing.MigLayout;
import org.mastodon.mamut.ProjectModel;
import org.mastodon.mamut.model.Spot;
Expand Down Expand Up @@ -91,6 +93,11 @@ public static void showDialog(ProjectModel model)
private void sortButtonClicked()
{
Collection<Spot> center = centerLandmark.getSelectedSpots();
if ( center.isEmpty() )
{
JOptionPane.showMessageDialog( this, "Please select a center landmark.", "No center landmark selected",
JOptionPane.ERROR_MESSAGE );
}
Collection<Spot> selectedSpots = nodesToSort.getSelectedSpots();
SortTree.sortExternIntern( appModel.getModel(), selectedSpots, center );
appModel.getBranchGraphSync().sync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ private void sortButtonClicked()
Collection<Spot> left = leftLandmark.getSelectedSpots();
Collection<Spot> right = rightLandmark.getSelectedSpots();
Collection<Spot> selectedSpot = nodesToSort.getSelectedSpots();
if ( left.isEmpty() && right.isEmpty() )
{
JOptionPane.showMessageDialog( this, "Please select left and right landmarks.", "No landmarks selected",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( left.isEmpty() )
{
JOptionPane.showMessageDialog( this, "Please select left a landmark.", "No left landmark selected",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( right.isEmpty() )
{
JOptionPane.showMessageDialog( this, "Please select right a landmark.", "No right landmark selected",
JOptionPane.ERROR_MESSAGE );
return;
}
SortTree.sortLeftRightAnchors( appModel.getModel(), selectedSpot, left, right );
appModel.getBranchGraphSync().sync();
}
Expand Down
Loading