Skip to content
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

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Conversation

nvictus
Copy link
Member

@nvictus nvictus commented Sep 17, 2019

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

  • Unit tests added or updated
  • Updated CHANGELOG.md

Copy link
Contributor

@mccalluc mccalluc left a 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.

@@ -516,6 +502,8 @@ def make_mats(filepath):

mats[filepath] = [f, info]

info['mirror_tiles'] = 'false'
Copy link
Contributor

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?

Copy link
Member Author

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!

Copy link
Member Author

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.

@nvictus nvictus mentioned this pull request Sep 29, 2019
1 task
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.

2 participants