Skip to main content

FastqWriter

Struct FastqWriter 

Source
pub struct FastqWriter { /* private fields */ }
Expand description

A FASTQ writer that writes bgzf-compressed output.

The inner writer handles BGZF block framing and compression. Use new for single-threaded compression or from_writer to supply a pre-configured writer (e.g. a pooled_writer::PooledWriter for multi-threaded compression).

Implementations§

Source§

impl FastqWriter

Source

pub fn new(path: &Path, compression: u8) -> Result<Self>

Create a new single-threaded FASTQ writer at the given path.

Uses noodles-bgzf with the specified compression level (0-12).

§Errors

Returns an error if the file cannot be created or the compression level is invalid.

Source

pub fn from_writer(writer: impl Write + 'static) -> Self

Create a FASTQ writer from an existing writer that handles BGZF compression (e.g. a pooled_writer::PooledWriter).

Source

pub fn write_read(&mut self, read: &SimulatedRead) -> Result<()>

Write a single read as a FASTQ record.

Writes the four-line FASTQ format:

@read_name
BASES
+
QUALITIES
§Errors

Returns an error if writing fails.

Source

pub fn close(self)

Finalize the FASTQ file.

Drops the underlying writer, which flushes any buffered data and (for BGZF writers) writes the EOF marker. For pooled writers, this sends remaining data to the compression pool.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V