ay-lab / FitHiChIP

Statistically Significant loops from HiChIP data
MIT License
39 stars 20 forks source link

Error in .compressOffsets(y, offset = offset) : offsets must be finite values Calls: ApplyEdgeR -> exactTest -> mglmOneGroup -> .compressOffsets #102

Open Gemma-Zhang-326 opened 1 year ago

Gemma-Zhang-326 commented 1 year ago

Hi, I'm doing the differential loops analysis by Imp_Scripts/DiffAnalysisHiChIP.r And It went error after I just switched the positions of the input files in my execution script.

Rscript Imp_Scripts/DiffAnalysisHiChIP.r \
 --AllLoopList Human_H3K27ac_FitHiChIP.interactions_FitHiC.bed,New_Macaque2T2T_FitHiChIP_H3K27ac_merge.interactions_FitHiC.bed \
 --ChrSizeFile /gpfs/home/zhangyue/biosoft/HiC-Pro_3.1.0/HiC-Pro_3.1.0/annotation/T2T-CHM13.chrom.sizes \
 --ChIPAlignFileList Human_H3K27ac_TPM_normalized.bedgraph,H3K27ac_Mmul_10_mergeTPM_normalized_liftoverT2T.final.bedGraph \
 --OutDir ./Human_hichipbedgraph_Diff_diff0.6_FDR0.1 \
 --FDRThr 0.1 --DiffFDRThr 0.6 --CategoryList HumanH3K27ac,MacaqueH3K27ac 1>log 2>&1

And the error reported like this

 *** Created master sheet of loops *** 

Joining, by = c("chr1", "start1", "end1")
Joining, by = c("chr2", "start2", "end2")

 ===>>> GroupDistrVec : MacaqueH3K27ac    
 ===>>> GroupDistrVec : HumanH3K27ac     Error in .compressOffsets(y, offset = offset) : 
  offsets must be finite values
Calls: ApplyEdgeR -> exactTest -> mglmOneGroup -> .compressOffsets
In addition: Warning message:
In DGEList(counts = CountData, group = GroupDistrVec) :
  library size of zero detected
Execution halted

Like I said before, once I switched the location of the input files, It went normally, really confused, your reply or help is urgently needed!

ay-lab commented 8 months ago

Hi @Gemma-Zhang-326 Sorry for the late response. I haven't seen this problem before. Likely due to the low sequencing depth and low count values of HiChIP data. One possible solution of this issue is posted here: https://support.bioconductor.org/p/89726/ Could you please try the following: Search for calcNormFactors() routine in the code DiffAnalysisHiChIP.r and change its parameter from "RLE" to "upperquartile", removing counts of zeros in all libraries.