diff --git a/README.md b/README.md index 29005b2..b7243ae 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ Read5 is a python wrapper to read fast5, slow5/blow5 and pod5 files using the same overloaded functions from different APIs. [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-teal.svg)](https://www.gnu.org/licenses/gpl-3.0) -![Python3](https://img.shields.io/badge/Language-Python_3-darkred.svg) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/read5) -[![PyPI version](https://badge.fury.io/py/read5.svg)](https://badge.fury.io/py/read5) +[![PyPI version](https://badge.fury.io/py/read5.svg)](https://badge.fury.io/py/read5) ![PyPI - Downloads](https://img.shields.io/pypi/dm/read5) ![PyPI - Status](https://img.shields.io/pypi/status/read5) - + +[![Anaconda-Server Badge](https://anaconda.org/jannessp/read5/badges/version.svg)](https://anaconda.org/jannessp/read5) ![Conda](https://img.shields.io/conda/dn/jannessp/read5) [![Conda package](https://anaconda.org/jannessp/read5/badges/latest_release_date.svg)](https://anaconda.org/jannessp/read5) [![Conda package](https://anaconda.org/jannessp/read5/badges/platforms.svg)](https://anaconda.org/jannessp/read5) [![DOI](https://zenodo.org/badge/633012569.svg)](https://zenodo.org/badge/latestdoi/633012569) @@ -20,12 +21,18 @@ ___ ___ ## Installation -Pod5 is not available via conda (27.06.2023). -Read5 Currently available via pipy. - +### Pypi/pip ```bash pip install read5 ``` +### Conda +Pod5 is currently not available via conda (27.06.2023). Please install it using pip in your conda environment. +```bash +conda install mamba +mamba create -n read5 -c jannessp read5 +conda activate read5 +pip install pod5 # needed as no pod5 conda package available yet +``` ___ ## Usage @@ -33,7 +40,7 @@ ___ *my_file* can be a fast5, slow5, blow5 or pod5 file. The wrapper detects the file format depending on the file extension. -Small example: +### Small example: ```python from read5 import read # or from read5.Reader import read @@ -49,6 +56,7 @@ for readid in r5: readid_list = r5.getReads() ``` +### File Reader Classes If you want to use the file readers you can import the corresponding class like this: ```python @@ -57,6 +65,21 @@ from read5.Slow5Reader import Slow5Reader # contains the Slow5 Reader class from read5.Pod5Reader import Pod5Reader # contains the Pod5 Reader class ``` +### Abstract File Reader Class + +```python +from read5.AbstractFileReader import AbstractFileReader +``` + +### Possible Exceptions + +```python +from read5.Exceptions import UnknownFileFormatException, UnknownNormalizationMode +``` + +- UnknownFileFormatException: is raised, when the file extension does not match one of ['.fast5', '.slow5', '.blow5', 'pod5'] +- UnknownNormalizationMode: is raised, when an unknown mode is provided for the signal normalization function + ## Full Documentation Created with [pdoc3](https://pdoc3.github.io/pdoc/). Can be found [here](https://jannessp.github.io/read5.github.io/). diff --git a/conda.recipe/README.md b/conda.recipe/README.md index 7d09869..1c46c79 100644 --- a/conda.recipe/README.md +++ b/conda.recipe/README.md @@ -1,5 +1,5 @@ # Run ```bash -conda mambabuild conda.recipe/ --variants "{python: [3.8, 3.9, 3.10, 3.11]}" +conda mambabuild conda.recipe/ conda convert --platform osx-64 /path/to/package.tar.bz2 -o outputdir/ ``` \ No newline at end of file diff --git a/conda.recipe/conda_build_config.yaml b/conda.recipe/conda_build_config.yaml new file mode 100644 index 0000000..32b2d29 --- /dev/null +++ b/conda.recipe/conda_build_config.yaml @@ -0,0 +1,4 @@ +python: + - 3.8 + - 3.9 + - 3.10 \ No newline at end of file diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index ea345d4..ed9b27b 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -10,29 +10,31 @@ source: build: # If the installation is complex, or different between Unix and Windows, use # separate bld.bat and build.sh files instead of this key. Add the line - skip: true # [py<38] - skip: true # [win] + # skip: true # [py<38] + # skip: true # [win] script: {{ PYTHON }} -m pip install --no-deps --ignore-installed -v . + # script: python3 setup.py sdist bdist_wheel requirements: host: - - python>=3.8 + - python - pip - - setuptools run: - - python>=3.8 - # dependencies are defined in setup.py - {% for dep in data['install_requires'] %} - - {{ dep.lower() }} - {% endfor %} + - python + - pyslow5 >=1.0 + - numpy >=1.20 + - h5py >=3.8 + - ont_vbz_hdf_plugin >=1.0 + # - pod5 >=0.2.3 # currently not available in conda -# TODO: Activate tests when pod5 is available via conda! +# TODO enable when pod available via conda # test: # source_files: # - tests +# imports: +# - read5 # requires: # - pytest -# - pytest-cov # commands: # - pytest @@ -42,4 +44,8 @@ about: license: {{ data['license'] }} license_file: LICENSE doc_url: https://github.com/JannesSP/read5.github.io - dev_url: {{ data['url'] }} \ No newline at end of file + dev_url: {{ data['url'] }} + +extra: + recipe-maintainers: + - JannesSP \ No newline at end of file diff --git a/pipy.sh b/pipy.sh new file mode 100644 index 0000000..044b31e --- /dev/null +++ b/pipy.sh @@ -0,0 +1,3 @@ +python3 -m pip install --user --upgrade setuptools wheel +python3 setup.py sdist bdist_wheel +twine upload dist/* \ No newline at end of file diff --git a/setup.py b/setup.py index 4fa2074..a99493b 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,23 @@ from setuptools import setup, find_packages import versioneer +# conda +# requirements = [ +# 'python', +# 'h5py>=3.8', +# 'ont_vbz_hdf_plugin>=1.0', +# 'pyslow5>=1.0.0', +# 'numpy>=1.20', +# ] + +# pipy requirements = [ - # package requirements go here + 'python>=3.8,<3.11', 'h5py>=3.0', - # 'ont_vbz_hdf_plugin>=1.0', - 'vbz-h5py-plugin>=1.0', # same as ont_vbz but in pipy - 'pyslow5>=1.0', - 'numpy', - 'pod5>=0.2.3', # currently only avaible via pipy + 'vbz-h5py-plugin>=1.0', + 'pyslow5>=1.0.0', + 'numpy>=1.20', + 'pod5>=0.2.3', ] with open("README.rst", "r") as rst: @@ -28,12 +37,14 @@ install_requires=requirements, keywords=['read5', 'slow5', 'blow5', 'fast5', 'pod5', 'ONT', 'Oxford Nanopore Technologies', 'Nanopore', 'raw data', 'wrapper'], classifiers=[ + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Natural Language :: English', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', + 'Topic :: Scientific/Engineering :: Bio-Informatics', ] ) \ No newline at end of file