Skip to content
Open
28 changes: 28 additions & 0 deletions cellacdc/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,34 @@ def warnPromptSegmentPointsLayerNotInit(qparent=None):
)
return msg.cancel

def warnNoIDsInS(qparent=None):
from cellacdc import widgets
txt = html_utils.paragraph(f"""
<b>None</b> of the IDs present at this frame
<b>are in 'S' phase</b>.<br><br>
This tool can be used only for mother-bud pairs.<br><br>
Thank you for your patience!
""")
msg = widgets.myMessageBox(wrapText=False)
msg.warning(
qparent, 'No cells in "S" phase', txt,
)
return msg.cancel

def warnSelectedIDisNotInS(ID, qparent=None):
from cellacdc import widgets
txt = html_utils.paragraph(f"""
The selected ID {ID} <b>cell cycle stage is not 'S'</b>!<br><br>
Make sure you are hovering a cell ID in 'S' (mother of bud),
when activating this mode.<br><br>
Thank you for your patience!
""")
msg = widgets.myMessageBox(wrapText=False)
msg.warning(
qparent, 'Selected ID not in S', txt,
)
return msg.cancel

def warnPromptSegmentModelNotInit(qparent=None):
from cellacdc import widgets
txt = html_utils.paragraph(f"""
Expand Down
34 changes: 34 additions & 0 deletions cellacdc/cca_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,41 @@ def add_generation_num_of_relative_ID(

acdc_df_with_col = acdc_df_by_frame_i.reset_index()
return acdc_df_with_col

def get_IDs_gen_num_will_divide(cca_df):
"""Get a list of (ID, gen_num) of cells that require `will_divide`>0

Parameters
----------
cca_df : pd.DataFrame
DataFrame with cc annotations for every frame and Cell_ID

Returns
-------
list of tuples
List of (ID, gen_num) of cells that require `will_divide`>0
"""

cca_df_buds = cca_df.query('relationship == "bud"')
IDs_gen_num_will_divide = []
for budID, bud_cca_df in cca_df_buds.groupby('Cell_ID'):
all_gen_nums = cca_df.query(f'Cell_ID == {budID}')['generation_num']
if not (all_gen_nums > 0).any():
# bud division is annotated in the future
continue

mothID = int(bud_cca_df['relative_ID'].iloc[0])
first_frame_bud = bud_cca_df['frame_i'].iloc[0]
gen_num_moth = cca_df.query(
f'(frame_i == {first_frame_bud}) & (Cell_ID == {mothID})'
)['generation_num'].iloc[0]

IDs_gen_num_will_divide.append((mothID, gen_num_moth))
IDs_gen_num_will_divide.append((budID, 0))

return IDs_gen_num_will_divide


def get_IDs_gen_num_will_divide_wrong(global_cca_df):
"""Get a list of (ID, gen_num) of cells whose `will_divide`>0 but the
next generation does not exist (i.e., `will_divide` is wrong)
Expand Down
12 changes: 12 additions & 0 deletions cellacdc/docs/source/tooltips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@
:height: 16px
:width: 16px

.. |annotateSingleMotherBudPairButton| image:: https://raw.githubusercontent.com/SchmollerLab/Cell_ACDC/refs/heads/main/cellacdc/resources/icons/lock_id_annotate_future.svg
:target: https://github.com/SchmollerLab/Cell_ACDC/blob/main/cellacdc/resources/icons/lock_id_annotate_future.svg
:alt: annotateSingleMotherBudPairButton icon
:height: 16px
:width: 16px

.. |segmentToolAction| image:: https://raw.githubusercontent.com/SchmollerLab/Cell_ACDC/refs/heads/main/cellacdc/resources/icons/segment.svg
:target: https://github.com/SchmollerLab/Cell_ACDC/blob/main/cellacdc/resources/icons/segment.svg
:alt: segmentToolAction icon
Expand Down Expand Up @@ -485,6 +491,12 @@ Edit tools: Cell cycle analysis
* **Automatically assign bud to mother (** |assignBudMothAutoAction| **):** Automatically assign buds to mothers using YeastMate.
* **Manually edit cell cycle annotations table (** |editCcaToolAction| **"Ctrl+Shift+P"):** Manually edit cell cycle annotations table.
* **Re-initialize cell cycle annotations table (** |reInitCcaAction| **):** Re-initialize cell cycle annotations table from this frame onward. NOTE: This will erase all the already annotated future frames information (from the current session not the saved information).
* **Annotate one mother-bud pair at the time (** |annotateSingleMotherBudPairButton| **"Y"):**
1. Activate to annotate a single mother-bud pair at the time.
2. Annotate past and future frames
3. Deactivate to go back to the frame you were annotating before activating this tool.

NOTE: When annotating future frames, the other cells will not be displayed and they will be ignored.

Edit tools: Normal division: Lineage tree
-----------------------------------------
Expand Down
Loading
Loading