vaquerizaslab / fanc

FAN-C: Framework for the ANalysis of C-like data
GNU General Public License v3.0
104 stars 14 forks source link

Same signals when visualizing ComparisonMatrix #140

Open PeggySze opened 1 year ago

PeggySze commented 1 year ago

Hello! Thanks for developing such a wonderful toolkit for Hi-C data analysis. I have compared Hi-C matrices between two conditions (conditionA and conditionB) by running the following command :

fanc compare -c fold-change conditionA_50kb.hic conditionB_50kb.hic conditionA_vs_B_ComparisonMatrix

Next, I tired to visualize this ComparisonMatrix in a triangular plot by running the following command :

fancplot -o A_vs_B_fold_change_triangular_plot.pdf  18:84011627-84589725 -p triangular --title A_vs_B --colormap viridis conditionA_vs_B_ComparisonMatrix

It generated a plot with the same signals. Would anyone know how to fix this problem? It seems that there is difference between two conditions when visualizing each condition, respectively. A_vs_B_fold_change_triangular_plot.pdf A_chr18_84011627_84589725_hic_triangular_plot.pdf B_chr18_84011627_84589725_hic_triangular_plot.pdf

kaukrise commented 1 year ago

Hi, thank you for reporting this. From your images, it actually looks like the comparison generated invalid values - if the matrices were considered identical, all values would be 1.

I'm not sure where the comparison is failing - were there any warnings or errors in the compare command logging output? Can you post the log here? What kind of matrix are you working with (FAN-C, Juicer, Cooler)? What version of FAN-C are you using?

PeggySze commented 1 year ago
  1. Here is the log when running compare command :

    2023-01-07 16:32:40,020 INFO FAN-C version: 0.9.25
    2023-01-07 16:32:41,194 INFO Calculating scaling factor...
    Compare 100% (2211 of 2211) |##########################################| Elapsed Time: 0:30:53 Time:  0:30:53
    Buffers 100% (1485 of 1485) |##########################################| Elapsed Time: 0:00:05 Time:  0:00:05
    Expected 100% (87539727 of 87539727) |#################################| Elapsed Time: 0:09:39 Time:  0:09:39

    There are not any warnings or errors when running compare command. And as shown above, the version of FAN-C I used is 0.9.25.

  2. Before running compare command, I started with the .hic file generated by Juicertools and converted it to FAN-C format by running the following command :

    fanc to-fanc A.hic@50kb@KR A_50kb.hic
    fanc to-fanc B.hic@50kb@KR B_50kb.hic
kaukrise commented 1 year ago

Hi, sorry about the delay, I only returned from holidays yesterday.

I tried the compare command on FAN-C sample data, but was unable to reproduce the issue. Can you please try the same, so we can confirm that this is related to the matrices you are using? Then we can debug further.

You should see this:

lowc_hindiii_vs_mboi

kaukrise commented 1 year ago

If you see the same result, could you please run the compare command you were using in debug mode and post the logging output here?

fanc -vvv compare -c fold-change conditionA_50kb.hic conditionB_50kb.hic conditionA_vs_B_ComparisonMatrix