fanglab / mbin

mBin: a methylation-based binning framework for metagenomic SMRT sequencing reads
Other
25 stars 3 forks source link

error message : h5py.h5py_warnings.H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead. #8

Closed lconan closed 5 years ago

lconan commented 5 years ago

Description

While trying to extract control IPDs with buildcontrols, get an error message : h5py.h5py_warnings.H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead. I don't really know how to deal with it. I thought it, again, is some kind of version problem, but I'm not able to recognize. I googled for this error message, but got nothing useful.

What I Did

`(venv)` [yx@localhost data]$ buildcontrols -i --procs=4 --control_pkl_name=control.pkl aligned_reads.cmp.h5
2019-02-01 16:58:55 [INFO] Initiating dictionary of all possible motifs...
2019-02-01 16:58:55 [INFO]   - Adding 256 4-mer motifs...
2019-02-01 16:58:55 [INFO] Done: 256 possible contiguous motifs

2019-02-01 16:58:55 [INFO]   - Adding 1024 5-mer motifs...
2019-02-01 16:58:55 [INFO] Done: 1536 possible contiguous motifs

2019-02-01 16:58:55 [INFO]   - Adding 4096 6-mer motifs...
2019-02-01 16:58:55 [INFO] Done: 7680 possible contiguous motifs

2019-02-01 16:58:55 [INFO]   - Adding bipartite motifs to search space...
2019-02-01 16:58:56 [INFO] Done: 194560 possible bipartite motifs

2019-02-01 16:58:56 [INFO] 
2019-02-01 16:58:56 [INFO] Preparing to create new control data in ctrl_tmp
Traceback (most recent call last):
  File "/data2/Software/virtualenv_for_mbin/venv/bin/buildcontrols", line 10, in <module>
    sys.exit(launch())
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/mbin/controls.py", line 20, in launch
    extract_controls(opts, control_aln_fn)
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/mbin/controls.py", line 40, in extract_controls
    opts           = controls.scan_WGA_aligns()
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/mbin/controls.py", line 352, in scan_WGA_aligns
    reader = openIndexedAlignmentFile(self.control_aln_fn)
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/pbcore/io/opener.py", line 52, in openIndexedAlignmentFile
    return CmpH5Reader(fname, sharedIndex=sharedIndex)
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/pbcore/io/align/CmpH5IO.py", line 729, in __init__
    self._loadAlignmentInfo(sharedIndex)
  File "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/pbcore/io/align/CmpH5IO.py", line 745, in _loadAlignmentInfo
    rawAlignmentIndex = self.file["/AlnInfo/AlnIndex"].value
  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 "/data2/Software/virtualenv_for_mbin/venv/lib/python2.7/site-packages/h5py/_hl/dataset.py", line 313, in value
    "Use dataset[()] instead.", H5pyDeprecationWarning)
h5py.h5py_warnings.H5pyDeprecationWarning: dataset.value has been deprecated. Use dataset[()] instead.
lconan commented 5 years ago

I checked python version. It's 3.6~I'm using virtualenv~any chance it will change python version itself?

lconan commented 5 years ago

I replace every *.value with "[()] " in CmpH5IO.py in line 745, 768, 831, as prompt. And finally got this work.

jbeaulaurier commented 5 years ago

Awesome, glad to hear that you were able to find the source of the problem. I'm afraid that cmph5IO library is no longer being maintained, so I'm not surprised that issues like this pop up when using more recent Python and h5py releases.