pairtools
pairtools copied to clipboard
Fix scaling: take chromsizes from header
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...
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...
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 https://github.com/open2c/pairtools/pull/239#issuecomment-2093035127, 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... https://github.com/open2c/pairtools/blob/8c41a26b3f3a3905e307f3baa4b547203394dca1/pairtools/lib/scaling.py#L143 So I would say the test is wrong in this case?
@golobor can we merge this?