Skip to content

DO NOT MERGE - set a default large component threshold#413

Open
ptajvar wants to merge 6 commits into
devfrom
feature/pna-3188-remove-large-components-in-graph
Open

DO NOT MERGE - set a default large component threshold#413
ptajvar wants to merge 6 commits into
devfrom
feature/pna-3188-remove-large-components-in-graph

Conversation

@ptajvar

@ptajvar ptajvar commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Removing large components by default in the graph step. This should eventually be an option in the pipeline and not done by default.

Fixes: PNA-3188

Type of change

TEMP


Note

High Risk
Default graph behavior now hard-filters components by size (including dropping clusters >500k UMIs), which can materially change cell counts and downstream PXL output without explicit user configuration; marked TEMP in the PR description.

Overview
The graph CLI now defaults --component-size-max-threshold to 500,000 and --component-size-min-threshold to MIN_PNA_COMPONENT_SIZE, so runs use hard min/max bounds instead of dynamic size filtering unless callers change those flags.

Early hive-partitioned edgelist writing was extended from minimum-only pruning to min and max UMI bounds: write_hive_partitioned_edgelist_without_out_of_size_bound_components drops components below the min or above the max (same UMI score as hybrid detection). find_components passes the upper bound from component_size_threshold into that step and logs the applied min/max; the default upper bound type uses np.iinfo(np.uint64).max instead of 2**32 - 1.

Reviewed by Cursor Bugbot for commit 9375ec8. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/pixelator/pna/cli/graph.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dde93a6. Configure here.

write_hive_partitioned_edgelist_without_out_of_size_bound_components(
input_edgelist_path=partitioned_edgelist_path,
min_component_size_to_prune=refinement_options.initial_stage_options.min_component_size_to_prune,
max_component_size_to_prune=upper_component_size_bound,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Max prune empty graph mishandled

Medium Severity

With the new default max component UMI bound, a graph where every hybrid component is above that limit can pass the pre-hive size check, then lose all edges in write_hive_partitioned_edgelist_without_out_of_size_bound_components. The pipeline keeps going instead of failing clearly: with multiplet recovery enabled, calculate_post_recovery_component_statistics can hit an empty component table when computing fraction_nodes_in_largest_component_post_recovery; otherwise the run fails later with a message that blames components being too small.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dde93a6. Configure here.

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.

1 participant