Skip to content

#15#19

Open
j-miko wants to merge 2 commits intomasterfrom
15-set-default-flank-values-to-0-instead-of-none-in-binmultiplematrices
Open

#15#19
j-miko wants to merge 2 commits intomasterfrom
15-set-default-flank-values-to-0-instead-of-none-in-binmultiplematrices

Conversation

@j-miko
Copy link
Copy Markdown
Member

@j-miko j-miko commented Mar 25, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 binMultipleMatrices default arguments flank_5/flank_3 from None to 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1576 to 1579
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
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread trxtools/profiles/metaprofiles.py Outdated
Comment on lines +1575 to +1576
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):
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

Set default flank values to 0 instead of None in binMultipleMatrices()

2 participants