ay-lab / fithic

Fit-Hi-C is a tool for assigning statistical confidence estimates to chromosomal contact maps produced by genome-wide genome architecture assays such as Hi-C.
MIT License
79 stars 16 forks source link

HiCKRy.py KeyError: '0' #51

Closed mannekim closed 2 years ago

mannekim commented 2 years ago

Hi,

I'm trying to generate a bias values file and it gives me this error:

Creating sparse matrix... Traceback (most recent call last): File "/gpfs/data/reinberglab/home/kl3488/fithic/fithic/utils/HiCKRy.py", line 283, in main() File "/gpfs/data/reinberglab/home/kl3488/fithic/fithic/utils/HiCKRy.py", line 276, in main matrix,revFrag = loadfastfithicInteractions(args.interactions, args.fragment s) File "/gpfs/data/reinberglab/home/kl3488/fithic/fithic/utils/HiCKRy.py", line 45, in loadfastfithicInteractions x.append(fragDic[chrom1][mid1]) KeyError: '0'

My contact counts file and fragment mappability files seem to look ok:

Contact counts:

chr10 100467500 chr10 100592500 1 chr10 100467500 chr10 100597500 2 chr10 100467500 chr10 100602500 2

Fragment mappability:

chr10 895000 897500 1 1 chr10 900000 902500 1 1 chr10 905000 907500 1 1

ay-lab commented 2 years ago

My guess would be that you have some chr-midpoint combinations in your contact count file that are not there in the fragment mappability or a chromosome/contig with all fragments filtered out due to mappability or bias filters. KeyError: '0' suggests you may have an entry with 0 as midpoint or as chr, not sure

mannekim commented 2 years ago

Hi Thanks, Indeed I do have chr entries in the contact counts file that are 0. What could be causing it? Should I just filter it out?

ay-lab commented 2 years ago

Filtering is an option but you might want to understand what causes it before doing so.

mannekim commented 2 years ago

I looked at my input pairs file, and there were extraneous lines in the beginning that were not giving information about valid pairs. I removed those lines and remade the contact counts file. using this and the fragments file, the HiCKRy was running. However, it's still not working and giving me a new message:

Creating sparse matrix... Sparse matrix creation took 659.9486513137817 seconds Removing 0.05 percent of most sparse bins ... corresponds to 27310 total rows ... corresponds to all bins with less than or equal to 0.0 total interactions Killed

I have now idea why it's getting killed. please advise

mannekim commented 2 years ago

oh i realized it's cause the memory was not enough. i increased the memory and the HiCKRy is working now. thanks!