Skip to content

Commit

Permalink
Fixed Imports of Conda Package
Browse files Browse the repository at this point in the history
  • Loading branch information
JannesSP committed Jul 12, 2023
1 parent 03f5b14 commit a6f8add
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 27 deletions.
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- ![conda](https://img.shields.io/badge/Uses-conda-green.svg) [![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) -->

[![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)

Expand All @@ -20,20 +21,26 @@ ___
___
## 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

[Click here to see a full documentation about the classes and function.](https://jannessp.github.io/read5.github.io/)

*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
Expand All @@ -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
Expand All @@ -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/).
2 changes: 1 addition & 1 deletion conda.recipe/README.md
Original file line number Diff line number Diff line change
@@ -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/
```
4 changes: 4 additions & 0 deletions conda.recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python:
- 3.8
- 3.9
- 3.10
30 changes: 18 additions & 12 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -42,4 +44,8 @@ about:
license: {{ data['license'] }}
license_file: LICENSE
doc_url: https://github.com/JannesSP/read5.github.io
dev_url: {{ data['url'] }}
dev_url: {{ data['url'] }}

extra:
recipe-maintainers:
- JannesSP
3 changes: 3 additions & 0 deletions pipy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python3 -m pip install --user --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel
twine upload dist/*
25 changes: 18 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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',
]
)

0 comments on commit a6f8add

Please sign in to comment.