deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
233 stars 70 forks source link

hicPlotDistVsCounts table of counts #77

Closed apaytuvi closed 7 years ago

apaytuvi commented 7 years ago

Is it possible to get the data from hicPlotDistVsCounts? In a txt file, for instance.

Thanks.

fidelram commented 7 years ago

Should be easy to implement. I will take a look.

Meanwhile, you can look at this line:

https://github.com/maxplanck-ie/HiCExplorer/blob/master/hicexplorer/hicPlotDistVsCounts.py#L91

and save the variables using json, assuming that your goal is to use R, for example for plotting.

The x values of the plot are:

dist_list = np.sort(common_dist) the y values are the mean of each distance key diagonals_dict[chrom]

In other words, for distance 10kb in chromosome chr2 the mean is np.mean(diagonals_dict[chrom][10000])

apaytuvi commented 7 years ago

Thank you!

fidelram commented 7 years ago

I introduced significant changes to hicPlotDistVsCounts including the option to save the underlying data.

Now it is also possible to combine in one plot the lines from different matrices.

This is in the develop branch at the moment.