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

calculate-cnv: Invalid interval bounds! #1

Closed sidiropoulos closed 3 years ago

sidiropoulos commented 3 years ago

Thank you for this very promising and much needed tool for cancer 3D genomics. I'm trying to run calculate-cnv on a 10kb cool matrix I created with hic2cool and I get the following error.

calculate-cnv --hic inter_30.10kb.cool -g hg38 -e MboI --output inter_30.10kb.cnv

# ARGUMENT LIST:
# Cool URI = inter_30.10kb.raw.cool
# Reference Genome = hg38
# Enzyme = MboI
# Output Path = cnv_test
# Cache Folder = ./
# Log file name = cnv-calculation.log
root                      INFO    @ 06/07/21 15:32:56: Calculate the 1D coverage from Hi-C matrix ...
root                      INFO    @ 06/07/21 15:33:28: Load GC content ...
Traceback (most recent call last):
  File "/home/projects/cu_10027/apps/software/miniconda3/4.5.4/envs/neoloop/bin/calculate-cnv", line 128, in run
    table = runcnv.signal_from_bigwig(table, gc_fil, name='GC')
  File "/home/projects/cu_10027/apps/software/miniconda3/4.5.4/envs/neoloop/lib/python3.7/site-packages/neoloop/cnv/runcnv.py", line 50, in signal_from_bigwig
    v = bw.stats(row['chrom'], row['start'], row['end'], type='mean')[0]
RuntimeError: Invalid interval bounds!

Do you have any idea of what could be causing the error?

Thanks, Nikos

XiaoTaoWang commented 3 years ago

Hi Nikos,

Thank you very much for this feedback! I think the reason might be that the chromosome names in your cool file do not have the prefix "chr", which was considered as "Invalid" when the program was trying to extract the GC/mappability content from the pre-calculated bigwig files.

I will make the program compatible with hic2cool in the next version for sure. But for now, could you run the script "https://raw.githubusercontent.com/XiaoTaoWang/NeoLoopFinder/master/scripts/add_prefix_to_cool.py" on your cool files before calculate-cnv (python add_prefix_to_cool.py inter_30.10kb.raw.cool), and let me know whether it works?

Thanks, Xiaotao

sidiropoulos commented 3 years ago

Hi Xiaotao,

Thank you for the very prompt reply. The fix you proposed worked and I could run calculate-cnv successfully! Looking forward to using the full toolkit.

Thanks, Nikos

XiaoTaoWang commented 3 years ago

Great, thanks!