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>,
}Expand description
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: boolIs 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§
Source§impl<StrandLabel, DomainLabel> Strand<StrandLabel, DomainLabel>
impl<StrandLabel, DomainLabel> Strand<StrandLabel, DomainLabel>
Sourcepub fn default_color(&self) -> Color
pub fn default_color(&self) -> Color
Provide a default color to the strand.
Sourcepub fn set_kelly_color(&mut self, color: usize)
pub fn set_kelly_color(&mut self, color: usize)
Choose a color for this strand.
Sourcepub fn from_domain(domain: Domain<DomainLabel>) -> Self
pub fn from_domain(domain: Domain<DomainLabel>) -> Self
Create a strand made of one domain
Sourcepub fn first_nucl(&self) -> Option<(isize, isize, bool)>
pub fn first_nucl(&self) -> Option<(isize, isize, bool)>
Return the first Nucleotide of the strand if the length is at least 1. Return None otherwise
Sourcepub fn last_nucl(&self) -> Option<(isize, isize, bool)>
pub fn last_nucl(&self) -> Option<(isize, isize, bool)>
Return the last Nucleotide of the strand if the length is at least 1. Return None otherwise
Sourcepub fn nth_nucl(&self, n: usize) -> Option<(isize, isize, bool)>
pub fn nth_nucl(&self, n: usize) -> Option<(isize, isize, bool)>
Return the n-th nucleotide of the strand, or None if the length of the strand is less than n.
Sourcepub fn set_sequence(&mut self, seq: String)
pub fn set_sequence(&mut self, seq: String)
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§
Source§impl<'de, Label, DomainLabel> Deserialize<'de> for Strand<Label, DomainLabel>where
Label: Deserialize<'de>,
DomainLabel: Deserialize<'de>,
impl<'de, Label, DomainLabel> Deserialize<'de> for Strand<Label, DomainLabel>where
Label: Deserialize<'de>,
DomainLabel: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<Label, DomainLabel> Freeze for Strand<Label, DomainLabel>where
Label: Freeze,
impl<Label, DomainLabel> RefUnwindSafe for Strand<Label, DomainLabel>where
Label: RefUnwindSafe,
DomainLabel: RefUnwindSafe,
impl<Label, DomainLabel> Send for Strand<Label, DomainLabel>
impl<Label, DomainLabel> Sync for Strand<Label, DomainLabel>
impl<Label, DomainLabel> Unpin for Strand<Label, DomainLabel>
impl<Label, DomainLabel> UnwindSafe for Strand<Label, DomainLabel>where
Label: UnwindSafe,
DomainLabel: UnwindSafe,
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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