bxlab / hifive

Tools for handling HiC and 5C data
MIT License
22 stars 8 forks source link

hic-mrheatmap - Segmentation fault #6

Open fbemm opened 7 years ago

fbemm commented 7 years ago

I am trying to fetch mrh data (especially trans interactions) from a normalized project. As soon as I specify more than one chromosome/scaffold hic-mrheatmap often gives me a segmentation fault. The behavior is not the same across all possible combinations of chromosomes/scaffolds. For some it returns a mrh for others it dies with

Finding multi-resolution heatmap for 12 by SCF_7...Segmentation fault

[21071391.448646] hifive[12069]: segfault at 880240c8 ip 00007f1c13e2ada6 sp 00007ffff75859f0 error 4 in _hic_binning.so[7f1c13df8000+54000]

Any idea where to start looking?

msauria commented 7 years ago

Are you using the latest version, the development version, or an older one?

fbemm commented 7 years ago

commit 3aeed7443b4812fe33c92904717d6faacd9cbaec hifive 1.3.0

msauria commented 7 years ago

Also, is this data produced using a restriction fragment fend file, a binned restriction fragment fend file, or a binned fend file?

fbemm commented 7 years ago

I am using a restriction fragment fend file. fends are quite small since we used DpnII.

msauria commented 7 years ago

Okay, give me a little bit to see if I can reproduce the error on my end. Unfortunately segmentation errors are a pain to track down.

msauria commented 7 years ago

I've uploaded a fix for this error. Please let me know if this solves the issue or if you continue to have problems. Thanks

fbemm commented 7 years ago

Finding multi-resolution heatmap for 1 by 10... Done

Seems to work, thx a lot!

fbemm commented 7 years ago

For a number of trans combinations it works now but it fails for others. Particular the smaller chromosomes/scaffolds seemed to be affected.

[21071139.394452] hifive[9749]: segfault at 928a500 ip 00007f97723b2da6 sp 00007ffde78bd7e0 error 4 in _hic_binning.so[7f9772380000+54000] [21071391.448646] hifive[12069]: segfault at 880240c8 ip 00007f1c13e2ada6 sp 00007ffff75859f0 error 4 in _hic_binning.so[7f1c13df8000+54000] [21072423.734567] hifive[34496]: segfault at 7ae920c ip 00007efdc9c7ada6 sp 00007ffda16e4930 error 4 in _hic_binning.so[7efdc9c48000+54000] [21072630.076356] hifive[35755]: segfault at 6d4c20c ip 00007f76a258ada6 sp 00007fffd1c76880 error 4 in _hic_binning.so[7f76a2558000+54000] [21072737.020203] hifive[36439]: segfault at 6caa20c ip 00007f8702aeada6 sp 00007ffff3055c20 error 4 in _hic_binning.so[7f8702ab8000+54000] [21072852.987441] hifive[37236]: segfault at 7125bdc ip 00007efdf5332da6 sp 00007fff6d2d14f0 error 4 in _hic_binning.so[7efdf5300000+54000] [21073119.913122] hifive[39429]: segfault at 6c2026c ip 00007f8f91412da6 sp 00007ffdfcbd94f0 error 4 in _hic_binning.so[7f8f913e0000+54000] [21073775.981579] hifive[46063]: segfault at 7a0514c ip 00007f58ade8ada6 sp 00007ffc694a3470 error 4 in _hic_binning.so[7f58ade58000+54000] [21073837.283689] hifive[46690]: segfault at 6f4f05c ip 00007f80c73a2da6 sp 00007ffe4aae2e50 error 4 in _hic_binning.so[7f80c7370000+54000] [21074559.984897] hifive[52014]: segfault at 890851a8 ip 00007f843533ada6 sp 00007ffff2d27d10 error 4 in _hic_binning.so[7f8435308000+54000] [21091987.932288] hifive[29717]: segfault at ffffffff079886b4 ip 00007fa3503033cb sp 00007ffc833740c0 error 5 in _hic_binning.so[7fa3502d0000+54000] [21095071.407682] hifive[51013]: segfault at 132380c8 ip 00007fd931503395 sp 00007ffdc4a31560 error 4 in _hic_binning.so[7fd9314d0000+54000]

msauria commented 7 years ago

I suspect what is happening is that there is no data for those chromosome combinations (or at least insufficient data). I will have to address this, but for now I would suggest two things. First, could you run the command "python -c 'import hifive; hic=hifive.HiC('YOUR_PROJECT'); data=hic.trans_heatmap(CHR1, CHR2, binsize=100000);" and see whether it returns a warning, where CHR1 and CHR2 is a pair of chromosomes that MRHeatmap fails with? Second, until this is solved I suggest just passing a list of chromosomes to HiFive only including major chromosomes, unless you need the smaller ones. However if it is a lack of data, there is little to be done for the trans interactions. I will work on the error, though, to make sure that it does not cause a program crash.

fbemm commented 7 years ago

I tested it for the combination that failed previously:

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap("SCF_7", "SCF_10", binsize=10000)'

Finding enrichment array for SCF_7:0-140000 by SCF_10:0-420000... Finding mean signals across trans interactions... Done Done

Unfortunately, I need the smaller ones since I am trying to find a scaffold that is linked to existing chromosomes but was previously not mapped to it.

fbemm commented 7 years ago

Could it be that it is a simple quotation problem?

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap('SCF_7', 'SCF_10', binsize=10000)'

File "", line 1, in NameError: name 'SCF_7' is not defined

or

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap('12', 'SCF_10', binsize=10000)'

Traceback (most recent call last): File "", line 1, in File "/ebio/abt6_projects9/abt6_software/bin/hifive/local/lib/python2.7/site-packages/hifive/hic.py", line 2291, in trans_heatmap silent=self.silent) File "/ebio/abt6_projects9/abt6_software/bin/hifive/local/lib/python2.7/site-packages/hifive/hic_binning.py", line 943, in find_trans_signal chrint1 = hic.chr2int[chrom1.strip('chr')] AttributeError: 'int' object has no attribute 'strip'

msauria commented 7 years ago

I will get this fixed, but it will probably be a few days. In the meantime, perhaps the standard heatmapping function (hifive hic-heatmap) would suffice?

On Tue, Oct 18, 2016 at 10:07 AM, Felix Bemm notifications@github.com wrote:

I tested it for the combination that failed previously:

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap("SCF_7", "SCF_10", binsize=10000)'

Finding enrichment array for SCF_7:0-140000 by SCF_10:0-420000... Finding mean signals across trans interactions... Done Done

Unfortunately, I need the smaller ones since I am trying to find a scaffold that is linked to existing chromosomes but was previously not mapped to it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bxlab/hifive/issues/6#issuecomment-254518259, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMBjUOoyKSldUXWj7bGepdtqM5nnyPAks5q1NKJgaJpZM4KYkoK .

msauria commented 7 years ago

I agree that those two errors are the result of mixing and matching single vs. double quotation marks. However, since you saw that it ran fine the first time with the trans_heatmap function, that tells me that the MRHeatmap error is in the write_mrheatmap function, not in the syntax calling it.

On Tue, Oct 18, 2016 at 10:10 AM, Felix Bemm notifications@github.com wrote:

Could it be that it is a simple quotation problem?

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap('SCF_7', 'SCF_10', binsize=10000)'

File "", line 1, in NameError: name 'SCF_7' is not defined

or

python -c 'import hifive; hic=hifive.HiC("contigs.nrm.project"); data=hic.trans_heatmap('12', 'SCF_10', binsize=10000)'

Traceback (most recent call last): File "", line 1, in File "/ebio/abt6_projects9/abt6_software/bin/hifive/local/lib/ python2.7/site-packages/hifive/hic.py", line 2291, in trans_heatmap silent=self.silent) File "/ebio/abt6_projects9/abt6_software/bin/hifive/local/lib/ python2.7/site-packages/hifive/hic_binning.py", line 943, in find_trans_signal chrint1 = hic.chr2int[chrom1.strip('chr')] AttributeError: 'int' object has no attribute 'strip'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bxlab/hifive/issues/6#issuecomment-254519173, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMBjYaqp-iWZzjrxp-pk42sczvJ9K2Fks5q1NNLgaJpZM4KYkoK .