Skip to main content

Read FASTA and FASTQ files efficiently

Project description

Travis PyPI Codecov

dnaio parses FASTQ and FASTA

dnaio is a Python 3 library for fast parsing of FASTQ and also FASTA files. The code was previously part of the Cutadapt tool and has been improved 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')

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. You shouldn’t use them anyway.
  • FASTQ parsing is the focus of this library. The FASTA parser is not as optimized.

Links

Project details


Download files

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

Files for dnaio, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size dnaio-0.4-cp34-cp34m-manylinux1_x86_64.whl (120.3 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size dnaio-0.4-cp35-cp35m-manylinux1_x86_64.whl (120.4 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size dnaio-0.4-cp36-cp36m-manylinux1_x86_64.whl (122.0 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size dnaio-0.4-cp37-cp37m-manylinux1_x86_64.whl (121.4 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size dnaio-0.4-cp38-cp38-manylinux1_x86_64.whl (121.4 kB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size dnaio-0.4.tar.gz (123.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page