[][src]Struct codenano::Design

pub struct Design<StrandLabel, DomainLabel> {
    pub version: String,
    pub helices: Vec<Helix>,
    pub strands: Vec<Strand<StrandLabel, DomainLabel>>,
    pub parameters: Option<Parameters>,
}

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]

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]

pub fn to_mrdna<W: Write>(&self, w: W) -> Result<(), Error>[src]

Output a design in Cadnano format.

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]

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]

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]

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]

Return a domain builder containing the nucleotide

pub fn get_domain_bound(
    &self,
    h: isize,
    x: isize,
    b: bool
) -> (isize, isize, usize, usize)
[src]

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]

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]

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

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

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]

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]

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]

impl<'de, StrandLabel, DomainLabel> Deserialize<'de> for Design<StrandLabel, DomainLabel> where
    StrandLabel: Deserialize<'de>,
    DomainLabel: Deserialize<'de>, 
[src]

impl<StrandLabel, DomainLabel> Serialize for Design<StrandLabel, DomainLabel> where
    StrandLabel: Serialize,
    DomainLabel: Serialize
[src]

Auto Trait Implementations

impl<StrandLabel, DomainLabel> RefUnwindSafe for Design<StrandLabel, DomainLabel> where
    DomainLabel: RefUnwindSafe,
    StrandLabel: RefUnwindSafe

impl<StrandLabel, DomainLabel> Send for Design<StrandLabel, DomainLabel> where
    DomainLabel: Send,
    StrandLabel: Send

impl<StrandLabel, DomainLabel> Sync for Design<StrandLabel, DomainLabel> where
    DomainLabel: Sync,
    StrandLabel: Sync

impl<StrandLabel, DomainLabel> Unpin for Design<StrandLabel, DomainLabel> where
    DomainLabel: Unpin,
    StrandLabel: Unpin

impl<StrandLabel, DomainLabel> UnwindSafe for Design<StrandLabel, DomainLabel> where
    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]

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.