[−][src]Struct codenano::Design
The main type of this crate, describing a DNA design.
Fields
version: String
Version of this format.
helices: Vec<Helix>
The vector of all helices used in this design. Helices have a position and an orientation in 3D.
strands: Vec<Strand<StrandLabel, DomainLabel>>
The vector of strands.
parameters: Option<Parameters>
Parameters of DNA geometry. This can be skipped (in JSON), or
set to None
in Rust, in which case a default set of
parameters from the literature is used.
Methods
impl<StrandLabel, DomainLabel> Design<StrandLabel, DomainLabel>
[src]
pub fn to_cadnano<W: Write>(&self, w: W) -> Result<(), Error>
[src]
Output a design in Cadnano format.
impl<StrandLabel: Serialize, DomainLabel: Serialize> Design<StrandLabel, DomainLabel>
[src]
pub fn new() -> Self
[src]
Initiates a design.
pub fn square_grid_helix(&self, h: isize, v: isize) -> Helix
[src]
Creates a flat helix (in the z = 0
plane).
pub fn adjusted_grid_helix(&self, h: isize, v: isize) -> Helix
[src]
Creates a flat helix in the z = 0
plane with adjusted roll.
pub fn with_parameters(parameters: Parameters) -> Self
[src]
Initiates a design with the given geometric parameters.
pub fn add_grid_helix(&mut self, h: isize, v: isize) -> HelixId
[src]
Add a helix created by Self::square_grid_helix
.
pub fn add_adjusted_grid_helix(&mut self, h: isize, v: isize) -> HelixId
[src]
Add a helix created by Self::add_grid_helix
.
pub fn add_helix(
&mut self,
x: f64,
y: f64,
z: f64,
roll: f64,
pitch: f64,
yaw: f64
) -> HelixId
[src]
&mut self,
x: f64,
y: f64,
z: f64,
roll: f64,
pitch: f64,
yaw: f64
) -> HelixId
Add an arbitrary helix. Parameters x,y,z are in nanometers and are the 3D coordinates of the centre of the helix. roll,pitch,yaw are in radians.
pub fn strand<H: Into<HelixId>>(
&mut self,
helix: H,
start: isize
) -> StrandRef<StrandLabel, DomainLabel>
[src]
&mut self,
helix: H,
start: isize
) -> StrandRef<StrandLabel, DomainLabel>
Start a strand, placing the first base at the position given
by helix
and start
.
pub fn empty_strand(&mut self) -> StrandRef<StrandLabel, DomainLabel>
[src]
Create a strand with no initial domain. Useful for adding custom domains, for example domains obtained by geometric operations from other domains.
pub fn get_strand_ref(
&mut self,
strand_id: usize
) -> StrandRef<StrandLabel, DomainLabel>
[src]
&mut self,
strand_id: usize
) -> StrandRef<StrandLabel, DomainLabel>
Return a StrandRef that can build the strand strand_id
pub fn write(&self) -> Result<(), Error>
[src]
Write this design to the standard output.
pub fn write_to<P: AsRef<Path>>(&self, p: P) -> Result<(), Error>
[src]
Write this design to a file. If the REMOTE
environment
variable is set, write it to the standard output instead.
pub fn unique_positions(&self) -> Option<(isize, isize, bool, usize, usize)>
[src]
Tests whether all bases have different positions, and returns
an offending strand else. The return format is (helix, position, orientation, i, j)
, where i
and j
are the indices of
two strands sharing this position.
Bases that are the start/end of a cycle are not detected and do not cause their
strand to be offending
pub fn check_and_write_to<P: AsRef<Path>>(&self, p: P) -> Result<(), Error>
[src]
Tests whether all bases have different positions, and warns the user otherwise.
Write this design to a file. If the REMOTE
environment
variable is set, write it to the standard output instead.
pub fn adjust_helix(&mut self, h1: usize, h2: usize)
[src]
Adjust the roll of two helices to minimize the distance at crossing overs
impl<StrandLabel, DomainLabel> Design<StrandLabel, DomainLabel>
[src]
pub fn sequences(&self) -> Vec<String>
[src]
Output all the sequences of the strands whose sequence has not been forced.
impl<StrandLabel: Ord + Display, DomainLabel: Ord + Display> Design<StrandLabel, DomainLabel>
[src]
pub fn make_plates_96<F: FnMut(&Strand<StrandLabel, DomainLabel>) -> Option<bool>, G: FnMut(usize) -> String>(
&mut self,
file: &str,
filter: F,
format: G
)
[src]
&mut self,
file: &str,
filter: F,
format: G
)
Output plates with the sequences, ordered by label, as an Excel spreadsheet that can be ordered from the IDT website.
All strands s
such that filter(s).is_some()
are included,
and only those. Moreover, if filter(s) == Some(true)
, a new
plate is started if the current plate is nonempty.
Moreover, strands are ran through the filter
function in the
same order as they are in self
.
Trait Implementations
impl<'de, StrandLabel, DomainLabel> Deserialize<'de> for Design<StrandLabel, DomainLabel> where
StrandLabel: Deserialize<'de>,
DomainLabel: Deserialize<'de>,
[src]
StrandLabel: Deserialize<'de>,
DomainLabel: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<StrandLabel, DomainLabel> Serialize for Design<StrandLabel, DomainLabel> where
StrandLabel: Serialize,
DomainLabel: Serialize,
[src]
StrandLabel: Serialize,
DomainLabel: Serialize,
Auto Trait Implementations
impl<StrandLabel, DomainLabel> RefUnwindSafe for Design<StrandLabel, DomainLabel> where
DomainLabel: RefUnwindSafe,
StrandLabel: RefUnwindSafe,
DomainLabel: RefUnwindSafe,
StrandLabel: RefUnwindSafe,
impl<StrandLabel, DomainLabel> Send for Design<StrandLabel, DomainLabel> where
DomainLabel: Send,
StrandLabel: Send,
DomainLabel: Send,
StrandLabel: Send,
impl<StrandLabel, DomainLabel> Sync for Design<StrandLabel, DomainLabel> where
DomainLabel: Sync,
StrandLabel: Sync,
DomainLabel: Sync,
StrandLabel: Sync,
impl<StrandLabel, DomainLabel> Unpin for Design<StrandLabel, DomainLabel> where
DomainLabel: Unpin,
StrandLabel: Unpin,
DomainLabel: Unpin,
StrandLabel: Unpin,
impl<StrandLabel, DomainLabel> UnwindSafe for Design<StrandLabel, DomainLabel> where
DomainLabel: UnwindSafe,
StrandLabel: UnwindSafe,
DomainLabel: UnwindSafe,
StrandLabel: 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]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,