Fastx::Fasta::Writer
Inherits Reference < Object
Constructors
new(filename : String | Path, line_width : Int32 | Nil = nil)
Creates a new FASTA writer for the specified file. Automatically detects gzip compression from .gz extension.
new(io : IO, line_width : Int32 | Nil = nil)
Creates a new FASTA writer for an already opened IO stream. IO-based writers do not perform gzip auto-detection. The writer takes ownership of the IO and closes it when the writer is closed.
Class methods
open(filename : String | Path, line_width : Int32 | Nil = nil, &)
Opens a FASTA file for writing, yields the writer to the block, and automatically closes it.
open(io : IO, line_width : Int32 | Nil = nil, &)
Opens a FASTA stream for writing, yields the writer to the block, and automatically closes it.
Instance methods
write(name : String, sequence : String)
Writes a FASTA record with the given name and sequence.
write(name : String, sequence : Slice(UInt8))
Writes a FASTA record with the given name and sequence.
write(name : Slice(UInt8), sequence : String)
Writes a FASTA record with the given name and sequence.