[][src]Struct codenano::Domain

pub struct Domain<Label> {
    pub helix: isize,
    pub start: isize,
    pub end: isize,
    pub forward: bool,
    pub label: Option<Label>,
    pub sequence: Option<Cow<'static, str>>,
}

A domain, i.e. an interval of a helix.

Fields

helix: isize

Index of the helix in the array of helices. Indices start at 0.

start: isize

Position of the leftmost base of this domain along the helix (this might be the first or last base of the domain, depending on the orientation parameter below).

end: isize

Position of the first base after the forwardmost base of the domain, along the helix. Domains must always be such that domain.start < domain.end.

forward: bool

If true, the "5' to 3'" direction of this domain runs in the same direction as the helix, i.e. "to the forward" along the axis of the helix. Else, the 5' to 3' runs to the left along the axis.

label: Option<Label>

An optional label that can be attached to strands.

sequence: Option<Cow<'static, str>>

In addition to the strand-level sequence, individual domains may have sequences too. The precedence has to be defined by the user of this library.

Implementations

impl<Label> Domain<Label>[src]

pub fn iter(&self) -> DomainIter[src]

Iterate through the positions of this domain, in 5' to 3' order (meaning that the values produced by this iterator might be increasing or decreasing).

pub fn translate(self, dx: isize, dy: isize) -> Self[src]

Translate this domain. The first parameter is the translation along the helix, the second one is a translation across helices (probably most meaningful for a flat design).

pub fn shift_x(self, dx: isize) -> Self[src]

Translate this domain along its helix.

pub fn shift_y(self, dy: isize) -> Self[src]

Translate this domain to a different helix (probably most meaningful for a flat design).

pub fn length(&self) -> isize[src]

Number of Nucleotides on the domain

pub fn pseudo_copy(&self) -> Self[src]

Return a domain that has the same bounds as self

pub fn contains(&self, h: isize, x: isize, b: bool) -> bool[src]

Return true iff self contains the nucleotide (h, x, b)

pub fn first_nucl(&self) -> Option<(isize, isize, bool)>[src]

Return the first nucl of self or None if self is empty

pub fn last_nucl(&self) -> Option<(isize, isize, bool)>[src]

Return the last nucl of self or None if self is empty

Trait Implementations

impl<Label: Clone> Clone for Domain<Label>[src]

impl<Label: Debug> Debug for Domain<Label>[src]

impl<Label: Default> Default for Domain<Label>[src]

impl<'de, Label> Deserialize<'de> for Domain<Label> where
    Label: Deserialize<'de>, 
[src]

impl<Label> Serialize for Domain<Label> where
    Label: Serialize
[src]

Auto Trait Implementations

impl<Label> RefUnwindSafe for Domain<Label> where
    Label: RefUnwindSafe

impl<Label> Send for Domain<Label> where
    Label: Send

impl<Label> Sync for Domain<Label> where
    Label: Sync

impl<Label> Unpin for Domain<Label> where
    Label: Unpin

impl<Label> UnwindSafe for Domain<Label> where
    Label: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.