-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scaling: take chromsizes from header #239
base: master
Are you sure you want to change the base?
Conversation
pairtools/tests/test_scaling.py Line 27 in 8c41a26
Are single unmapped pairs somehow supposed to contribute to scaling? I think this might be why the test fails... |
nah, they are never counted.
…On Fri, 3 May 2024 at 15:34, Ilya Flyamer ***@***.***> wrote:
https://github.com/open2c/pairtools/blob/8c41a26b3f3a3905e307f3baa4b547203394dca1/tests/test_scaling.py#L27
Are single unmapped pairs somehow supposed to contribute to scaling? I
think this might be why the test fails...
—
Reply to this email directly, view it on GitHub
<#239 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG64CVEOSBP5SA34U4CKWLZAOG7NAVCNFSM6AAAAABHFQMVTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTGAZTKMJSG4>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Then why does the test assert 9 total pairs? It doesn't make sense to me, but somehow I guess this test was passing before? |
(As an aside, in the file there is a pair with both sides beyond the end of the chromosome... should that actually error or warn at least?) |
OK, I think I know where the problem is: when not chromsizes are provided, internally they are created from the data, and then there is a fake chrom "!" which I guess just behaves like any other chromosome... pairtools/pairtools/lib/scaling.py Line 143 in 8c41a26
So I would say the test is wrong in this case? |
) | ||
|
||
if isinstance(pairs, pd.DataFrame): | ||
pairs_df = pairs | ||
|
||
elif isinstance(pairs, str) or hasattr(pairs, "buffer") or hasattr(pairs, "peek"): | ||
pairs_df, _, _ = pairsio.read_pairs(pairs, nproc=nproc_in, chunksize=chunksize) | ||
pairs_df, _, chromsizes = pairsio.read_pairs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main change
@golobor can we merge this? |
Scaling without a view was broken! Docs said it would use the chromsizes from the header, but there was no code that was doing it...