[][src]Struct codenano::Strand

pub struct Strand<Label, DomainLabel> {
    pub domains: Vec<Domain<DomainLabel>>,
    pub sequence: Option<Cow<'static, str>>,
    pub cyclic: bool,
    pub color: Option<Color>,
    pub label: Option<Label>,
}

A DNA strand.

Fields

domains: Vec<Domain<DomainLabel>>

The (ordered) vector of domains, where each domain is a directed interval of a helix.

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

The sequence of this strand, if any. If the sequence is longer than specified by the domains, a prefix is assumed. Can be skipped in the serialisation.

cyclic: bool

Is this sequence cyclic? Can be skipped (and defaults to false) in the serialization.

color: Option<Color>

Colour of this strand. If skipped, a default colour will be chosen automatically.

label: Option<Label>

An optional label for the strand. Can be serde_json::Value::Null, and skipped in the serialisation.

Implementations

impl<Label, DomainLabel> Strand<Label, DomainLabel>[src]

pub fn find_nucl(&self, nucl: isize) -> (isize, isize, bool)[src]

Find the nucl-th nucleotide of the strand. Output is (h, x, b) so that the nucl-th nucleotide of the strand is on helix h at position x with orientation b.

impl<StrandLabel, DomainLabel> Strand<StrandLabel, DomainLabel>[src]

pub fn default_color(&self) -> Color[src]

Provide a default color to the strand.

pub fn set_kelly_color(&mut self, color: usize)[src]

Choose a color for this strand.

pub fn is_empty(&self) -> bool[src]

Return true iff the strand is empty

pub fn len(&self) -> usize[src]

Total length of the strand

pub fn from_domain(domain: Domain<DomainLabel>) -> Self[src]

Create a strand made of one domain

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

Return the first Nucleotide of the strand if the length is at least 1. Return None otherwise

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

Return the last Nucleotide of the strand if the length is at least 1. Return None otherwise

pub fn nth_nucl(&self, n: usize) -> Option<(isize, isize, bool)>[src]

Return the n-th nucleotide of the strand, or None if the length of the strand is less than n.

pub fn set_sequence(&mut self, seq: String)[src]

Set the sequence of the strand, if the strand is longer than the provided sequence, the 3' end of the strand will not have a sequence. If the sequence is longer than the strand, the last chars of the sequence will be ignored

Trait Implementations

impl<Label: Clone, DomainLabel: Clone> Clone for Strand<Label, DomainLabel>[src]

impl<Label: Debug, DomainLabel: Debug> Debug for Strand<Label, DomainLabel>[src]

impl<Label: Default, DomainLabel: Default> Default for Strand<Label, DomainLabel>[src]

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

impl<Label, DomainLabel> Serialize for Strand<Label, DomainLabel> where
    Label: Serialize,
    DomainLabel: Serialize
[src]

Auto Trait Implementations

impl<Label, DomainLabel> RefUnwindSafe for Strand<Label, DomainLabel> where
    DomainLabel: RefUnwindSafe,
    Label: RefUnwindSafe

impl<Label, DomainLabel> Send for Strand<Label, DomainLabel> where
    DomainLabel: Send,
    Label: Send

impl<Label, DomainLabel> Sync for Strand<Label, DomainLabel> where
    DomainLabel: Sync,
    Label: Sync

impl<Label, DomainLabel> Unpin for Strand<Label, DomainLabel> where
    DomainLabel: Unpin,
    Label: Unpin

impl<Label, DomainLabel> UnwindSafe for Strand<Label, DomainLabel> where
    DomainLabel: UnwindSafe,
    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.