holehouse-lab / protfasta

Simple but robust parser for protein-based FASTA files
MIT License
1 stars 2 forks source link

Improved `header_parser` flags and FASTA file IO #3

Closed FriedLabJHU closed 1 year ago

FriedLabJHU commented 1 year ago

This update ensures header_parser is callable regardless of check_header_parser being set to FALSE. My previous PR bypassed the validation with callable() allowing for non-functions to be passed without raising errors. whoops!

Additionally, I had an issue loading massive FASTA files on an older system and found the cause to be _parse_fasta_all. Which received the entire contents of the file as a list. This update also allows _parse_fasta_all to read arbitrarily large FASTA files without reading the entire contents into memory by passing a file Path object instead of a list of file contents. This had no effect on functionality and should increase file read speeds. Especially on older systems / for larger FASTA files.

-EMS