-
Notifications
You must be signed in to change notification settings - Fork 21
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
Transpose bins 1 and 2 #105
base: develop
Are you sure you want to change the base?
Conversation
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.
Looks reasonable. If it's not too hard, this could be a good chance to introduce tests, but maybe if there were problems, they would be obvious enough?
There is a travis failure:
ERROR: Failure: ImportError (this version of pandas is incompatible with numpy < 1.13.3
your numpy version is 1.13.1.
Please upgrade numpy to >= 1.13.3 to use this pandas version)
numpy
is unpinned, so I'm not sure why it's not getting the more recent version it wants.
clodius/tiles/cooler.py
Outdated
@@ -516,6 +502,8 @@ def make_mats(filepath): | |||
|
|||
mats[filepath] = [f, info] | |||
|
|||
info['mirror_tiles'] = 'false' |
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 one line that is neither a coordinate swap nor a whitespace tweak... It is what you intend?
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.
Nope. I forced no mirroring for debugging purposes. Good catch!
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.
The problem now is that the client performs "mirroring" by copying lower triangle pixels to the upper triangle, so the result is a white heatmap with pixels painted only on the main diagonal.
Description
What was changed in this pull request?
Swap the way clodius populates coordinates for tiles, such that bin1 is rows and bin2 is cols.
Why is it necessary?
Bins 1 and 2 have been getting mapped to the horizontal (columns) and vertical (rows) axes in HiGlass, respectively, which is the opposite of the matrix convention (first axis vertical and second being horizontal). This had no impact at all on symmetric heatmaps but does affect new asymmetric ones. See higlass/higlass#704.
While we can introduce an option to transpose the axes on the front end, we should alter the default to be the least surprising choice given the orientation of HiGlass's axes (bin1 = matrix i = vertical from top-to-bottom; bin2 = matrix j = horizontal from left-to-right; origin in the top left corner).
This will probably also require swapping the direction tile "mirroring" works on the client.
Checklist