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

h5py KeyError exception with clodius 0.9.4 #35

Open
alexpreynolds opened this issue Nov 2, 2018 · 0 comments
Open

h5py KeyError exception with clodius 0.9.4 #35

alexpreynolds opened this issue Nov 2, 2018 · 0 comments

Comments

@alexpreynolds
Copy link
Contributor

Running clodius version 0.9.4 within a conda virtual environment raised the following error when doing bedfile-to-multivec conversion:

Traceback (most recent call last):
  File "/home/areynolds/.conda/envs/clodius/bin/clodius", line 11, in <module>
    sys.exit(cli())
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/clodius/cli/convert.py", line 275, in bedfile_to_multivec
    format, row_infos_filename, tile_size, method)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/clodius/cli/convert.py", line 162, in _bedgraph_to_multivec
    row_infos=row_infos)
  File "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/clodius/multivec.py", line 142, in create_multivec_multires
--More--(70%) 
    print("array_data:", array_data['segment1'][-20:])
  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 "/home/areynolds/.conda/envs/clodius/lib/python3.6/site-packages/h5py/_hl/group.py", line 177, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  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/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'segment1' doesn't exist)"

While multivec conversion failed, a test aggregation of a small BED file did not fail (clodius aggregate bedfile etc.). I did not try other dataset types.

Here is the conversion environment setup and breakdown, where I'm using defaults of what pip makes available:

>&2 echo "CREATE ${ENVIRONMENT}"
conda create -n ${ENVIRONMENT} python=3.6 --no-default-packages --yes

--More--(42%) 
>&2 echo "ACTIVATE ${ENVIRONMENT}"
source activate ${ENVIRONMENT}

>&2 echo "INSTALL ${ENVIRONMENT}"
pip install --upgrade pip
pip install --ignore-installed numpy
pip install --ignore-installed scipy
pip install --ignore-installed h5py
pip install clodius

clodius convert -h

clodius convert bedfile-to-multivec ${RWD}/data/E001.bed.gz \
    --assembly ${ASSEMBLY} \
    --starting-resolution ${RESOLUTION} \
    --row-infos-filename ${RWD}/data/${ASSEMBLY}.${STATES}.txt \
    --num-rows ${STATES} \
    --format epilogos

>&2 echo "DEACTIVATE ${ENVIRONMENT}"
source deactivate ${ENVIRONMENT}

>&2 echo "REMOVE ${ENVIRONMENT}"
conda remove -n ${ENVIRONMENT} --all --yes

This script installed the following libraries (among other dependencies):

h5py-2.8.0
numpy-1.15.3
scipy-1.1.0

Reverting to version 0.9.3 of clodius and specifying older versions of h5py and numpy dependencies seemed to resolve this issue (I also specified scipy, even though it is current with the default):

...
pip install --ignore-installed numpy==1.12.0
pip install --ignore-installed scipy==1.1.0
pip install --ignore-installed h5py==2.6.0
pip install clodius==0.9.3
...

I was able to generate multivec output from this combination of packages.

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