class
Fastx::Fasta::Reader
- Fastx::Fasta::Reader
- Reference
- Object
Defined in:
fastx/fasta/reader.crConstructors
-
.new(filename : String | Path)
Creates a new FASTA reader for the specified file.
Class Method Summary
-
.open(filename : String | Path, &)
Opens a FASTA file, yields the reader to the block, and automatically closes it.
Instance Method Summary
-
#close
Closes the file handle.
-
#closed?
Returns true if the file handle is closed.
-
#each(&)
Iterates over each FASTA record, yielding name and sequence.
-
#each_copy(&)
Iterates over each FASTA record, yielding name and sequence as String copies.
Constructor Detail
def self.new(filename : String | Path)
#
Creates a new FASTA reader for the specified file. Automatically detects gzip compression from .gz extension.
Class Method Detail
def self.open(filename : String | Path, &)
#
Opens a FASTA file, yields the reader to the block, and automatically closes it.
Instance Method Detail
def each_copy(&)
#
Iterates over each FASTA record, yielding name and sequence as String copies. This avoids buffer reuse issues when references to sequence data are kept.