Skip to content

Add configurable --display-thresh parameter for .prob file filtering#60

Merged
rob-p merged 10 commits intomainfrom
copilot/add-debug-logs-for-discrepancies
Feb 4, 2026
Merged

Add configurable --display-thresh parameter for .prob file filtering#60
rob-p merged 10 commits intomainfrom
copilot/add-debug-logs-for-discrepancies

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Rebased PR - Display Thresh Parameter Only

Completed Changes:

  • Reset branch to main (af64207)
  • Applied only display-thresh parameter changes
  • Verified no debug code remains
  • Built and tested successfully
  • Committed clean changes

Final Changes (29 insertions, 2 deletions):

1. src/prog_opts.rs (+25 lines):

  • Added parse_display_thresh function to parse float values or 'none' sentinel
  • Added display_thresh field to Args struct with default value of 1e-6
  • Accepts values between 0.0 and 1.0, or 'none'/'None'/'NONE' for f64::MIN_POSITIVE

2. src/util/write_function.rs (+3, -2 lines):

  • Updated write_out_prob signature to accept display_thresh parameter
  • Removed hardcoded DISPLAY_THRESH constant (was 0.001)
  • Use parameter instead of constant for threshold comparison

3. src/bulk.rs (+1 line):

  • Pass args.display_thresh to write_out_prob function

Verification:

✅ No debug code or comments remain
✅ Builds successfully
✅ Help shows correct parameter with default value
✅ Only command line option changes remain

This PR is now cleanly rebased against main with only the essential changes for the --display-thresh parameter.

Original prompt

This PR introduces additional instrumentation and debugging logs to understand the discrepancy between the *.quant file and the *.prob file described in Issue #59. Specifically, discrepancies arise due to potential rounding errors, filtering (DISPLAY_THRESH), or mismatched probability inputs (alns, probs, coverage_probs) used during EM computation and write_out_prob() function. We'll address the following:

Changes Introduced

  1. Debug Alignment Probability Inputs:

    • Log alns, probs, and coverage_probs contents during execution of write_out_prob().
    • Check for consistency with final EM iteration data.
  2. Track Filters and Post-Filter Effects:

    • Add debug output before and after probability filtering (via DISPLAY_THRESH).
    • Ensure all transcript probabilities match initial EM distributions.
  3. Mark Debugging Code with Comments:

    • Clearly annotate all added debug outputs.
    • Mark the pre-PR commit ID (af64207206c22fcf20b038492cf008edd1b17c34) for easy rollback/removal.

This instrumentation is only temporary to trace sources of discrepancies noted in Issue #59.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add debugging logs to analyze file discrepancies Add debug instrumentation to trace .quant/.prob discrepancies Feb 3, 2026
Copilot AI requested a review from rob-p February 3, 2026 15:35
Copilot AI changed the title Add debug instrumentation to trace .quant/.prob discrepancies Add transcript-specific instrumentation for ENST00000491404.2 to debug .quant/.prob discrepancies Feb 3, 2026
Copilot stopped work on behalf of rob-p due to an error February 4, 2026 13:09
Copilot stopped work on behalf of rob-p due to an error February 4, 2026 13:09
- Remove all debug documentation files (DEBUG_ISSUE_59.md, TRACKING_TRANSCRIPT.md, README_TRANSCRIPT_TRACKING.md, test_debug_instrumentation.sh)
- Remove all debug logging from write_function.rs, em.rs, and bulk.rs
- Add --display-thresh command line parameter with default 0.000001
- Accept sentinel values 'none', 'None', 'NONE' to set threshold to f64::MIN_POSITIVE
- Update write_out_prob to accept display_thresh parameter instead of constant

Co-authored-by: rob-p <[email protected]>
@rob-p rob-p merged commit 9227284 into main Feb 4, 2026
5 checks passed
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