pyfastx is a Python module for fast random access to sequences from plain and gzipped FASTA/Q files. It provides an efficient, low-memory interface for reading, indexing, and querying biological sequences. Current version: 2.3.0, release cadence is irregular with updates about every 6-12 months.
pip install pyfastxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: open a FASTA or FASTQ file, iterate, access by ID.
Use index_dir parameter when calling Fasta or Fastq constructor to specify a custom directory: pyfastx.Fasta('file.fa', index_dir='./index')Do not mix iteration and random access. If you need both, create separate instances: one for iteration, one for indexed access.
Use len(seq) or seq.len instead of seq.seq_len.
Use len(seq) or seq.len instead.
Use index_dir parameter to specify a writable directory: pyfastx.Fasta('path/to/readonly/file.fa', index_dir='/tmp')Check the actual header: fa.keys() or iterate to see IDs. Use the exact first word of the header (e.g., for '>chr1 some description', the ID is 'chr1').
No dependency data recorded yet.