Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JannesSP committed Nov 24, 2023
0 parents commit 7900f14
Show file tree
Hide file tree
Showing 33 changed files with 14,439 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cff-version: 1.2.1
message: "If you use this software, please cite it as below."
authors:
- family-names: "Spangenberg"
given-names: "Jannes"
orcid: "https://orcid.org/0000-0002-6126-411X"
title: "Read5"
version: 1.2.1
date-released: 2023-07-11
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

674 changes: 674 additions & 0 deletions LICENSE copy

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
graft tests
97 changes: 97 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# ![Alt text](figures/logo.png)

- **Read5** is a python wrapper to read fast5, slow5/blow5 and pod5 files using the same overloaded functions from different APIs. ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/read5)
- **Read5_ont** is a python wrapper to read fast5 and pod5 files using the same overloaded functions from different APIs. ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/read5_ont)

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-teal.svg)](https://www.gnu.org/licenses/gpl-3.0)

[![PyPI](https://img.shields.io/pypi/v/read5) ![PyPI - Downloads](https://img.shields.io/pypi/dm/read5) ![PyPI - Status](https://img.shields.io/pypi/status/read5)](https://pypi.org/project/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)

[![Twitter Follow](https://img.shields.io/twitter/follow/Ja_Spangenberg)](https://twitter.com/Ja_Spangenberg)
___
## Table of Content
1. [Installation](#installation)
2. [Usage](#usage)
3. [Full Documentation](https://jannessp.github.io/read5.github.io/)
___
## Installation

### Pypi/pip
```bash
pip install read5
# or
pip install read5_ont
```
### Conda
Pod5 is now available via [conda](https://anaconda.org/jannessp/pod5) (19.07.2023).

```bash
conda install mamba
mamba create -n read5 -c jannessp read5
conda activate read5
# or
mamba create -n read5_ont -c jannessp read5_ont
conda activate read5_ont
```
Alternatively you can create the environment using the [conda.recipe/env.yml](conda.recipe/env.yml) file.
```bash
conda install mamba
mamba env create -f conda.recipe/env.yml
conda activate read5
```
___
## 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:

```python
from read5 import read # or from read5.Reader import read

r5 = read(my_file) # file with on of these extensions: .fast5, .slow5, .blow5, .pod5
for readid in r5:
signal = r5.getSignal(readid) # returns raw integer values stored in the file
pA_signal = r5.getpASignal(readid) # returns pA signal
norm_signal = r5.getZNormSignal(readid) # returns normalised read signal: norm_signal = (signal - median(signal)) / mad(signal)
channel = r5.getChannelNumber(readid)
sampleid = r5.getSampleID(readid)
runid = r5.getRunID(readid)

readid_list = r5.getReads()
```

### File Reader Classes
If you want to use the file readers you can import the corresponding class like this:

```python
from read5.Fast5Reader import Fast5Reader # contains the Fast5 Reader class
from read5.Slow5Reader import Slow5Reader # contains the Slow5 Reader class - !not available in read5_ont!
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'] (or ['.fast5', '.pod5'] in **read5_ont**)
- 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/).
94 changes: 94 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Installation
------------

Pypi/pip
~~~~~~~~

.. code:: bash
pip install read5_ont
Conda
~~~~~

Pod5 is now available via `conda <https://anaconda.org/jannessp/pod5>`__ (19.07.2023).

.. code:: bash
conda install mamba
mamba create -n read5_ont -c jannessp read5_ont
conda activate read5_ont
Alternatively you can create the environment using the
`conda.recipe/env.yml <conda.recipe/env.yml>`__ file.

.. code:: bash
conda install mamba
mamba env create -f conda.recipe/env.yml
conda activate read5_ont
--------------

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 or pod5 file. The wrapper detects
the file format depending on the file extension.

Small example:
~~~~~~~~~~~~~~

.. code:: python
from read5 import read # or from read5.Reader import read
r5 = read(my_file) # file with on of these extensions: .fast5, .pod5
for readid in r5:
signal = r5.getSignal(readid) # returns raw integer values stored in the file
pA_signal = r5.getpASignal(readid) # returns pA signal
norm_signal = r5.getZNormSignal(readid) # returns normalised read signal: norm_signal = (signal - median(signal)) / mad(signal)
channel = r5.getChannelNumber(readid)
sampleid = r5.getSampleID(readid)
runid = r5.getRunID(readid)
readid_list = r5.getReads()
File Reader Classes
~~~~~~~~~~~~~~~~~~~

If you want to use the file readers you can import the corresponding
class like this:

.. code:: python
from read5.Fast5Reader import Fast5Reader # contains the Fast5 Reader class
from read5.Pod5Reader import Pod5Reader # contains the Pod5 Reader class
Abstract File Reader Class
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python
from read5.AbstractFileReader import AbstractFileReader
Possible Exceptions
~~~~~~~~~~~~~~~~~~~

.. code:: python
from read5.Exceptions import UnknownFileFormatException, UnknownNormalizationMode
- UnknownFileFormatException: is raised, when the file extension does
not match one of [‘.fast5’, ‘.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/>`__.
5 changes: 5 additions & 0 deletions conda.recipe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Run
```bash
conda mambabuild conda.recipe/
conda convert --platform osx-64 /path/to/package.tar.bz2 -o outputdir/
```
6 changes: 6 additions & 0 deletions conda.recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python:
- 3.8
- 3.9
- 3.10
- 3.11 # not with pyslow5 (has no 3.11 package)
# - 3.12 # not with pod5 (has no 3.12 package)
150 changes: 150 additions & 0 deletions conda.recipe/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: read5
channels:
- bioconda
- conda-forge
- defaults
- jannessp
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- aws-c-auth=0.7.0=hf8751d9_2
- aws-c-cal=0.6.0=h93469e0_0
- aws-c-common=0.8.23=hd590300_0
- aws-c-compression=0.2.17=h862ab75_1
- aws-c-event-stream=0.3.1=h9599702_1
- aws-c-http=0.7.11=hbe98c3e_0
- aws-c-io=0.13.28=h3870b5a_0
- aws-c-mqtt=0.8.14=h2e270ba_2
- aws-c-s3=0.3.13=heb0bb06_2
- aws-c-sdkutils=0.1.11=h862ab75_1
- aws-checksums=0.1.16=h862ab75_1
- aws-crt-cpp=0.20.3=he9c0e7f_4
- aws-sdk-cpp=1.10.57=hbc2ea52_17
- boltons=23.0.0=pyhd8ed1ab_0
- brotli=1.0.9=h166bdaf_9
- brotli-bin=1.0.9=h166bdaf_9
- brotli-python=1.0.9=py310hd8f1fbe_9
- bzip2=1.0.8=h7f98852_4
- c-ares=1.19.1=hd590300_0
- ca-certificates=2023.5.7=hbcca054_0
- cached-property=1.5.2=hd8ed1ab_1
- cached_property=1.5.2=pyha770c72_1
- certifi=2023.5.7=pyhd8ed1ab_0
- cffi=1.15.1=py310h255011f_3
- charset-normalizer=3.1.0=pyhd8ed1ab_0
- colorama=0.4.6=pyhd8ed1ab_0
- conda=23.5.0=py310hff52083_1
- conda-package-handling=2.0.2=pyh38be061_0
- conda-package-streaming=0.8.0=pyhd8ed1ab_0
- cryptography=41.0.1=py310h75e40e8_0
- exceptiongroup=1.1.1=pyhd8ed1ab_0
- fmt=9.1.0=h924138e_0
- gflags=2.2.2=he1b5a44_1004
- glog=0.6.0=h6f12383_0
- h5py=3.8.0=nompi_py310h0311031_100
- hdf5=1.12.2=nompi_h4df4325_101
- icu=72.1=hcb278e6_0
- idna=3.4=pyhd8ed1ab_0
- importlib-metadata=6.7.0=pyha770c72_0
- iniconfig=2.0.0=pyhd8ed1ab_0
- iso8601=2.0.0=pyhd8ed1ab_0
- jsonpatch=1.32=pyhd8ed1ab_0
- jsonpointer=2.0=py_0
- keyutils=1.6.1=h166bdaf_0
- krb5=1.20.1=h81ceb04_0
- ld_impl_linux-64=2.40=h41732ed_0
- lib-pod5=0.2.4=py310_0
- libabseil=20230125.3=cxx17_h59595ed_0
- libaec=1.0.6=hcb278e6_1
- libarchive=3.6.2=h039dbb9_1
- libarrow=11.0.0=h657c46f_30_cpu
- libblas=3.9.0=17_linux64_openblas
- libbrotlicommon=1.0.9=h166bdaf_9
- libbrotlidec=1.0.9=h166bdaf_9
- libbrotlienc=1.0.9=h166bdaf_9
- libcblas=3.9.0=17_linux64_openblas
- libcrc32c=1.1.2=h9c3ff4c_0
- libcurl=8.1.2=h409715c_0
- libedit=3.1.20191231=he28a2e2_2
- libev=4.33=h516909a_1
- libevent=2.1.12=hf998b51_1
- libffi=3.4.2=h7f98852_5
- libgcc-ng=13.1.0=he5830b7_0
- libgfortran-ng=13.1.0=h69a702a_0
- libgfortran5=13.1.0=h15d22d2_0
- libgomp=13.1.0=he5830b7_0
- libgoogle-cloud=2.12.0=h840a212_1
- libgrpc=1.56.2=h3905398_0
- libiconv=1.17=h166bdaf_0
- liblapack=3.9.0=17_linux64_openblas
- libmamba=1.4.5=h658169a_0
- libmambapy=1.4.5=py310h8aae740_0
- libnghttp2=1.52.0=h61bc06f_0
- libnsl=2.0.0=h7f98852_0
- libnuma=2.0.16=h0b41bf4_1
- libopenblas=0.3.23=pthreads_h80387f5_0
- libprotobuf=4.23.3=hd1fb520_0
- libsolv=0.7.24=hfc55251_1
- libsqlite=3.42.0=h2797004_0
- libssh2=1.11.0=h0841786_0
- libstdcxx-ng=13.1.0=hfd8a6a1_0
- libthrift=0.18.1=h8fd135c_2
- libutf8proc=2.8.0=h166bdaf_0
- libuuid=2.38.1=h0b41bf4_0
- libxml2=2.11.4=h0d562d8_0
- libzlib=1.2.13=hd590300_5
- lz4-c=1.9.4=hcb278e6_0
- lzo=2.10=h516909a_1000
- mako=1.2.4=pyhd8ed1ab_0
- mamba=1.4.5=py310h51d5547_0
- markdown=3.4.3=pyhd8ed1ab_0
- markupsafe=2.1.3=py310h2372a71_0
- more-itertools=9.1.0=pyhd8ed1ab_0
- ncurses=6.4=hcb278e6_0
- numpy=1.25.0=py310ha4c1d20_0
- ont_vbz_hdf_plugin=1.0.1=h3f9cce5_5
- openssl=3.1.1=hd590300_1
- orc=1.9.0=h385abfd_1
- packaging=23.1=pyhd8ed1ab_0
- pdoc3=0.8.1=py_0
- pip=23.2=pyhd8ed1ab_0
- pluggy=1.2.0=pyhd8ed1ab_0
- pod5=0.2.4=py310_0
- polars=0.17.14=py310hcb5633a_0
- pyarrow=11.0.0=py310he6bfd7f_30_cpu
- pybind11-abi=4=hd8ed1ab_3
- pycosat=0.6.4=py310h5764c6d_1
- pycparser=2.21=pyhd8ed1ab_0
- pyopenssl=23.2.0=pyhd8ed1ab_1
- pyslow5=1.0.0=py310h1ae98be_3
- pysocks=1.7.1=pyha2e5f31_6
- pytest=7.4.0=pyhd8ed1ab_0
- python=3.10.12=hd12c33a_0_cpython
- python_abi=3.10=3_cp310
- pytz=2023.3=pyhd8ed1ab_0
- rdma-core=28.9=h59595ed_1
- re2=2023.03.02=h8c504da_0
- readline=8.2=h8228510_1
- reproc=14.2.4=h0b41bf4_0
- reproc-cpp=14.2.4=hcb278e6_0
- requests=2.31.0=pyhd8ed1ab_0
- ruamel.yaml=0.17.32=py310h2372a71_0
- ruamel.yaml.clib=0.2.7=py310h1fa729e_1
- s2n=1.3.46=h06160fa_0
- setuptools=68.0.0=pyhd8ed1ab_0
- snappy=1.1.10=h9fff704_0
- tk=8.6.12=h27826a3_0
- tomli=2.0.1=pyhd8ed1ab_0
- toolz=0.12.0=pyhd8ed1ab_0
- tqdm=4.65.0=pyhd8ed1ab_1
- typing_extensions=4.7.1=pyha770c72_0
- tzdata=2023c=h71feb2d_0
- ucx=1.14.1=hf587318_2
- urllib3=2.0.3=pyhd8ed1ab_1
- wheel=0.40.0=pyhd8ed1ab_0
- xz=5.2.6=h166bdaf_0
- yaml-cpp=0.7.0=h27087fc_2
- zipp=3.15.0=pyhd8ed1ab_0
- zlib=1.2.13=hd590300_5
- zstandard=0.19.0=py310h1275a96_2
- zstd=1.5.2=h3eb15da_6
Loading

0 comments on commit 7900f14

Please sign in to comment.