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>>,
}
Expand description
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§
Source§impl<Label> Domain<Label>
impl<Label> Domain<Label>
Sourcepub fn iter(&self) -> DomainIter ⓘ
pub fn iter(&self) -> DomainIter ⓘ
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).
Sourcepub fn translate(self, dx: isize, dy: isize) -> Self
pub fn translate(self, dx: isize, dy: isize) -> Self
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).
Sourcepub fn shift_y(self, dy: isize) -> Self
pub fn shift_y(self, dy: isize) -> Self
Translate this domain to a different helix (probably most meaningful for a flat design).
Sourcepub fn pseudo_copy(&self) -> Self
pub fn pseudo_copy(&self) -> Self
Return a domain that has the same bounds as self
Sourcepub fn contains(&self, h: isize, x: isize, b: bool) -> bool
pub fn contains(&self, h: isize, x: isize, b: bool) -> bool
Return true iff self
contains the nucleotide (h, x, b)
Trait Implementations§
Source§impl<'de, Label> Deserialize<'de> for Domain<Label>where
Label: Deserialize<'de>,
impl<'de, Label> Deserialize<'de> for Domain<Label>where
Label: 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> Freeze for Domain<Label>where
Label: Freeze,
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§
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