Conversation
There was a problem hiding this comment.
Pull request overview
Updates binMultipleMatrices defaults to treat missing flanks as zero-length extensions, aligning behavior with other profile utilities that treat flanks as optional.
Changes:
- Changed
binMultipleMatricesdefault argumentsflank_5/flank_3fromNoneto0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| flank_5=0, flank_3=0, region_col=None): | ||
| ''' | ||
| Bin multiple matrices of gene profiles into a single dataframe | ||
| :param mm: dictionary of matrices of gene profiles |
There was a problem hiding this comment.
The defaults for flank_5/flank_3 were changed to 0, but the docstring below still says they default to None (and the helper accepts int or DataFrame). Please update the docstring to match the new defaults and allowed input types so callers don’t get misled.
| def binMultipleMatrices(mm={}, bins=[50, 10, 50], bed_df=pd.DataFrame(), | ||
| flank_5=None, flank_3=None, region_col=None): | ||
| flank_5=0, flank_3=0, region_col=None): |
There was a problem hiding this comment.
With flank_5=0/flank_3=0 as defaults, calling binMultipleMatrices() without a valid bed_df now fails via an IndexError from bed_df.iloc[:, 3] inside process_input, which is hard to interpret. Consider making bed_df a required argument (no default) or adding an explicit early validation with a clear ValueError when bed_df is empty/missing required columns.
No description provided.