Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the default ACE partition-selection constraint in adaptive_core_expansion so the chosen “high” core must contain at least 90% of nodes, limiting how aggressively ACE can mark nodes (UMIs) as peripheral.
Changes:
- Change
adaptive_core_expansion(..., min_allowed_nodes_pct=...)default from0.8to0.9.
Comments suppressed due to low confidence (1)
src/pixelator/pna/graph/adaptive_core_expansion.py:264
- The PR description indicates this change requires a documentation update and frames the behavior as limiting ACE to removing at most 10% of UMIs. In this file, the public docstring still describes the constraint generically as a node fraction, without noting the new default (0.9) or that nodes correspond to UMIs in PNA graphs. Consider updating the docstring to reflect the new default behavior so the rationale is discoverable to API users.
min_allowed_nodes_pct: float = 0.9,
select_lcc: bool = True,
) -> Graph:
"""Perform Adaptive Core Expansion (ACE) graph partitioning.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fika-pixelgen
approved these changes
Jun 23, 2026
maxkarlsson
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In samples with extremely low connectivity, ACE can be quite aggressive and remove >10% of UMIs. For PBMC samples, this is quite bad.
This PR changes the default value for
min_allowed_nodes_pctfrom 0.8 to 0.9 inadaptive_core_expansion. This means that we will not allow ACE to remove more than 10% of UMIs. On the downside, it will not select the best possible denoising solution. For e.g. MOLT4, we should expect higher noise levels with this change.For the majority of experiments which are PBMC, it's probably better to be cautious and keep more data in the graphs.
Fixes: PNA-3083
Type of change
How Has This Been Tested?
Updated tests in
tests/pna/denoise/test_denoise.pyNote that I added a second component (
REFERENCE_ACE_COMPONENT_HIGH_QUALITY) to make sure that we test ACE on a component that actually gets denoised. The previous component (REFERENCE_ACE_COMPONENTstill used in other tests) didn't get denoised at all because ACE failed to find a partition where the "high" core layer was > 90% of nodes (according to our newmin_allowed_nodes_pctthreshold at 0.9).PR checklist:
pyproject.tomland cited it properly