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.8+ 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.

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 BAM 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.2.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distributions

dnaio-1.2.0-cp312-cp312-win_amd64.whl (85.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

dnaio-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (108.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

dnaio-1.2.0-cp312-cp312-macosx_10_9_x86_64.whl (93.6 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

dnaio-1.2.0-cp311-cp311-win_amd64.whl (85.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

dnaio-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (110.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dnaio-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl (93.1 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dnaio-1.2.0-cp310-cp310-win_amd64.whl (86.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

dnaio-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (110.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dnaio-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl (92.9 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dnaio-1.2.0-cp39-cp39-win_amd64.whl (86.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

dnaio-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (111.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dnaio-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl (93.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

dnaio-1.2.0-cp38-cp38-win_amd64.whl (86.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

dnaio-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (112.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dnaio-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl (92.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dnaio-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d0528c23516fe4e947970bdef33c423f0a30ab3b083bd4f6f049fd66d8cef803
MD5 4ebf1bc2e748c93d63ce36793de09671
BLAKE2b-256 5b45fe12f29d76add9e63290535f0397adc761ceea11e84f995d006b1cb911fe

See more details on using hashes here.

File details

Details for the file dnaio-1.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dnaio-1.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dnaio-1.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7a48e159d57d95eb844c0d0fb5ec942c122b664197a234a39f184f1f87ea8735
MD5 aeb39739439033eb3014e21f56021126
BLAKE2b-256 93ab90b4265d12e168c41804473b788d07da3f00aaaf74654ad72d1fa01bd1a5

See more details on using hashes here.

File details

Details for the file dnaio-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fec250691f3b0321f2a511e12f4013e710447eb1350864bc9ff0a6fd9e071f6
MD5 aed1b8d7ef4c7afebf22db64e7d5f70f
BLAKE2b-256 17db530d1d20b9a31f7e601afd06c0c41f907c41658faeacdcab63a465a35430

See more details on using hashes here.

File details

Details for the file dnaio-1.2.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dnaio-1.2.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6de506c0c57b47aa70d3cd733b4ca40edac44bd2b9240c7175e0079624f5b69f
MD5 0d38f7a5ce6355ca37e20e66af7bb971
BLAKE2b-256 cf5eb52cc9c24c117b32f9ba98878508ecee4d49a31fab6c6d1cd773cf171baa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 85.8 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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 07f066eda65a160d420afacbe227c1783bfa391b160241ef4171932919ecf7e2
MD5 58e727a78b93b5b06b642e9a4094ffac
BLAKE2b-256 d47649fb368fb5c8a3856f044142d0ea54c2898a932d628ffc9d6ddf535aec49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 016f20455fc1893fbdc06173eafea0fce99f4ea9ae765b09f1301dc6abd10222
MD5 e79c49d613c9ed465bfaf4235509cc39
BLAKE2b-256 6f479ee396893e1648e7f11099297906a058c97b9793bf5ed856e67bcdcce9e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ee348c44283461130555d16f535a21842988d2c86669b27e2abdd0bd8ffe9cf2
MD5 db34de8d96297811bc612d240ffeef4e
BLAKE2b-256 2b2aab61a259e169d425c3e44fda70cdb9db291ab57be0664903ee86d2b329f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 86.2 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.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 11c8d39b4764ba9e843c074a2e5c9f998203551b79c19b0e4087774b9bd8e344
MD5 33e2e379b37482281f181aaeff2d3d28
BLAKE2b-256 f9c807bb5dfa8c3178d8dda54b2d0ad506703e22696de2b2cca358e71ed27c89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d514e668ba37f564d0030ce5bbc123b6505eea9d815f0dddf9426a67bde746c
MD5 8549d9541ae668057591a9b0fd31d7c1
BLAKE2b-256 ca9789feb7b1ea1a242ed365394d343477b8bc1724c576087d3f46a3a74bdae4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4d3e44c49822e1d87f6f255042bd16a2006df1b39eac89d0c584937491018cc9
MD5 0f6175ce2ec96d8e281d7a2be0519280
BLAKE2b-256 f5f22738f074e249f45c0becdc4ef80bd25bfc432f4d5176391c96fe94cb60a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 86.8 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.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8e103c0dfde13f49cd6214d2e9edf1b2b2ce310a49bafa2035d5d251e8cdec3e
MD5 444523a8e6053fe6e9a2c4469340e47e
BLAKE2b-256 acf068c4b3b060be748c8ab4f527f4b6d152b19ee37861bd69c4c3d992b740a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63adab6163a856770e9d35c74c026cb6a94d3e2bcc3011396217d274ec6e2979
MD5 d4f35fe34a17e0cc68fb6bb6ed61685f
BLAKE2b-256 61cf63b62aae2a39b79e9cf2e8f11374d14a306f6883b3def9025cd0d4c37d11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 df8c1905b142306e7eab55f41980e245eee66fe85572339f4bb7251250f1b615
MD5 2d7008289fb6a8de053de6dd85f60482
BLAKE2b-256 3e03e6d51490a77e36c73ce30ae372a0a6e12c394f82f6b92feaaa3a4659d495

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.2.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 86.9 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.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6a02397056bab0b41b5ee0593c79c585f8f55a9beb2abe1eff6928982ae002c2
MD5 9fed344db2faf091b15d5666a466e9c7
BLAKE2b-256 61f02acb1eaa71644d8b4c734761bd7fc8f45313df2d55aa7b9b8df3a0512a80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2dbf454913b62d1375d263a8274a47d849b6d70c948db923165c4531dede141
MD5 1c8394168b7dac4145d7881f929ef0c2
BLAKE2b-256 a2bf48f940e5dc04629c240ab9bc0c8c10e27d8cb465fd7babc4a28db83455f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c8bf41be6bb0f9f46a35a00a33fba02ae851c814d813aa408cb41b04000d1141
MD5 833fde621269ddd461b1f9da43cffb25
BLAKE2b-256 7c9a81bd4bc8a9b87ed4845987b4c5fbcedc5161c586b8e69d733a46f2d872d0

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