Enum noodles_cram::record::feature::Feature

source ·
pub enum Feature {
    Bases(Position, Vec<u8>),
    Scores(Position, Vec<u8>),
    ReadBase(Position, u8, u8),
    Substitution(Position, Value),
    Insertion(Position, Vec<u8>),
    Deletion(Position, usize),
    InsertBase(Position, u8),
    QualityScore(Position, u8),
    ReferenceSkip(Position, usize),
    SoftClip(Position, Vec<u8>),
    Padding(Position, usize),
    HardClip(Position, usize),
}
Expand description

A CRAM record feature.

Variants§

§

Bases(Position, Vec<u8>)

A stretch of bases (position, bases).

§

Scores(Position, Vec<u8>)

A stretch of quality scores (position, quality scores).

§

ReadBase(Position, u8, u8)

A base-quality score pair (position, base, quality score).

§

Substitution(Position, Value)

A base substitution (position, code (read) / base (write)).

§

Insertion(Position, Vec<u8>)

Inserted bases (position, bases).

§

Deletion(Position, usize)

A number of deleted bases (position, length).

§

InsertBase(Position, u8)

A single inserted base (position, base).

§

QualityScore(Position, u8)

A single quality score (position, score).

§

ReferenceSkip(Position, usize)

A number of skipped bases (position, length).

§

SoftClip(Position, Vec<u8>)

Soft clipped bases (position, bases).

§

Padding(Position, usize)

A number of padded bases (position, length).

§

HardClip(Position, usize)

A number of hard clipped bases (position, length).

Implementations§

source§

impl Feature

source

pub fn code(&self) -> Code

Returns the feature code.

§Examples
use noodles_core::Position;
use noodles_cram::record::{feature::Code, Feature};

let position = Position::try_from(8)?;
let feature = Feature::Padding(position, 13);

assert_eq!(feature.code(), Code::Padding);
source

pub fn position(&self) -> Position

Returns the feature position.

§Examples
use noodles_core::Position;
use noodles_cram::record::Feature;

let position = Position::try_from(8)?;
let feature = Feature::Padding(position, 13);

assert_eq!(feature.position(), position);

Trait Implementations§

source§

impl Clone for Feature

source§

fn clone(&self) -> Feature

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Feature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Feature

source§

fn eq(&self, other: &Feature) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Feature

source§

impl StructuralPartialEq for Feature

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.