pearson matrix in juicebox

432 views
Skip to first unread message

nicolas.se...@gmail.com

unread,
Apr 7, 2016, 6:40:30 AM4/7/16
to 3D Genomics
Hi,

I was wondering how the pearson matrices are calculated in Juicebox.
I'm analyzing my own data and was interested in capturing chromosome compartment.
To do so, usually, we calculate obs/exp maps and then the pearson correlation on that matrix.
However, for some chromosomes (not all !), Juicebox does not give me the same pattern.

To check that I dumped the obs/exp matrix from Juicebox, load it into R, and simply run a correlation function (cor) on that matrix.
And the result is different from the Pearson correlation map in Juicebox.

So I was wondering if you are doing something special on that matrix ??
Thank you very much
Nicolas

nicolas.se...@gmail.com

unread,
Apr 8, 2016, 2:14:08 PM4/8/16
to 3D Genomics
Is there a way of dumping the pearson map ?
Thank you

Neva Durand

unread,
Apr 12, 2016, 10:55:03 AM4/12/16
to nicolas.se...@gmail.com, 3D Genomics
Hi Nicolas,

The Pearson's is calculated after subtracting the mean of the row from the O/E matrix.  This is because correlation of small values should be as valuable as correlation of big values.  We subtract the row mean from every entry in the row, in effect recentering the distribution.  O/E ranges from something like 1/5 to 5, and values below 1 that are correlated/anti-correlated with values above 1 need to count that way.

Look at the function "computePearsons" in the class MatrixZoomData to see the code that calculates the Pearson.

You can dump the Pearson map via the dump command:
juicebox dump <observed/oe/pearson/norm> <NONE/VC/VC_SQRT/KR> <hicFile(s)> <chr1> <chr2> <BP/FRAG> <binsize>

However, since the calculation takes a very long time at high resolutions, we limit it to matrices of 500Kb and lower.  You can change this in the "getPearsons" function in the class MatrixZoomData.

Best
Neva

On Fri, Apr 8, 2016 at 2:14 PM, <nicolas.se...@gmail.com> wrote:
Is there a way of dumping the pearson map ?
Thank you

--
You received this message because you are subscribed to the Google Groups "3D Genomics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 3d-genomics...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-genomics/d87fa1e2-adaa-4758-9da5-9eda289b722d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Neva Cherniavsky Durand, Ph.D.
Staff Scientist, Aiden Lab

povila...@gmail.com

unread,
Oct 21, 2016, 11:49:14 AM10/21/16
to 3D Genomics
Dear Neva,
I wanted to ask about reproducing correlation matrices. 

I downloaded oe matrix using juicebox, I also download pearson matrix for the same experiment. I tried to reproduce pearson matrix using oe matrix, however didn't manage to do so. Next I applied same algorithm (subtract row means) as in computePearsons (from the MatrixZoomData.java), however unsuccessfully as my result wasn't the same as original pearson matrix.
I wanted to ask: if there is any other modification done to oe matrix (besides subtract row means) before computing pearson correlation matrix.

Neva Durand

unread,
Oct 25, 2016, 4:10:36 AM10/25/16
to povila...@gmail.com, 3D Genomics
What you've described is what we do.  You can see the code in MatrixZoomData:
Lines 502-568.
After subtracting the row means, the Pearson's calculation is carried out by the Pearsons class:
Lines 202-229 (and calls other functions within that class; in particular, the column correlation is lines 133-173)

Best
Neva


--
You received this message because you are subscribed to the Google Groups "3D Genomics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 3d-genomics+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-genomics/59021e78-4d37-4519-9521-7c6e75a204d5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages