Bug Fixes and Improvements for CNV Analysis and Fusion DetectionBugs/cnv report #130
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 PR addresses several critical bugs and implements improvements across CNV analysis, fusion detection, and system performance. The changes enhance data handling robustness, fix pandas FutureWarnings, and improve overall system stability.
🔧 Fixes and Improvements
Added comprehensive CNV analysis method (analyze_cytoband_cnv) with dynamic threshold detection
Improved data validation with proper checks for cnv_dict and bin_width availability
Enhanced logging with detailed debug information for CNV analysis processes
Fixed regex patterns in file parsing (changed "\s+" to r"\s+" for proper regex handling)
Improved cleanup handling in CNV analysis objects
Enhanced gene data handling in FusionSection with proper null checks
Added validation to ensure complete gene information before processing fusion pairs
Improved error handling with warning logs for missing or incomplete gene data
Fixed pandas FutureWarning in FusionObjectClass by replacing deprecated groupby operations with explicit iteration
Reduced telemetry update frequency from 2 minutes to 5 minutes to improve system performance
Fixed string formatting issues in break point detector (removed stray backslashes)
Updated version to 0.3.1 to reflect these improvements
Enhanced error handling throughout the codebase
Improved logging with more descriptive debug messages
Better resource management with proper timer cleanup
📊 Technical Details
Files modified: 6 files
Lines added: 343
Lines removed: 27
Key areas: CNV analysis, fusion detection, telemetry, error handling
🧪 Testing
All changes maintain backward compatibility
Enhanced error handling prevents crashes from missing data
Improved logging facilitates debugging and monitoring
�� Breaking Changes
None - all changes are backward compatible improvements and bug fixes.