A Python library for reading and writing FASTA and FASTQ files efficiently. Current version 1.2.4, released periodically with active development. It provides a simple iterator-based API and supports compression.
pip install dnaioVerified import paths — ran on the pinned version, not inferred.
Basic usage: read and write FASTA/FASTQ using dnaio.open(). Records have .name, .sequence, .qual attributes.
records = list(dnaio.open('file.fastq'))Replace dnaio.read('file') with dnaio.open('file') and dnaio.write('file', records) with dnaio.open('file', mode='w') as f: for r in records: f.write(r)with dnaio.open('file.fastq', quality_scale=64) as f: ...Use dnaio.open() instead: with dnaio.open('file.fasta') as f: for record in f: ...Pass the filename as a string, not a file object. Ensure mode is 'r' (default) for reading.
No dependency data recorded yet.