-
Notifications
You must be signed in to change notification settings - Fork 37
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
Equal aspect for hic matrix #91
base: master
Are you sure you want to change the base?
Conversation
Hello, I also noticed this issue before. I also believe that setting pixels to be square is a better default value. Unfortunately, I didn't do any Hi-C related work later on, which resulted in a lack of time to maintain this project at the moment. If there are no issues after making the modifications and testing them on your end, please notify me to proceed with the merge. Thank you for your contribution! |
I think it works fine for me, the only issue (which is simply the limitations of laws of mathematics) is that with a small height of the track the heatmap might not fill the whole width of the frame... |
Can you provide some graphical examples? |
Stumbled upon this issue while trying to implement custom matrix tracks for a project I am working on. I think @Phlya is referring to the results which can be obtained from the following snippet of code.
This will yield the following image: When the height of the track is too small, the image will not touch the expected borders. This is a major issue when displaying multiple tracks, since they will not be aligned. On the other hand, by running the same code but with In this case, since there is enough height, the left and right border will be touched, though there can be some annoying white space below the plot. I could not find an easy way to remove the space and it makes difficult to plot multiple tracks in a compact manner. My only idea to solve the issue would be to force the track height to be, by default, some function of track width and |
Btw, I found a way to fill the space correctly when the aspect ratio is set to "equal".
margins = self.properties["margins"]
margins_fraction = margins["right"] - margins["left"]
frame_width = (
self.properties["width"]
* self.properties["width_ratios"][1]
* margins_fraction
)
With these two changes we have the expected behavior. This works well with |
Hi @StefanoCretti, Thank you for your effort! I am very interested in PR. Perhaps a parameter (such as equal_aspect=True) can be added to control whether to use this code, in order to avoid conflicts with directly setting the height. |
I am on it. |
I think equal aspect looks much better for the Hi-C matrix, makes pixels actually square... Perhaps it can be an argument passed to the track, but IMO equal aspect is a better default. What do you think?