XiaoTaoWang / NeoLoopFinder

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

segment-cnv terminated without notice and results. #47

Closed Xieeeee closed 1 year ago

Xieeeee commented 1 year ago

Hi XIaotao, Thanks for the amazing tool. I recently encountered a problem, when running segment-cnv it will sometimes terminate without giving any errors or results. This happens when segmenting cnv on a sparse mcool aggregating from single cell HiC results. Do you have any idea why?

Best, Yang

XiaoTaoWang commented 1 year ago

Hi Yang,

Thanks for your testing on scHi-C. It would be helpful if you can: 1. provide the full logging message outputted by "segment-cnv"; 2. plot the genome-wide CNV profile from calculate-cnv using plot-cnv and show me the results?

Best, Xiaotao

Xieeeee commented 1 year ago

Hi Xiaotao, Thanks for the timely reply, and sorry for my delay; End of my error log from cnv-seg.log is here:

Traceback (most recent call last):
  File "/projects/ps-renlab/y2xie/anaconda3/envs/EagleC/bin/segment-cnv", line 87, in run
    work.segment()
  File "/projects/ps-renlab/y2xie/anaconda3/envs/EagleC/lib/python3.8/site-packages/neoloop/cnv/segcnv.py", line 139, in segment
    sig, hmm_seg, scale = self._segment(sig) # pure HMM-based segmentation
  File "/projects/ps-renlab/y2xie/anaconda3/envs/EagleC/lib/python3.8/site-packages/neoloop/cnv/segcnv.py", line 282, in _segment
    seq = np.r_[[s.name for i, s in model.viterbi(np.log2(queue))[1][1:]]]
TypeError: 'NoneType' object is not subscriptable

And plot-cnv using only --cnv-profile is attached (I use 100k res with 50 cells from a cancer cell line): test

I wonder whether this could be caused by data sparsity? Not sure if replacing missing data with 0 could be a right way...

Best, Yang

XiaoTaoWang commented 1 year ago

Hi Yang, based on your plot, it seems that the error you encountered could be caused by data sparsity. To potentially avoid this error, I have two suggestions: 1) You can try using lower resolutions, such as 200kb, 250kb, or 500kb, to reduce the impact of data sparsity on your results. 2) You can manually experiment with different values for the "--num-of-states" parameter, ranging from 3 to 10.

Hope these suggestions work!

Best, Xiaotao

Xieeeee commented 1 year ago

OK! Let me play with this. Thanks so much for your insight and help :)