XiaoTaoWang / NeoLoopFinder

A computation framework for genome-wide detection of enhancer-hijacking events from chromatin interaction data in re-arranged genomes
Other
59 stars 16 forks source link

Triangle fails to plot some off-diagonal contacts #32

Open auberginekenobi opened 2 years ago

auberginekenobi commented 2 years ago

Possibly related to https://github.com/XiaoTaoWang/NeoLoopFinder/issues/6#issuecomment-884874868 . I successfully called neoloops in my sample using neoloop-caller. Adapting code from this repo's readme, I generated a Triangle plot of my region of interest, which consists of multiple segments of chr8 and chr14:

D458_10k_CNV

Two boxes at the apex of the Triangle are devoid of any Hi-C signal, even though neoloop-caller was able to identify loops in these regions. Looking at the Hi-C map of the locus in Juicebox, I see comparable interaction frequency with chr8 across the two segments of chr14:

juicebox_screenshot

Therefore, my conclusion is that Triangle is failing to plot the off-diagonal Hi-C signal for some SV segment pairs? Any guidance on this issue would be appreciated.

XiaoTaoWang commented 2 years ago

Hi, sorry for not making this clearer in the documentation. By default, the plot_loops method perform a pooling algorithm on the input loop calls and only plot the strongest dots if multiple dots cluster in a local area. To switch this option off, just set the parameter "cluster" to "False" when you run plot_loops. Something like this:

>>> vis.plot_loops('K562.neo-loops.txt', face_color='none', marker_size=40, cluster=False)

Let me know if this works. Thanks!

auberginekenobi commented 2 years ago

Hi Xiaotao, thanks for the response and for this clarification, but I don't think it addresses the issue. I'm quite happy with the neoloop calls; these are far superior to FitHiC or HiCCUPS around this SV. However, the underlying Hi-C contact map seems to have gaps. Note that in the Triangle plot, the red Hi-C signal is entirely absent between the two segments containing MYC and OTX2. However, in the Juicebox visualization, it is quite clear that the red Hi-C signal is comparable in this region to adjacent regions.

XiaoTaoWang commented 2 years ago

Oh. NeoLoopFinder does have a procedure to automatically adjust the scale of Hi-C signals between different fragments, based on a regression model. If you prefer plotting the original signals, you can manually set the scale factor to 1 when you initialize the Triangle object. In your case, the command will be something like this:

>>> vis = Triangle(clr, assembly, n_rows=3, figsize=(7, 4.2), track_partition=[5, 0.4, 0.5], correct='sweight', slopes={(0,0):1, (1,1):1, (2,2):1, (3,3):1, (0,1):1, (0,2):1, (0,3):1, (1,2):1, (1,3):1, (2,3):1})

Note that in this mode, you need to specify a value (in this case 1) to each pair of the fragments in the assembly, and the index of the fragment starts from 0.