HiCExplorer
HiCExplorer copied to clipboard
hicCorrect with cool format
Hi, when you use the cool format, the correct values are stored in the raw and when you apply the weights you get back to before correction... I think this is due to hicmatrix 13. Here is a minimal test to explain: I used the small_test3.cool that you can find (here)[https://github.com/lldelisle/pyGenomeTracks/raw/logInMatrices/pygenometracks/tests/test_data/small_test3.cool].
conda create -n hicexplorer3.5 hicexplorer=3.5
conda activate hicexplorer3.5
hicCorrectMatrix diagnostic_plot -m small_test3.cool --plotName diag3
hicCorrectMatrix correct -m small_test3.cool --correctionMethod ICE --filterThreshold -2 5.0 -o ice3.cool
hicConvertFormat -m ice3.cool -o ice3_raw.cool --inputFormat cool --load_raw_values --outputFormat cool
# This generate a cool format with h5 extension... I will write another issue for that...
# hicCorrectMatrix correct -m small_test3.cool --correctionMethod ICE --filterThreshold -2 5.0 -o ice3.h5
hicConvertFormat -m small_test3.cool -o small_test3.h5 --inputFormat cool --outputFormat h5
hicCorrectMatrix correct -m small_test3.h5 --correctionMethod ICE --filterThreshold -2 5.0 -o ice3.h5
echo "[ori]
file = small_test3.cool
title = input
depth = 2000000
show_masked_bins = true
min_value = 0
max_value = 50
[ice]
file = ice3.cool
title = ice
depth = 2000000
show_masked_bins = true
min_value = 0
max_value = 50
[ice]
file = ice3_raw.cool
title = ice raw values
depth = 2000000
show_masked_bins = true
min_value = 0
max_value = 50
[ori]
file = small_test3.h5
title = input as h5
depth = 2000000
show_masked_bins = true
min_value = 0
max_value = 50
[ice_h5]
file = ice3.h5
title = ice when using h5
depth = 2000000
show_masked_bins = true
min_value = 0
max_value = 50
[x-axis]
" > test3.ini
pgt --tracks test3.ini --region chr1:0-200000 -o test6.png

For info, I tested it with hicexplorer 3.4.3 and 3.4.1 and I always got the same output.
I think the issue is this line which should not be here: https://github.com/deeptools/HiCExplorer/blob/c2ad8630c48e04f0ce4229d75d4b1766df79317c/hicexplorer/hicCorrectMatrix.py#L740