Skip to content
forked from marcelm/dnaio

Read and write FASTQ and FASTA

License

Notifications You must be signed in to change notification settings

rhpvorderman/dnaio

 
 

Repository files navigation

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.

Links

About

Read and write FASTQ and FASTA

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 73.8%
  • Cython 22.4%
  • C 3.8%