Skip to content

compare two cool balance matrices #378

Answered by sergpolly
BenxiaHu asked this question in Q&A
Discussion options

You must be logged in to vote

There is no such functionality built-in into cooler or cooltools by itself. However you can easily do this while viewing your data interactively in higlass (or using higlass-python locally):

note that "divide by" button in the menu - here is the result after the division by one of the available hg19 datasets and changing a colormap to "bwr":

You can also achieve that by scripting it in python , e.g.:

import cooler
clr1 = cooler.Cooler("cooler1.cool")
clr2 = cooler.Cooler("cooler2.cool")

region_of_interest = ("chr1", 10_000_000, 50_000_000)

mat1 = clr1.matrix(balance=True).fetch(region_of_interest)
mat2 = clr2.matrix(balance=True).fetch(region_of_interest)

ratio_mat = mat1 / mat2

now …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nvictus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #356 on January 24, 2024 21:10.