Use chromsizes from the pairs header in scaling (fixes empty n_bp2)#286
Closed
OfficialBishal wants to merge 1 commit into
Closed
Use chromsizes from the pairs header in scaling (fixes empty n_bp2)#286OfficialBishal wants to merge 1 commit into
OfficialBishal wants to merge 1 commit into
Conversation
compute_scaling() read the .pairs header chromsizes via read_pairs() but discarded them, so running scaling without --view left region ends at -1 and produced an empty n_bp2 column. Use the header chromsizes when the caller does not pass any, and add a test. Closes open2c#282
Member
|
I think I already fixed it here: #283 |
Author
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.
Closes #282.
Running
pairtools scalingwithout--viewleft then_bp2column empty:compute_scalingreads the chromsizes from the.pairsheader (viaread_pairs) but discarded them (pairs_df, _, _ = ...), sobins_pairs_by_distancefell back to region ends of-1andn_bp2could not be computed.This uses the header chromsizes when the caller doesn't pass an explicit
chromsizes, matching the existing intent — the CLI passes the stream "so that it can parse the header automatically". An explicitchromsizesargument and the DataFrame input path are unaffected (the change is gated onchromsizes is None).On
tests/data/mock.pairsam(headerchr* = 100):end1 == -1for every bin, cisn_bp2all0, transn_bp2garbage.end1is the chromosome length from the header, andn_bp2is populated.Added
test_scaling_uses_header_chromsizescovering the no-view case.