Skip to content

Guard Rust q-value path against non-integer tie-break columns#820

Open
GeorgWa wants to merge 1 commit into
feature/rust-fdrfrom
fix/rust-fdr-protein-qval-int64
Open

Guard Rust q-value path against non-integer tie-break columns#820
GeorgWa wants to merge 1 commit into
feature/rust-fdrfrom
fix/rust-fdr-protein-qval-int64

Conversation

@GeorgWa

@GeorgWa GeorgWa commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

get_q_values cast extra_sort_columns[0] to int64 for the Rust kernel. Protein FDR passes pg (a string accession), raising ValueError. Take the Rust path only when the tie-break column is integer-typed; otherwise fall back to the reference pandas sort.

perform_protein_fdr calls get_q_values with extra_sort_columns=["pg"],
the protein-group accession (a string). The Rust q-value path coerced
that column to int64, raising ValueError during protein FDR. Take the
Rust path only when the tie-break column is integer-typed; otherwise
fall back to the reference pandas sort (string-safe).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GeorgWa GeorgWa requested a review from mschwoer June 24, 2026 21:27
Comment thread alphadia/fdr/fdr.py
extra_sort_columns = ["precursor_idx"]

if _USE_RUST_FDR and len(extra_sort_columns) == 1:
# The Rust kernel requires an integer tie-break key. Precursor FDR sorts by

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these implicit assumptions on sorting will bite us one day :-)

Comment thread alphadia/fdr/fdr.py
# (a string), so fall back to the reference pandas path for non-integer columns.
if (
_USE_RUST_FDR
and len(extra_sort_columns) == 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this fixing a bug? how much of an edge case? or what's the intent?

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.

2 participants