ay-lab / dcHiC

dcHiC: Differential compartment analysis for Hi-C datasets
MIT License
57 stars 10 forks source link

Error when running --pcatype analyze #32

Closed csijcs closed 2 years ago

csijcs commented 2 years ago

I am able to run some samples without error, but I am currently getting an error for a particular group of samples when I run: Rscript ~/dcHiC/dchicf.r --file BC005_input.txt --pcatype analyze --dirovwt T --diffdir BC005_100Kb I get the error:

Error in solve.default(cov, ...) :
  Lapack routine dgesv: system is exactly singular: U[3,3] = 0
Calls: pcanalyze ... do.call -> CovSde -> mahalanobis -> solve -> solve.default
Execution halted

Any idea what could be causing this and how to fix it?

ay-lab commented 2 years ago

Hi,

This error generally arises when there is no covariance (i.e. no change within PC coordinates) between a pair or across a group of samples. I will suggest generating a chromosome-wise correlation table across the samples. This will help you to find the chromosome(s) which remained completely unchanged across the conditions that you're testing for. I will also try to run on a higher resolution Hi-C data like ~40Kb or ~10Kb. In some cases, the higher resolution leads to some covariance and will avoid the error.