ay-lab / dcHiC

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

error running trans #85

Closed katecycho closed 6 months ago

katecycho commented 6 months ago

Hello!

Sorry to be raising so many questions but I hit an error finding compartments on trans matrix. The same input, matrix and bed files work for cis in same conda env, but I am not sure what the issue is.

Code: Rscript /Users/ccho/dcHiC/dchicf.r --file input.txt --pcatype trans

Error:

Reading the /Users/ccho/Desktop/data/dcHiC/trans/231038-HC01_5000_ICE_50000_abs_blacklist.bed file and reindexing chr1
Reindexing complete
Reading the matrix file /Users/ccho/Desktop/data/dcHiC/trans/231038-HC01_5000_ICE_50000.matrix
Written IDHwt1_pca/inter_pca/IDHwt1_mat/chr1.inter.txt

 *** caught illegal operation ***
address 0x10e0b44a6, cause 'illegal opcode'

Traceback:
 1: functionsdchic::createtransijk(matpath, bedpath, paste0(outpath,     "/", chr[l], ".inter.txt"), as.character(chr[l]))
 2: FUN(X[[i]], ...)
 3: lapply(1:length(chrom), extractTrans, chrom, normalizePath(df$mat[i]),     normalizePath(df$bed[i]), paste0(df$prefix[i], "_pca/", "inter_pca/",         df$prefix[i], "_mat"))
 4: FUN(X[[i]], ...)
 5: lapply(1:nrow(data), readfilesinter, data, pc, cthread, pthread,     rowmrge, dirovwt)
An irrecoverable exception occurred. R is aborting now ...
Illegal instruction: 4

Do you have any idea how I could troubleshoot? Not sure if it's an issue with the matrix. I generated it from .mcool files with preprocess.py, but they work fine with cis. Thank you.

Secondly, after running --pcatype analyze on 50+ samples I hit

Wrote  DifferentialResult/catalyst/fdr_result/differential.intra_sample_chr20_combined.pcQnm.bedGraph  file
Error in robust::covRob(intra_grp_2) : not enough observations
Calls: pcanalyze -> <Anonymous>
Execution halted

It generates _data subfolder for each sample in DifferentialResult directory, as well as pcOri and pcQnm folders, but stops after generating differential.intra_sample_chr20_combined.pcQnm.bedGraph. I am assuming chr21 does not have many differential interactions. Is there a way to bypass this? Additionally, the values in pcQnm folder are same as differential.intra_sample_chr#_combined.pcQnm.bedGraph - is that expected? Thank you so much for the help and for this tool!

jeffreygwang commented 6 months ago

Hi Kate, No worries at all; we welcome questions! They're helpful for us to make our application better and for other people using the tool. We'll look into the issue, although we'll note that the trans calling is still under development and canonically Hi-C compartment analysis is done with cis interactions only so hopefully this isn't too big of an issue.

I'm not sure about the second set of questions, so I'll let Abhijit take it—he'll take a look here soon.

ay-lab commented 6 months ago

Hi, In most cases "not enough observations" probably means that chr21 in one of the samples has some issues. If you can identify that sample/replicate and exclude that then it will resolve. The other option is to remove the chr21 files from all the dcHiC generated folders and chr21 instances from input bed files. dcHiC will then avoid performing the analysis for chr21. Hope it works and let me know if you still face any issues. Thanks for using the tool and raising the issues.

katecycho commented 4 months ago

Hi, In most cases "not enough observations" probably means that chr21 in one of the samples has some issues. If you can identify that sample/replicate and exclude that then it will resolve. The other option is to remove the chr21 files from all the dcHiC generated folders and chr21 instances from input bed files. dcHiC will then avoid performing the analysis for chr21. Hope it works and let me know if you still face any issues. Thanks for using the tool and raising the issues.

Hello! Thank you for this reply. Screenshot 2024-02-14 at 1 54 12 PM

I have ran into this issue again. I am running it on over 60 samples and wondering how to troubleshoot... It seems like the problem is chr17. Thank you