{"id":23621,"library":"dnaio","title":"dnaio","description":"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.","status":"active","version":"1.2.4","language":"python","source_language":"en","source_url":"https://github.com/marcelm/dnaio","tags":["bioinformatics","fasta","fastq","file-io"],"install":[{"cmd":"pip install dnaio","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Main entry point; use dnaio.open() to read/write sequence files.","symbol":"open","correct":"import dnaio"},{"note":"Data class for sequence records.","symbol":"SequenceRecord","correct":"from dnaio import SequenceRecord"}],"quickstart":{"code":"import dnaio\n\nwith dnaio.open('example.fasta') as f:\n    for record in f:\n        print(record.name, record.sequence)\n\n# Writing\nwith dnaio.open('output.fasta', mode='w') as f:\n    f.write(dnaio.SequenceRecord('seq1', 'ACGT'))","lang":"python","description":"Basic usage: read and write FASTA/FASTQ using dnaio.open(). Records have .name, .sequence, .qual attributes."},"warnings":[{"fix":"records = list(dnaio.open('file.fastq'))","message":"dnaio.open() returns an iterator, not a list. If you need random access or indexing, load records into a list first.","severity":"gotcha","affected_versions":"all"},{"fix":"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)","message":"The old dnaio.read() and dnaio.write() functions are deprecated since version 1.0. Use dnaio.open() instead.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"with dnaio.open('file.fastq', quality_scale=64) as f: ...","message":"FASTQ quality scores are automatically converted to Phred+33; if your file uses Phred+64, you must specify quality_scale=64.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use dnaio.open() instead: with dnaio.open('file.fasta') as f: for record in f: ...","cause":"The legacy dnaio.read() and dnaio.write() functions were removed in version 1.0.0.","error":"AttributeError: module 'dnaio' has no attribute 'read'"},{"fix":"Pass the filename as a string, not a file object. Ensure mode is 'r' (default) for reading.","cause":"Calling dnaio.open() on a file object without specifying format or mode correctly.","error":"TypeError: '_io.TextIOWrapper' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}