Gracefully handle low-coverage runs with explicit failure output (instead of crashing) [fix #109] - #159
Open
MikeWLloyd wants to merge 3 commits into
Open
Gracefully handle low-coverage runs with explicit failure output (instead of crashing) [fix #109]#159MikeWLloyd wants to merge 3 commits into
MikeWLloyd wants to merge 3 commits into
Conversation
Author
|
I have an updated Here is the updated build file so you can preview it: |
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.
Summary
This change makes low/no-coverage OptiType runs fail gracefully.
Previously, when no HLA reads were mapped, OptiType could crash with a pandas length-mismatch error while building the hit matrix. Now, low-coverage scenarios are detected explicitly, the run exits with a clear message, and a structured result TSV is still written so downstream workflows can handle the failure consistently / user can understand the failure.
Problem
In low/no-coverage inputs, the pipeline could reach an empty-read state and raise an internal error similar to:
This exposed an implementation detail rather than a user-meaningful outcome.
What Changed
• Detects cases where typing cannot proceed due to zero/insufficient usable HLA reads.
• Raises a domain-specific low-coverage error with a clear, actionable message.
• Includes FAILED status, zero reads, and a human-readable message.
• Preserves an output artifact even on failure.
• Empty alignment parsing behavior.
• Pipeline low-coverage graceful failure + failure TSV generation.
• CLI surfacing of low-coverage reason and result TSV path.
User-Facing Behavior
When typing is not possible due to low coverage, users now get:
• A clear low-coverage failure message.
• A written result TSV indicating FAILED status and why typing could not be produced.
Instead of:
• An internal pandas exception with no graceful diagnostic artifact.
Validation
Targeted tests executed and passing:
Backward Compatibility
• No API break intended for successful runs.
• Failure behavior is improved and now deterministic/artifact-producing for low-coverage cases.
Notes for Reviewers
Focus areas: