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
231 stars 70 forks source link

TAD scores are different in bm and bedgraph files #763

Open benayang opened 2 years ago

benayang commented 2 years ago

Hello, I'm wondering why there is a difference between the TAD separation scores stored in the fdr_tad_score.bm file and those stored in the fdr_score.bedgraph file. My understanding is that the scores should be the same as the .bm file is for mainly for plotting with hicPlotTADs.

I'm using hicexplorer 3.6 with Python 3.7.3. The command, .ini file, and final image are shown below.

hicPlotTADs --tracks young_tad_comparison.ini --region chr2:10000000-25000000 -o young_10kb_TAD_calling_comparison_withScores.png --dpi 300

young_tad_comparison.ini.txt

young_40kb_TAD_calling_comparison_withScores_TADscore

joachimwolff commented 2 years ago

Hi,

the bm file contains all scores per bin, these are created by the different search depths. The bedgraph file contains the mean value of these scores and the start/end values are the TAD boundaries and not the bins themselves.

Example: bm file: chr3L 5000 10000 -0.185185 -0.171295 -0.149986 -0.132483

bedgraph: chr3L 2500 7500 -0.159737250000

and (-0.185185 + -0.171295 + -0.149986 + -0.132483) / 4 = -0.159737250000

I hope this helps.

Best,

Joachim

benayang commented 2 years ago

Hi Joachim,

Thanks, this is helpful! Are the TAD boundaries staggered relative to the bins? I noticed that each entry in the bedgraph file flanks an end coordinate in the bm file.

Example: bm file:

{"step":40000,"minDepth":120000,"maxDepth":1200000,"binsize":40000}

chr1 0 3040000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 chr1 3040000 3080000 0.804676 0.734176 1.006726 1.319602 1.518158 1.916658 1.956440 2.084957 2.186094 2.477788 chr1 3080000 3120000 0.704070 0.964221 1.139786 1.366559 1.538588 1.766690 1.700540 1.801094 1.883025 2.240470 chr1 3120000 3160000 1.199611 1.150259 1.346537 1.417870 1.492905 1.594312 1.567390 1.707958 1.818895 2.239832

bedgraph: chr1 1520000 3060000 1.600527323261 chr1 3060000 3100000 1.510504264995 chr1 3100000 3140000 1.553557071796 chr1 3140000 3180000 1.458487115798