Exons

Struct Exons 

Source
pub struct Exons {
    pub exons: Vec<Interval>,
}
Expand description

Represents a collection of exons, which are contiguous regions within genomic sequences.

Exons are the parts of a gene’s DNA that code for proteins, and they’re separated by non-coding regions called introns. This structure stores a collection of exons as intervals.

§Fields

  • exons - A vector of intervals representing the positions of exons within a genomic sequence.

Fields§

§exons: Vec<Interval>

Implementations§

Source§

impl Exons

Source

pub fn builder() -> ExonsBuilder

Create an instance of Exons using the builder syntax

Source§

impl Exons

Methods for working with exon structures.

§Methods

  • introns() - Calculates the intron intervals between exons
  • is_empty() - Checks if there are no exons
  • len() - Returns the number of exons
  • span() - Calculates the total number of bases covered by all exons
  • first_exon() - Gets a reference to the first exon
  • last_exon() - Gets a reference to the last exon

§Panics

  • first_exon() will panic if there are no exons
  • last_exon() will panic if there are no exons
Source

pub fn introns(&self) -> Vec<Interval>

Returns a vector of intervals representing introns.

Introns are the regions between consecutive exons. For each pair of adjacent exons, an intron is created starting at the position immediately after the end of the first exon and ending at the position immediately before the start of the second exon.

§Returns

A Vec<Interval> containing all introns between exons in this structure.

Source

pub fn is_empty(&self) -> bool

Checks if the exon collection is empty.

§Returns

true if there are no exons, false otherwise.

Source

pub fn len(&self) -> usize

Returns the number of exons.

§Returns

The count of exons as a usize.

Source

pub fn span(&self) -> usize

Calculates the total span (combined length) of all exons.

The span is computed by summing the lengths of all intervals, where each interval length is calculated as end - start + 1.

§Returns

The total span as a usize.

Source

pub fn first_exon(&self) -> &Interval

Returns a reference to the first exon.

§Panics

Panics if the exon collection is empty.

§Returns

A reference to the first Interval in the exon collection.

Source

pub fn last_exon(&self) -> &Interval

Returns a reference to the last exon.

§Panics

Panics if the exon collection is empty.

§Returns

A reference to the last Interval in the exon collection.

Trait Implementations§

Source§

impl Clone for Exons

Source§

fn clone(&self) -> Exons

Returns a duplicate 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 Exons

Source§

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

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

impl Default for Exons

Source§

fn default() -> Exons

Returns the “default value” for a type. Read more
Source§

impl Display for Exons

Source§

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

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

impl FromStr for Exons

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

§

impl Freeze for Exons

§

impl RefUnwindSafe for Exons

§

impl Send for Exons

§

impl Sync for Exons

§

impl Unpin for Exons

§

impl UnwindSafe for Exons

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more