Skip to main content

DryIceReader

Struct DryIceReader 

Source
pub struct DryIceReader<R, S = RawAsciiCodec, Q = RawQualityCodec, N = RawNameCodec, K = NoRecordKey> { /* private fields */ }
Expand description

Reads sequencing records from a dryice file.

Implementations§

Source§

impl DryIceReader<MissingInner, RawAsciiCodec, RawQualityCodec, RawNameCodec, NoRecordKey>

Source

pub fn builder() -> DryIceReaderBuilder<MissingInner, RawAsciiCodec, RawQualityCodec, RawNameCodec, NoRecordKey, ReadAllFields>

Start building a new reader.

Source§

impl<R: Read> DryIceReader<R, RawAsciiCodec, RawQualityCodec, RawNameCodec, NoRecordKey>

Source

pub fn new(inner: R) -> Result<Self, DryIceError>

Open a dryice file for reading with default codecs.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source

pub fn with_two_bit_exact( inner: R, ) -> Result<DryIceReader<R, TwoBitExactCodec, RawQualityCodec, RawNameCodec, NoRecordKey>, DryIceError>

Open a reader configured for the built-in 2-bit exact sequence codec.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source

pub fn with_codecs<S: SequenceCodec, Q: QualityCodec, N: NameCodec>( inner: R, ) -> Result<DryIceReader<R, S, Q, N, NoRecordKey>, DryIceError>

Open a reader configured for user-defined codecs.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source

pub fn with_record_key<K2: RecordKey>( inner: R, ) -> Result<DryIceReader<R, RawAsciiCodec, RawQualityCodec, RawNameCodec, K2>, DryIceError>

Open a reader configured for a user-defined record-key type with default codecs.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source

pub fn with_bytes8_key( inner: R, ) -> Result<DryIceReader<R, RawAsciiCodec, RawQualityCodec, RawNameCodec, Bytes8Key>, DryIceError>

Open a reader configured for the built-in 8-byte key type.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source

pub fn with_bytes16_key( inner: R, ) -> Result<DryIceReader<R, RawAsciiCodec, RawQualityCodec, RawNameCodec, Bytes16Key>, DryIceError>

Open a reader configured for the built-in 16-byte key type.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source§

impl<R: Read> DryIceReader<R>

Source

pub fn open<S: SequenceCodec, Q: QualityCodec, N: NameCodec, K: RecordKey>( inner: R, ) -> Result<DryIceReader<R, S, Q, N, K>, DryIceError>

Open a reader with fully user-specified codec and key type parameters.

This is the most general constructor, intended for library authors who need to configure all four type parameters at once. Most users should prefer new, with_codecs, or the convenience constructors instead.

§Errors

Returns an error if the file header is missing, corrupt, or uses an unsupported format version.

Source§

impl<R: Read, S: SequenceCodec, Q: QualityCodec, N: NameCodec, K: RecordKey> DryIceReader<R, S, Q, N, K>

Source

pub fn record_key(&self) -> Result<K, DryIceError>

Decode the current record’s accelerator key.

§Errors

Returns an error if no record key is present in the current block, if the configured key type does not match the block’s key metadata, or if the key bytes cannot be decoded into K.

Source

pub fn next_key(&mut self) -> Result<Option<K>, DryIceError>

Advance to the next record and return only its key.

§Errors

Returns an error if advancing to the next record fails or if the key section is missing or incompatible with K.

Source§

impl<R: Read, S: SequenceCodec, Q: QualityCodec, N: NameCodec, K> DryIceReader<R, S, Q, N, K>

Source

pub fn next_record(&mut self) -> Result<bool, DryIceError>

Advance to the next record in the file.

§Errors

Returns an error if a block header or block payload cannot be read or decoded, or if the block’s codec tags do not match the reader’s configured codecs.

Source

pub fn into_records(self) -> DryIceRecords<R, S, Q, N, K>

Consume this reader into an iterator of owned SeqRecord values.

Trait Implementations§

Source§

impl<R: Read, S: SequenceCodec, Q: QualityCodec, N: NameCodec, K> SeqRecordLike for DryIceReader<R, S, Q, N, K>

Source§

fn name(&self) -> &[u8]

The record name or identifier.
Source§

fn sequence(&self) -> &[u8]

The nucleotide sequence.
Source§

fn quality(&self) -> &[u8]

The per-base quality scores.
Source§

fn len(&self) -> usize

The length of the sequence.
Source§

fn is_empty(&self) -> bool

Whether the sequence is empty.

Auto Trait Implementations§

§

impl<R, S, Q, N, K> Freeze for DryIceReader<R, S, Q, N, K>
where R: Freeze,

§

impl<R, S, Q, N, K> RefUnwindSafe for DryIceReader<R, S, Q, N, K>

§

impl<R, S, Q, N, K> Send for DryIceReader<R, S, Q, N, K>
where R: Send, S: Send, Q: Send, N: Send, K: Send,

§

impl<R, S, Q, N, K> Sync for DryIceReader<R, S, Q, N, K>
where R: Sync, S: Sync, Q: Sync, N: Sync, K: Sync,

§

impl<R, S, Q, N, K> Unpin for DryIceReader<R, S, Q, N, K>
where R: Unpin, S: Unpin, Q: Unpin, N: Unpin, K: Unpin,

§

impl<R, S, Q, N, K> UnsafeUnpin for DryIceReader<R, S, Q, N, K>
where R: UnsafeUnpin,

§

impl<R, S, Q, N, K> UnwindSafe for DryIceReader<R, S, Q, N, K>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> SeqRecordExt for T
where T: SeqRecordLike + ?Sized,

Source§

fn to_seq_record(&self) -> Result<SeqRecord, DryIceError>

Convert this record into an owned SeqRecord by copying the field data. Read more
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