Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiprocessing error with .cool file #18

Open
IsMM15 opened this issue Feb 28, 2024 · 1 comment
Open

Multiprocessing error with .cool file #18

IsMM15 opened this issue Feb 28, 2024 · 1 comment

Comments

@IsMM15
Copy link

IsMM15 commented Feb 28, 2024

Hello,
I am trying to run the tool with the following command:

python diffdomains.py dvsd multiple /data/T1_10000.cool /data/T2_10000.cool /data/TADS_DM.bed --reso 10000

But after appearing to run fine for a while it throws the following error:

...
chr9:75210000:75430000
chr9:106940000:107100000
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "diffdomains.py", line 66, in
comp2domins_by_twtest_parallel(0)
File "diffdomains.py", line 59, in comp2domins_by_twtest_parallel
fhic0=opts[''], fhic1=opts[''],min_nbin=int(opts['--min_nbin']),f=opts['--f'])
File "/diffdomain-py3/utils.py", line 338, in comp2domins_by_twtest
mat0 = contact_matrix_from_hic(chrn, start, end, reso, fhic0, hicnorm)
File "/diffDomain/diffdomain-py3/utils.py", line 181, in contact_matrix_from_hic
c = cooler.Cooler(f'{hic_norm}')
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/api.py", line 85, in init
self._refresh()
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/api.py", line 89, in _refresh
with open_hdf5(self.store, **self.open_kws) as h5:
File "/home/micromamba/envs/diffDomain3/lib/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/util.py", line 525, in open_hdf5
fh = h5py.File(fp, mode, *args, **kwargs)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/h5py/_hl/files.py", line 427, in init
swmr=swmr)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/h5py/_hl/files.py", line 190, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/micromamba/envs/diffDomain3/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "diffdomains.py", line 59, in comp2domins_by_twtest_parallel
fhic0=opts[''], fhic1=opts[''],min_nbin=int(opts['--min_nbin']),f=opts['--f'])
File "/diffDomain/diffdomain-py3/utils.py", line 338, in comp2domins_by_twtest
mat0 = contact_matrix_from_hic(chrn, start, end, reso, fhic0, hicnorm)
File "/diffDomain/diffdomain-py3/utils.py", line 181, in contact_matrix_from_hic
c = cooler.Cooler(f'{hic_norm}')
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/api.py", line 85, in init
self._refresh()
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/api.py", line 89, in _refresh
with open_hdf5(self.store, **self.open_kws) as h5:
File "/home/micromamba/envs/diffDomain3/lib/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/cooler/util.py", line 525, in open_hdf5
fh = h5py.File(fp, mode, *args, **kwargs)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/h5py/_hl/files.py", line 427, in init
swmr=swmr)
File "/home/micromamba/envs/diffDomain3/lib/python3.6/site-packages/h5py/_hl/files.py", line 190, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (file signature not found)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "diffdomains.py", line 76, in
result.append(i.get())
File "/home/micromamba/envs/diffDomain3/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
OSError: Unable to open file (file signature not found)

Any help will be highly appreciated!
Thanks :)

@Tian-Dechao
Copy link
Owner

We have not encountered similar issue before. It might be due to file corruption, see a link here.

I would recommend double check the cool files. By default, diffDomain does parallel computation with 10 thread, first can try using only one thread by setting --ncore at 1.
python diffdomains.py dvsd multiple /data/T1_10000.cool /data/T2_10000.cool /data/TADS_DM.bed --reso 10000 --ncore 1

Alternatively, try run basic analysis with the cool files say call TADs with other tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants