You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an error when trying to open a d4 matrix in pyd4:
OSError: memory map must have a non-zero length
I have tried remaking the input file a few times but I keep getting this error. Interestingly if I use the command line tool d4tools I get no error accessing the same region. I have also used the python code successfully on three other samples but it is failing here, so I am at a bit of a loss.
I include details and inputs below, thanks in advance!
Details:
Here is a full traceback of the error
python test.d4.py
Traceback (most recent call last):
File "/mmfs1/gscratch/stergachislab/mvollger/projects/GM12878_aCRE_2022-08-16/test.d4.py", line 14, in <module>
matrix["chr1", 0, 1000]
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 100, in __getitem__
data = [track[key] for track in self.tracks]
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 100, in <listcomp>
data = [track[key] for track in self.tracks]
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 430, in __getitem__
return self.load_to_np(key)
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 513, in load_to_np
return self._for_each_region(regions, load_to_np_impl)
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 454, in _for_each_region
ret.append(func(name, begin, end))
File "/mmfs1/gscratch/stergachislab/mvollger/miniconda3/envs/fiberseq-smk/lib/python3.9/site-packages/pyd4/__init__.py", line 507, in load_to_np_impl
self.load_values_to_buffer(name, begin, end, buf_addr)
OSError: memory map must have a non-zero length
But when I access the same region with d4tools it works fine:
Thanks for reporting the issue, it seems this is a bug related to the mapped IO interface. The reason why d4tools view doesn't have this issue is because d4tools view uses the streamed IO. I've committed a potential fix to the repo, please let me know if the latest commit solved your issue.
Hi @38 and @arq5x,
I am getting an error when trying to open a d4 matrix in pyd4:
I have tried remaking the input file a few times but I keep getting this error. Interestingly if I use the command line tool d4tools I get no error accessing the same region. I have also used the python code successfully on three other samples but it is failing here, so I am at a bit of a loss.
I include details and inputs below, thanks in advance!
Details:
Here is a full traceback of the error
But when I access the same region with
d4tools
it works fine:Here is a link to the file:
https://eichlerlab.gs.washington.edu/help/mvollger/tracks/fiberseq/fdr.coverages.d4
and here is the python code I have that gives the error:
The text was updated successfully, but these errors were encountered: