motile_plugin.data_views.views.tree_view.navigation_widget

Classes

NavigationWidget

Module Contents

class motile_plugin.data_views.views.tree_view.navigation_widget.NavigationWidget(track_df: pandas.DataFrame, lineage_df: pandas.DataFrame, view_direction: str, selected_nodes: motile_plugin.data_views.NodeSelectionList, feature: str)

Bases: qtpy.QtWidgets.QWidget

track_df
lineage_df
view_direction
selected_nodes
feature
move(direction: str) None

Move in the given direction on the tree view. Will select the next node in that direction, based on the orientation of the widget.

Args:
direction (str): The direction to move. Options: “up”, “down”,

“left”, “right”

get_next_track_node(df: pandas.DataFrame, node_id: str, forward=True) str | None

Get the node at the same time point in an adjacent track.

Args:

df (pd.DataFrame): The dataframe to be used (full track_df or subset lineage_df). node_id (str): The current node ID to get the next from. forward (bool, optional): If true, pick the next track (right/down).

Otherwise, pick the previous track (left/up). Defaults to True.

get_predecessor(node_id: str) str | None

Get the predecessor node of the given node_id

Args:

node_id (str): the node id to get the predecessor of

Returns:

str | None: THe node id of the predecessor, or none if no predecessor is found

get_successor(node_id: str) str | None

Get the successor node of the given node_id. If there are two children, picks one arbitrarily.

Args:

node_id (str): the node id to get the successor of

Returns:

str | None: THe node id of the successor, or none if no successor is found