Skip to main content

Read and write FASTA and FASTQ files efficiently

Project description

GitHub Actions badge PyPI badge Codecov badge

dnaio processes FASTQ and FASTA files

dnaio is a Python 3.7+ library for very efficient parsing and writing of FASTQ and also FASTA files. 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.

Features and supported file types

  • FASTQ input and output

  • FASTA input and output

  • Compressed input and output (.gz, .bz2 and .xz, 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 parsing is the focus of this library. The FASTA parser is not as optimized.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dnaio-1.0.0.tar.gz (46.7 kB view details)

Uploaded Source

Built Distributions

dnaio-1.0.0-cp311-cp311-win_amd64.whl (76.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

dnaio-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (96.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dnaio-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl (80.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dnaio-1.0.0-cp310-cp310-win_amd64.whl (76.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

dnaio-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (95.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dnaio-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl (80.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dnaio-1.0.0-cp39-cp39-win_amd64.whl (77.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

dnaio-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (96.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dnaio-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl (80.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

dnaio-1.0.0-cp38-cp38-win_amd64.whl (77.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

dnaio-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (96.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dnaio-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (81.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

dnaio-1.0.0-cp37-cp37m-win_amd64.whl (76.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

dnaio-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (95.3 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

dnaio-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (79.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file dnaio-1.0.0.tar.gz.

File metadata

  • Download URL: dnaio-1.0.0.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0.tar.gz
Algorithm Hash digest
SHA256 528a5dc409f29eed947a1c86f2043bed3e8a72c1fe4f8426a8b5ab59aeaa0155
MD5 4bc6d690609a2875f5eef1a23fa967ea
BLAKE2b-256 a22175b44c3ae3ac2f31d7bd8f2a394b37f442774df306d442f13b40867cd569

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 76.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3a3c1dbe52f7bef61b6ab94701f7b6d39b3d7446621dfaf693a62361d5db7974
MD5 4adadaab9a0af6ffa253cc64c80444ad
BLAKE2b-256 a84b5f890f5215ab3d1ff4fe10a532f8d3bf171f0d1cbaef08380a0b1a4545ef

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 336615b179b026df1149d9441ee76993816c8616168f4cef5a99ca682c63eae7
MD5 9a544712539ae4e11ddd3a01a864f043
BLAKE2b-256 0d3307ae7969946b9dfcfa985aa990a12962d526dee57c8286e0836d54c7c681

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d89e16a2191450ca26cabc8b3ce0fea32964d82c9bcd041c3f0eff52009da2b7
MD5 f9d22a638767a4e114b0aad97e48bbbc
BLAKE2b-256 335df2e9f43f596e253ed49917aa2c0ecf6d40004c028842a2aff371221ae66a

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 76.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 80cfca072bd9d1b363df61f6db0258a488054322687caa83e5eae51202ff6e4f
MD5 05e02fb2320a0aefadd9400194a259bd
BLAKE2b-256 c0ea4167a51fe9123caeba27e69b4ff4372ed55a28333dac998ca69d1732a965

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a270d859f5a4cc6c1916fa36cb4b7be622e08d5fb51f644e6f7c07c7df7b60c
MD5 d898efbe05c2cce4a7305ac31a9a5ad1
BLAKE2b-256 0ad05abf0db868bcd2b1ca44f5949db8ef639ec7d61b6e00b80f632eea76d578

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 486d2497b4c8f82adcdfe50e713904edcc0af9cfd54eb19f962306bf28665fb8
MD5 cf5e9e214f506f3e9404485e28f04c9c
BLAKE2b-256 9b2086e05b958170e8f30a00ab3bb04ef167c285c0803099dd30939eb2ba1477

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.0.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 77.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f58920819a2306b971a37a470e28fcff027d45b7aca91cacfea06c1bfb8deff0
MD5 e511783ab41b49606d67b141e92039c4
BLAKE2b-256 bafcadc78af38fdb0d7d8fb8b134a55e3352f371b8b251de8d985e09b36fab3d

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cef4302f3d7906bcead0f1c3a961a2d4afc7a3320311f70521235b2de193c5b
MD5 36277c337485515817fcd38769b69549
BLAKE2b-256 fde1185f8745943f75ce8442b511c5a1e2a15cee3f05d3c721f3a70fcfa9c513

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 659ea714fed1ea3f89e5276c496119a2172de538ab335f1cf7f39af23f0c91d4
MD5 d6eae58bcbe52b2430d25f435d75e0af
BLAKE2b-256 f71737eec70c3bddd57b406bb43f8655e3169f9aa419eb782dc9eba79bad914d

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.0.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 77.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 97710149d6eb8e875af22776a4a7e3f6a13a8e43e2d721169eb646a4c1f4ee77
MD5 e14b6e53e441dc61e46383b8cbdaabc3
BLAKE2b-256 6dafed6412c1d5a64c72c6033bab92f8ac2ee7e546d59997e3149b24b41fae4f

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3dfcb80aaff34afb019867fe68cb9360d1e7f78045750bb4667fcc43144e54e4
MD5 cad3620d4cb2282c394c9a8bdb748f73
BLAKE2b-256 fd67ba8550c14bfe507ac22f4d1072b46329d5d5d97636cee24d63684b26c50d

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4e775ed2833f3d973d049d2629cdde9ea762e1b42b63244b4bebaa85cab7a995
MD5 4be383fd95441cc40312cf5ee1e7a1b8
BLAKE2b-256 a0aec0f66c61896fa168a2b7ad2cfff936d662cacd3335998c03900bc0387eeb

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.0.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 bc3ebcee4960a4f93bc63d232bd2ac357a1cb0b2464342d3af0eb302bfcd64b5
MD5 b164bc71d19f38c41f965e8a6858ce4b
BLAKE2b-256 3fa56fad30473254d9812e929eb5062b3a20b836862ac6507d107f2b8a96d3cc

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98b4e432e0ccf27c67e036c64daac7c9832a7e40a5da50962aabe039df52c723
MD5 c0caa9bf801eb5c7a5c8c291c0cdc084
BLAKE2b-256 013fffb92746bc3a1b710bca9e7d537516c757ec122f4bf1739624dd0a6a675a

See more details on using hashes here.

File details

Details for the file dnaio-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6eb5589b41ea5a8446548b858ad0e98fd54fd31bf6e38601f5de3034a804cda7
MD5 b2d5a4b28b77b6e97ff594704f5175d1
BLAKE2b-256 37c4d4c8c1fece63727f526a9f477daa28ebc7f3f4a487d732ad0750abd72d2c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page