motile_plugin.widgets.tracks_view.navigation_widget

Classes

NavigationWidget

Module Contents

class motile_plugin.widgets.tracks_view.navigation_widget.NavigationWidget(track_df: pandas.DataFrame, lineage_df: pandas.DataFrame, view_direction: str, selected_nodes: motile_plugin.utils.node_selection.NodeSelectionList, feature: str)

Bases: qtpy.QtWidgets.QWidget

track_df
lineage_df
view_direction
selected_nodes
feature
navigation_box
navigation_layout
left_button
right_button
up_button
down_button
layout
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