dnaio processes FASTQ, FASTA and uBAM files
dnaio is a Python 3 library for very efficient parsing and writing of FASTQ and also FASTA files. Since dnaio version 1.1.0, support for efficiently parsing uBAM files has been implemented. This allows reading ONT files from the dorado basecaller directly.
The code was previously part of the Cutadapt tool and has been improved significantly since it has been split out.
Example usage
The main interface is the dnaio.open function:
import dnaio
with dnaio.open("reads.fastq.gz") as f:
bp = 0
for record in f:
bp += len(record)
print(f"The input file contains {bp/1E6:.1f} Mbp")
For more, see the tutorial and API documentation.
Installation
Using pip:
pip install dnaio zstandard
zstandard can be omitted if support for Zstandard (.zst) files is not required.
Features and supported file types
FASTQ input and output
FASTA input and output
BAM input
Compressed input and output (.gz, .bz2, .xz and .zst are detected automatically)
Paired-end data in two files
Interleaved paired-end data in a single file
Files with DOS/Windows linebreaks can be read
FASTQ files with a second header line (after the +) are supported
Limitations
Multi-line FASTQ files are not supported
FASTQ and uBAM parsing is the focus of this library. The FASTA parser is not as optimized
Links
Metadata
Release files for dnaio 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dnaio-1.2.4.tar.gz | 60.4 kB | Details |
Built distributions (wheels)
Total release size: 1.7 MB
Release files / dnaio-1.2.4.tar.gz
| Download URL | dnaio-1.2.4.tar.gz |
|---|---|
| Size | 60.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7570311f29e8b3c1ea39a60f57b7baf8dad8f2508595c58d4278c5571463166
|
|
BLAKE2b-256 checksum How to use checksums |
a9f23b4d7f4ac4fc25742fde4c5b50ed1bc60ab731cf8cabd3089dd11e4ea1c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314t-win_amd64.whl
| Download URL | dnaio-1.2.4-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 94.4 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a0dbcdddd14d946a03f4ad617d3b4630808295eecd9a38f670786675a8059606
|
|
BLAKE2b-256 checksum How to use checksums |
178de545eb8680442e78e016e57ae82f50ce062efc56275ffd16c284cbbebd72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 105.9 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c8a8e1cba7ba300c48f4dda78c1d5dd2402762aa3454c0fcbd46d0d487d0df22
|
|
BLAKE2b-256 checksum How to use checksums |
d1ce82036b1bdba0a4284da08a62af85b952095dcad97e7a1d2c0e4843c49d44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 90.6 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
87e1a2eaf55a9bdbf3f3ee0b7fb0b9fc94ced8b226023dc3db300dbee26b8e39
|
|
BLAKE2b-256 checksum How to use checksums |
8dc833dbd77f8c6dd3bd6a6c7473a2f9d5b70c8c1d50529750a3e82e013eab36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314-win_amd64.whl
| Download URL | dnaio-1.2.4-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 81.8 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f620efbe299f6a32218e2eba36d1f550cf10eacbe7a42d9c590a7e6ac220980f
|
|
BLAKE2b-256 checksum How to use checksums |
d13ab1f2095d7950679b7018edac59465fc0dff1493e8542f8c0644351716a95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 106.1 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d176d4127c05cb808b956e05d3939edfc436f89671e62488fcb05b887cf57e7e
|
|
BLAKE2b-256 checksum How to use checksums |
c187383393bcf0ee017f147054731d4f09dd4319e86c7ab037b7e6e3477fdf45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 86.4 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5cef3a9aff9a240a51fea13571f1efcf0c7a4f9a4878bdda8a362a95d529befe
|
|
BLAKE2b-256 checksum How to use checksums |
4319fe78c25785d293932b54c73ed6833538f8a541e4ebd25c14a0f56bda359f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp313-cp313-win_amd64.whl
| Download URL | dnaio-1.2.4-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 80.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c14c75b890a21559b416e77a82dad078ff73fb4e05e39b4b45ee0f315b455063
|
|
BLAKE2b-256 checksum How to use checksums |
fbe98508eeadb3573e4c6008d78cec006aa9f9615a16262fd25b7dbaa3775ed6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 105.5 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
660f84e462a9db574180b47cdf0bb7cb40b33842b86eec93f5c0e3c1b8df0d08
|
|
BLAKE2b-256 checksum How to use checksums |
99debd4f173510ada57e874955dfae42051a6155b8297d5f7c0135bfe454106b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 85.1 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
264c11503c41934f2d8fe97fdd67ffb508081a424a576cac576ec3a4dfa2c41f
|
|
BLAKE2b-256 checksum How to use checksums |
10a82bff6f94930f4307f7488cc0f36e13cff20b26ff0ce90f8ca3d7569956fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp312-cp312-win_amd64.whl
| Download URL | dnaio-1.2.4-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 80.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
791bf2a1d377933c84b1e3c22d1b4b39608a85a17f613ce006256df267a28d69
|
|
BLAKE2b-256 checksum How to use checksums |
df315aaa21f15ea149d9b95ab0c555abc29841b9209d93d5536065ef8684f47d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 106.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5deda100d355f5275948d1863a199996a1a22077f147ca99514c24de87588250
|
|
BLAKE2b-256 checksum How to use checksums |
b399a041618c65bf31c1d8c5fd966aad0e7a9e86c43624743c62bbb4a944d106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 85.7 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a55541a857fa1329cf600890ecedc605fa6963268500b1fcf5ee51d6c3c57cdc
|
|
BLAKE2b-256 checksum How to use checksums |
8ba04ddde293003c52256ce8e80a797e08467e9550d7487af8b6a7d76c7b2356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp311-cp311-win_amd64.whl
| Download URL | dnaio-1.2.4-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 81.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ebac5241acfb9a391562ee1b7f9ae6857fbfd22411c73077a25d8f011957fc3c
|
|
BLAKE2b-256 checksum How to use checksums |
b802b236c8aeb2e3d11d1a4f239977e7f541ee84c1bc2175be2176da8b60a65f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 106.9 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8355670a175d96714f0ed693dbb64b79f1abe52f2b852c37459ce5cbdbd734ec
|
|
BLAKE2b-256 checksum How to use checksums |
3e16e627a013e7624bdd76df644ed2b146d4a15c18a2a8946a1db0cc306a3846
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 86.5 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
33c66997f160e848bea8357632d4b230eb57e986b349573cb4acdbb68ddd3d0f
|
|
BLAKE2b-256 checksum How to use checksums |
100e8683f546df26000b1e79bbe480dbeb997ef19a854391f148907592779f31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp310-cp310-win_amd64.whl
| Download URL | dnaio-1.2.4-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 81.1 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1274bf0940757f977c81474bfcc74668795da9ec10d0bddaef281d8a178b6233
|
|
BLAKE2b-256 checksum How to use checksums |
5a60be168dec299e33cd3ec7a8d2fa67127d3bfc3c1a1d2353a9a1acddfde344
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dnaio-1.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 105.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6e348490366b0153e7b94abacb9eab4ea6c7e35245c74ab2bc564bbdea0a5c9f
|
|
BLAKE2b-256 checksum How to use checksums |
8242a04973947faedc3ed8a4c7dbb69b7c5ce824f68a61ee385b254605158763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / dnaio-1.2.4-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | dnaio-1.2.4-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 85.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
16b79adb559229663735394ad219a7a2b7c21f075326125e4a8f70d54cc07d1f
|
|
BLAKE2b-256 checksum How to use checksums |
89159ac0fd41330e0c68b93ecb0682a08bbb4efbd1a28b88f46856f94beb3770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|