Skip to content

Fix: Assignment operator typo in filter_clones.R#2

Open
eos-jin wants to merge 1 commit into
phipsonlab:mainfrom
eos-jin:fix/assignment-operator-typo
Open

Fix: Assignment operator typo in filter_clones.R#2
eos-jin wants to merge 1 commit into
phipsonlab:mainfrom
eos-jin:fix/assignment-operator-typo

Conversation

@eos-jin

@eos-jin eos-jin commented Mar 27, 2026

Copy link
Copy Markdown

Summary

Fixes a bug in R/filter_clones.R where a comparison operator < was used instead of assignment <-.

The Bug

# Line 54 - Before (bug):
filtered_clones < clones[clones$count >= min_count, ]

# After (fix):
filtered_clones <- clones[clones$count >= min_count, ]

Impact

This bug caused the filter_clones() function to silently fail to assign the filtered result.

Testing

All 16 existing filtering tests pass after the fix.

Context

Identified during code review for the NextClone paper revision.

…ined_clones

The bug on line 54 used '<' (comparison) instead of '<-' (assignment) when
handling the edge case where no clones meet the threshold without grouping.
This caused n_clones to not be properly assigned, leading to incorrect
behavior when all values are below the threshold.

This fix ensures that zero counts are correctly returned when no data
passes the threshold filter.
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