[−][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.
Implementations
impl<StrandLabel, DomainLabel> Design<StrandLabel, DomainLabel>
[src]
pub fn to_cadnano<W: Write>(
&mut self,
w: W,
try_do_skip: bool,
grid_type: GridType
) -> Result<(), Error>
[src]
&mut self,
w: W,
try_do_skip: bool,
grid_type: GridType
) -> Result<(), Error>
Output a design in Cadnano format.
impl Design<(), ()>
[src]
pub fn from_cadnano<P: AsRef<Path>>(file: P) -> Self
[src]
Create a design from a cadnano file
impl<StrandLabel, DomainLabel> Design<StrandLabel, DomainLabel>
[src]
impl<S, T> Design<S, T>
[src]
pub fn separate_helix(&mut self, n: usize)
[src]
Cut helix n into several contiguous helices
pub fn get_interval_helix(&self, n: usize) -> Option<(isize, isize)>
[src]
Return the interval (m, M) where m is the leftmost nucleotide on helix m and M the rightmost.
pub fn separate_all_helices(&mut self)
[src]
Apply separate_helix
on all helices
pub fn guess_bfs(&mut self, separate: bool)
[src]
guess a 3d form of the design by doing a bfs
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 honneycomb_grid_helix(&self, h: isize, v: isize) -> Helix
[src]
Create an helix on the honneycomb grid
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_honneycomb_helix(&mut self, h: isize, v: isize) -> HelixId
[src]
Add a helix created by Self::honneycomb_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 fix_colors(&mut self)
[src]
Set all the colors of the strands to Some(). For each strand, if the color is Some(), it is not modified. If the color is none, it is set to Some(s.default_color()) where n depends on the position of the 5' end of the strand
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 json_string(&self) -> String
[src]
Return a string describing the design in the json format.
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 get_domain_builder(
&mut self,
h: isize,
x: isize,
b: bool
) -> &mut Domain<DomainLabel>
[src]
&mut self,
h: isize,
x: isize,
b: bool
) -> &mut Domain<DomainLabel>
Return a domain builder containing the nucleotide
pub fn get_domain_bound(
&self,
h: isize,
x: isize,
b: bool
) -> (isize, isize, usize, usize)
[src]
&self,
h: isize,
x: isize,
b: bool
) -> (isize, isize, usize, usize)
Return the bounds of the domain containing nucleotide (h, x, b)
pub fn get_strand_nucl(&self, h: isize, x: isize, b: bool) -> Option<usize>
[src]
Return Some(s) if the nucleotide is on the strand s. Return None if the nucleotide is not in the design
pub fn cross_nucl(
&mut self,
h1: isize,
x1: isize,
b1: bool,
h2: isize,
x2: isize,
b2: bool
)
[src]
&mut self,
h1: isize,
x1: isize,
b1: bool,
h2: isize,
x2: isize,
b2: bool
)
Create a cross over between the two nucleotides if they are the extremities of strands that can be merged
pub fn patch_cross_nucl(
&self,
h1: isize,
x1: isize,
b1: bool,
h2: isize,
x2: isize,
b2: bool
) -> Option<Patch>
[src]
&self,
h1: isize,
x1: isize,
b1: bool,
h2: isize,
x2: isize,
b2: bool
) -> Option<Patch>
Return a patch that creates a cross over between two nucleotides if they are the extremities of strands that can be merged. Return None otherwise
pub fn overlap(&self, h: &Helix) -> bool
[src]
True iff one of the helices of self
overlaps h
pub fn add_link_helix(
&mut self,
helix_1: usize,
pos_1: isize,
forward_1: bool,
helix_2: usize,
pos_2: isize,
forward_2: bool
) -> usize
[src]
&mut self,
helix_1: usize,
pos_1: isize,
forward_1: bool,
helix_2: usize,
pos_2: isize,
forward_2: bool
) -> usize
Create an helix whose axis is the line that goes from helix_1.axis_pos(pos_1) to helix_2.axis_pos(pos_2). To avoid helices colision, the helix is shifted in the positive direction if forward_i == true or in the negative direction if forward_i == false
pub fn add_strand_link(
&mut self,
support_helix: usize,
from_helix: usize,
from_nucl: isize,
to_helix: usize,
to_nucl: isize
)
[src]
&mut self,
support_helix: usize,
from_helix: usize,
from_nucl: isize,
to_helix: usize,
to_nucl: isize
)
Create a strand on support_helix that goes from the nucleotide from_nucl of helix from_helix to the nucleotide to_nucl of to_helix
impl<S, T> Design<S, T>
[src]
pub fn auto_roll(&mut self)
[src]
Adjust the roll of the Helices to make better cross overs
pub fn clean_up(&mut self)
[src]
Remove empty domains and empty strands
pub fn optimize_cross_over(&mut self)
[src]
Optimize locally all the cross over of the design
pub fn space_pos(&self, h: isize, x: isize, b: bool) -> [f64; 3]
[src]
Return the position in space of the nucleotide (h, x, b)
pub fn get_cross_overs_helices(
&self,
h1: isize,
h2: isize
) -> Vec<(isize, bool, isize, bool)>
[src]
&self,
h1: isize,
h2: isize
) -> Vec<(isize, bool, isize, bool)>
Return the list of cross-overs between two helices
pub fn adjust_helix(&mut self, h1: usize, h2: usize)
[src]
Adjust the roll of two helices to minimize the distance at crossing overs
pub fn get_overlapping_nucl(&self) -> HashMap<(isize, isize, bool), Vec<usize>>
[src]
Return a HashMap mapping all nucleotides through which more than two strands pass, to the set of strands that pass through that nucleotide.
pub fn get_nucl_map(&self) -> HashMap<(isize, isize, bool), Vec<usize>>
[src]
Return a HashMap that map all the nucleotide of the disign to the set of strands that pass through it.
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> Design<StrandLabel, DomainLabel>
[src]
pub fn make_plates_96<H: FnMut(&Strand<StrandLabel, DomainLabel>) -> usize, F: FnMut(&Strand<StrandLabel, DomainLabel>) -> Option<bool>, G: FnMut(usize) -> String>(
&mut self,
file: &str,
seq_class: H,
filter: F,
format: G
)
[src]
&mut self,
file: &str,
seq_class: H,
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<StrandLabel: Clone, DomainLabel: Clone> Clone for Design<StrandLabel, DomainLabel>
[src]
fn clone(&self) -> Design<StrandLabel, DomainLabel>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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: for<'de> Deserialize<'de>,
[src]
T: for<'de> 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,