Skip to content

Added sequences to a total of 0 reads: incompatibility problem with h5py in bioconda version #461

Description

@waltergallegog

Just leaving this here as it might help someone in the future still using tombo and having issues with the command tombo preprocess annotate_raw_with_fastqs resulting in Added sequences to a total of 0 reads.

When installing tombo from bioconda, the h5py version installed will be 3.7.

With this version, the annotate command does not work, because in version 3.7 of h5py, the default opening mode is readonly, and the tombo version in bioconda does not explicitly specify the opening mode to be read/write.

Instead, when installing tombo from sources, the following dependencies are set in the setup.py file:

    install_requires = ['h5py < 3', 'numpy < 1.20', 'scipy', 'cython',
                        'setuptools >= 18.0', 'mappy >= 2.10', 'future', 'tqdm'],

Which results in h5py version 2.10.
With this version, the annotate command works as expected, because in this version of h5py, the default opening mode is read/write.
See:
https://docs.h5py.org/en/stable/whatsnew/2.10.html#deprecations

To me the following is working

conda create -n tomboenv -c bioconda ont-tombo
conda activate tomboenv
pip install h5py==2.10

Note that using the annotate command will give the following warning:

[22:22:18] Preparing reads and extracting read identifiers.
/opt/conda/envs/tombocon/lib/python3.7/site-packages/tombo/_preprocess.py:378: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details.
  with h5py.File(fast5_fn) as fast5_data:

Because in line 378, the file is being opened without indicating the mode (note that in the sources, it has actually been changed to '+r', but this changes has not made it to the bioconda version).

        try:
            with h5py.File(fast5_fn) as fast5_data:

Therefore without downgrading h5py, you can also modify the python source in your env to add the '+r' option. In any case given that in the setup.py the version is pinned to < 3, I guess the preferable solution is to downgrade h5py in the conda env.

@marcus1487 it seems to me these issues have already been addressed in the latest commits of the repo, but are not included in the latest release, that bioconda is fetching. Even tough this repo is deprecated, I still see some people using it, maybe is worth it if you update the release / bioconda recipe as well?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions