Skip to content

Comments

Ensure _temp dir does not interfere with pixel SOM and consensus cluster assignment#1183

Open
alex-l-kong wants to merge 4 commits intomainfrom
som_temp_dir_fix
Open

Ensure _temp dir does not interfere with pixel SOM and consensus cluster assignment#1183
alex-l-kong wants to merge 4 commits intomainfrom
som_temp_dir_fix

Conversation

@alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

If a run is restarted from the beginning, or if a _temp dir still exists due to a crash, this creates a strange limbo state where the pipeline:

  1. Will attempt to create an already existing _temp folder if an overwrite is forced (which is often the recommended solution in case the run is completely unsalvageable)
  2. Cannot identify what all the seen SOM clusters are if all FOVs have already been assigned (because it simply "passes through" the assignment step, where this normally happens)

How did you implement your changes

To address these issues:

  1. If a _temp directory is seen on overwrite=True, delete it first
  2. If the pixel_pysom object contains no SOM references in som_clusters_seen, invokes a new function, pixel_cluster_utils.identify_seen_pixel_clusters, to populate this. The function does extend support to meta clusters as well, though this case is not directly invoked in the pipeline.

@alex-l-kong alex-l-kong self-assigned this Mar 11, 2025
Copy link
Contributor

@camisowers camisowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just need to fix the builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants