dozmorovlab / HiCcompare

Joint normalization of two Hi-C matrices, visualization and detection of differential chromatin interactions. See multiHiCcompare for the analysis of multiple Hi-C matrices
https://dozmorovlab.github.io/HiCcompare/
Other
19 stars 3 forks source link

loess normalization error #22

Closed BenxiaHu closed 3 years ago

BenxiaHu commented 3 years ago

hello, when I ran HiCcompare to analyze two 40kb contact matrices, I got this error:

hic.list <- hic_loess(hic.list, parallel = TRUE) Span for loess: 0.0553159751353865 GCV for loess: 2.1838746854347e-06 AIC for loess: 1.27145513597705 Span for loess: 0.145845268859101 GCV for loess: 5.54106850960171e-06 AIC for loess: 1.2204086523086 Span for loess: 0.0853351658453019 GCV for loess: 4.96298216938726e-06 AIC for loess: 1.31897101094325 Error in result[[njob]] <- value : attempt to select less than one element in OneIndex Calls: hic_loess ... -> -> bploop -> bploop.lapply

do you know how to deal with this issue? Best,

mdozmorov commented 3 years ago

Data sparsity is likely the cause. Can you try 100Kb data?

BenxiaHu commented 3 years ago

I can successfully run HiCcompare on 10kb matrix. but it can not analyze 40kb matrix.

mdozmorov commented 3 years ago

Then, I'd go with 10kb results. To debug 40kb data, I need a minimal example, code with a subset of data (save as Rds). Another thought - do you use parallelization? If yes, disable and try again.

BenxiaHu commented 3 years ago

do you use parallelization? If yes, disable and try again.

yes, I set parallel to True. I am trying to disable parallel and run HiCcompare again. Thanks

BenxiaHu commented 3 years ago

it works. thanks a lot.

Now I have another question: does HiCcompare perform quantile normalization for 2 different Hi-C with different sequencing depth?

mdozmorov commented 3 years ago

Yes, HiCcompare accounts for depth differences. You don't need to worry about it, but if you do, see the Total Sum Scaling section.

BenxiaHu commented 3 years ago

thanks

mdozmorov commented 3 years ago

The purpose of Loess normalization is to adjust (rescale) the data so the differences between two Hi-C datasets are minimized. So, you always will see rescaled data after normalization. Unless you have wildly different sequencing depth, I won't worry about rescaling and let Loess do its job.

mdozmorov commented 3 years ago

Closed, please, ask in this thread if any other questions.