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

OverflowError: timeout value is too large #26

Open
alpha-1-centauri opened this issue Jun 24, 2023 · 1 comment
Open

OverflowError: timeout value is too large #26

alpha-1-centauri opened this issue Jun 24, 2023 · 1 comment

Comments

@alpha-1-centauri
Copy link

alpha-1-centauri commented Jun 24, 2023

I have encountered the following error when trying to generate differentially expressed regions as per documentation:

files_created = methylize.diff_meth_regions(test_results2, '450k', prefix='../data/asthma/dmr/')

INFO:methylprep.files.manifests:Reading manifest file: HumanMethylation450k_15017482_v3.csv
INFO:methylprep.files.manifests:Reading manifest file: HumanMethylation450k_15017482_v3.csv
ERROR:methylize.diff_meth_regions:Traceback (most recent call last):
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 856, in next
    item = self._items.popleft()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\site-packages\methylize\diff_meth_regions.py", line 149, in diff_meth_regions
    results = _pipeline(kw['col_num'], kw['step'], kw['dist'],
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\site-packages\methylize\diff_meth_regions.py", line 296, in _pipeline
    putative_acf_vals = methylize.cpv.acf(bed_files, lags, col_num0, simple=False,
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\site-packages\methylize\cpv\acf.py", line 101, in acf
    for chrom_acf in imap(_acf_by_chrom, arg_list):
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\site-packages\toolshed\pool.py", line 31, in wrap
    return func(self, timeout=timeout or 1e8)
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 861, in next
    self._cond.wait(timeout)
  File "c:\Users\adams\AppData\Local\Programs\Python\Python310\lib\threading.py", line 324, in wait
    gotit = waiter.acquire(True, timeout)
OverflowError: timeout value is too large

ERROR:methylize.diff_meth_regions:timeout value is too large
ERROR:methylize.diff_meth_regions:Other/.fdr.bed.gz: [Errno 2] No such file or directory: 'Other/.fdr.bed.gz'
ERROR:methylize.diff_meth_regions:Other/.slk.bed.gz: [Errno 2] No such file or directory: 'Other/.slk.bed.gz'

I am working with Python 3.10 on a Windows 11 machine.

@alpha-1-centauri
Copy link
Author

I managed to fix the error by changing the timeout value in toolshed.pool to 1e6. Not sure why this was not working on my system and worked on others' though...

# from aljunberg:  https://gist.github.com/aljungberg/626518
from multiprocessing.pool import IMapIterator
def wrapper(func):
    def wrap(self, timeout=None):
        return func(self, timeout=1e6) #changed to 1e6 instead of  timeout=timeout or 1e8 which resulted in OverflowError
    return wrap
import sys
if sys.version_info[0] < 3:
    IMapIterator.next = wrapper(IMapIterator.next)
else:
    IMapIterator.__next__ = wrapper(IMapIterator.__next__)

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

1 participant