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.1.0.tar.gz (57.5 kB view details)

Uploaded Source

Built Distributions

dnaio-1.1.0-cp312-cp312-win_amd64.whl (84.9 kB view details)

Uploaded CPython 3.12 Windows x86-64

dnaio-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (108.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

dnaio-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl (93.2 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

dnaio-1.1.0-cp311-cp311-win_amd64.whl (85.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

dnaio-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (110.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dnaio-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl (92.7 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

dnaio-1.1.0-cp310-cp310-win_amd64.whl (85.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

dnaio-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (110.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dnaio-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl (92.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

dnaio-1.1.0-cp39-cp39-win_amd64.whl (86.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

dnaio-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (111.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dnaio-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl (93.1 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

dnaio-1.1.0-cp38-cp38-win_amd64.whl (86.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

dnaio-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (112.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dnaio-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl (92.1 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dnaio-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7ecdfb3de3fd82c69b9750ba66202edc095610646d0720961ca7308af4ee8c45
MD5 6a3ee573f1f176bec3aa78dbd92a20a6
BLAKE2b-256 c667d07ada36ad76198197cee7deea862ee568aa255adc8b6f93535f5bf00da8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 84.9 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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d007bd3813a6e795e02673a5a5b21ec198e8901b1dc41865a5a872c9193b6b79
MD5 18428f5c179535c201e0e5caf73b6e02
BLAKE2b-256 bdca56ce850cc1f6de2aded2d3dd8859346cec194c24c6a61f754d8c37ab44f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1915a583b8393a56cab17d480570a64c4927931be4cd79410784778768d92350
MD5 76ad63911e0e4013028cbbb0c591b1c3
BLAKE2b-256 666ca8e9aabd861c88b774b80706dd56f086bef7b2546c16716eeeadf5a78784

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 698e11a703a2dbbd27ada733382f7e0aa4c9ac0cfca8e57c8856ee968c19308d
MD5 9b8fea6fcd14a04fff8354a31ea3af06
BLAKE2b-256 9efd95444482d8bfc00ab0d2b8367a4c287b586a81f0113c79a6e9ba59e964fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 85.5 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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 00ecdec4e18b49a3ddc0b84235d668e45ab2c39b58e965cfc8676950fd932d26
MD5 e247c0d4b4af7fc9c639cdecb530b9d3
BLAKE2b-256 20fbdaf510b4e000266d59f216b698996b0a6119ecc4f752ff5d31767577cd86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae4ee86ada27a0988ccc1a99b7f6d19212dbb244a3e102eb32ae0982feb13af9
MD5 4bc96feb88c5ba0a8056b17ac08c298f
BLAKE2b-256 217d4bf238a03b2aa459d186488ff807904c38089ace24041d8c0831ed521951

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 08f77f5cf272f46f1817b455ffe083d5b95d280d99fc6e97d44a89386e607d72
MD5 e9da04c4dead87703179244c917a930f
BLAKE2b-256 7ba316405d34891eb0672b24aa160139996eb534d0ec64520725a607445c5353

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 85.9 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.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6d369de075f8212fa1a8748d75b8ce965f509fc9b20cf7c7c803b5c8c54301e9
MD5 3074b2f8e2c2a633fab42c8ad30e6dfc
BLAKE2b-256 c72599fd12fdaad2c689840fd66606ae5900644718bad79d2ae256fa68d4ba49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa36ed51dca4b0a14321f3c2ac62db6893c4f252ce62c09ab278bc6ae44f4aec
MD5 259d78e8f9505bd9124ae11d26ec5569
BLAKE2b-256 ea0facbcec6b773781f2e48003fbd7cfe645c064299b0188bc45672118773ecd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 51e38c2eb69a4d5c65407cb7f5957a3744e1bc9c5bb882560d379e662376795c
MD5 0412123aaee59ef4bf6058ace43ac472
BLAKE2b-256 1280718c72e7be167fc79b29a5166a446af70cd96d18a377189f3ec74462e12d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 86.4 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.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6155c27b0a0f3170ab9a57316cbd6f380bd3a92fb679eea51d85887f268b7af1
MD5 feb606bfa4a7b3525c81711a12cde412
BLAKE2b-256 2b2689b501709dee0352359499596c5f4cf940d7e8a2943c306cf559d3ecb73e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 271dfb9599a70c05e800c0faae33800ed16402dbd2dbde7d251f18be6700c4a1
MD5 1657216bc79c713895b48890d310c18c
BLAKE2b-256 8769b9a6959218b2095646285f5887284d3239ed856f24bf183295f121b9c49a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 aa2353bceb82d8c41d30206e24da7f52f2e0e12e8883215d09c3c5264e425c9c
MD5 131643d4aed9c7a282b1efbcc4a35260
BLAKE2b-256 8d56339c93f88b76a7e8c9fb8b1053b49b60374b814d4ebe924c0c3846c50daa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnaio-1.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 86.6 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.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8d2758d7f2cf24fbc99b00c25aade8a0157932f4f3444aef8c7489be0d66d0ff
MD5 e6683e620026ee4206aef17fbe0a0e03
BLAKE2b-256 0013a5a4960ca6bf2f9475b84e1d18fbd2b187bc26a5e1b1bf6d982064b90d66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a78d1b85dd3a50dd083afb5a22e8b6b299386c99a11c244d92d8e93d00c7e76
MD5 d6937b04e75b55ff5a8c6615c8f8091c
BLAKE2b-256 e3ae208680a45aa12dade0ef691f0457756b325a7b27c5eec4e302551b3f25ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnaio-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f03ca5b28ff621e8c81a87143b2c8bd5d844c9b81958df5b866d6927b55a289a
MD5 ab83bc13cb6ad43dff2353850f00242b
BLAKE2b-256 c534edb52fb67fa01fcc2eff6ce1af3ee330455c4615a2ccb6b5153c15065987

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