class

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.

Source
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.

Source

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.

Source
open(io : IO, line_width : Int32 | Nil = nil, &)

Opens a FASTA stream for writing, yields the writer to the block, and automatically closes it.

Source

Instance methods

close

Closes the writer and its underlying IO.

Source
closed?

Returns true if the file handle is closed.

Source
write(name : String, sequence : String)

Writes a FASTA record with the given name and sequence.

Source
write(name : String, sequence : Slice(UInt8))

Writes a FASTA record with the given name and sequence.

Source
write(name : Slice(UInt8), sequence : String)

Writes a FASTA record with the given name and sequence.

Source
write(name : Bytes, sequence : Bytes)

Writes a FASTA record with the given name and sequence.

Source