[][src]Struct debruijn::dna_string::DnaString

pub struct DnaString { /* fields omitted */ }

A container for sequence of DNA bases.

Methods

impl DnaString[src]

pub fn new() -> DnaString[src]

Create an empty DNA string

pub fn len(&self) -> usize[src]

Length of the sequence

pub fn with_capacity(n: usize) -> Self[src]

Create a new instance with a given capacity.

pub fn blank(n: usize) -> Self[src]

Create a DnaString of length n initialized to all A's

pub fn from_dna_string(dna: &str) -> DnaString[src]

Create a DnaString corresponding to an ACGT-encoded str.

pub fn from_dna_only_string(dna: &str) -> Vec<DnaString>[src]

Create a DnaString corresponding to an ACGT-encoded str.

pub fn from_acgt_bytes(bytes: &[u8]) -> DnaString[src]

Create a DnaString from an ASCII ACGT-encoded byte slice. Non ACGT positions will be converted to 'A'

pub fn from_acgt_bytes_hashn(bytes: &[u8], read_name: &[u8]) -> DnaString[src]

Create a DnaString from an ACGT-encoded byte slice, Non ACGT positions will be converted to repeatable random base determined by a hash of the read name and the position within the string.

pub fn from_bytes(bytes: &[u8]) -> DnaString[src]

Create a DnaString from a 0-4 encoded byte slice

pub fn to_string(&self) -> String[src]

Convert sequence to a String

pub fn to_bytes(&self) -> Vec<u8>[src]

Convert sequence to a Vector of 0-4 encoded bytes

pub fn to_ascii_vec(&self) -> Vec<u8>[src]

Convert sequence to a Vector of ascii-encoded bytes

pub fn push(&mut self, value: u8)[src]

Append a 0-4 encoded base.

pub fn push_bytes(&mut self, bytes: &Vec<u8>, seq_length: usize)[src]

Push 0-4 encoded bases from a byte array.

Arguments

bytes: byte array to read values from seq_length: how many values to read from the byte array. Note that this is number of values not number of elements of the byte array.

Important traits for DnaStringIter<'a>
pub fn iter(&self) -> DnaStringIter[src]

Iterate over stored values (values will be unpacked into bytes).

pub fn clear(&mut self)[src]

Clear the sequence.

pub fn is_empty(&self) -> bool[src]

pub fn prefix(&self, k: usize) -> DnaStringSlice[src]

Get the length k prefix of the DnaString

pub fn suffix(&self, k: usize) -> DnaStringSlice[src]

Get the length k suffix of the DnaString

pub fn slice(&self, start: usize, end: usize) -> DnaStringSlice[src]

Get slice containing the interval [start, end) of self

pub fn reverse(&self) -> DnaString[src]

Create a fresh DnaString containing the reverse of self

Trait Implementations

impl Mer for DnaString[src]

fn get(&self, i: usize) -> u8[src]

Get the value at position i.

fn set_mut(&mut self, i: usize, value: u8)[src]

Set the value as position i.

Important traits for MerIter<'a, M>
fn iter<'a>(&'a self) -> MerIter<'a, Self>[src]

Iterate over the bases in the sequence

impl Vmer for DnaString[src]

fn get_kmer<K: Kmer>(&self, pos: usize) -> K[src]

Get the kmer starting at position pos

fn from_slice(seq: &[u8]) -> Self[src]

Create a Vmer from a sequence of bytes

fn first_kmer<K: Kmer>(&self) -> K[src]

Get the first Kmer from the sequence

fn last_kmer<K: Kmer>(&self) -> K[src]

Get the last kmer in the sequence

fn both_term_kmer<K: Kmer>(&self) -> (K, K)[src]

Get the terminal kmer of the sequence, on the both side of the sequence

fn term_kmer<K: Kmer>(&self, dir: Dir) -> K[src]

Get the terminal kmer of the sequence, on the side of the sequence given by dir

Important traits for KmerIter<'a, K, D>
fn iter_kmers<K: Kmer>(&self) -> KmerIter<K, Self>[src]

Iterate over the kmers in the sequence

Important traits for KmerExtsIter<'a, K, D>
fn iter_kmer_exts<K: Kmer>(&self, seq_exts: Exts) -> KmerExtsIter<K, Self>[src]

Iterate over the kmers and their extensions, given the extensions of the whole sequence

impl PartialEq<DnaString> for DnaString[src]

impl Clone for DnaString[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for DnaString[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<'a> IntoIterator for &'a DnaString[src]

type Item = u8

The type of the elements being iterated over.

type IntoIter = DnaStringIter<'a>

Which kind of iterator are we turning this into?

impl Eq for DnaString[src]

impl PartialOrd<DnaString> for DnaString[src]

impl Debug for DnaString[src]

impl Hash for DnaString[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for DnaString[src]

impl<'de> Deserialize<'de> for DnaString[src]

Auto Trait Implementations

impl Send for DnaString

impl Sync for DnaString

Blanket Implementations

impl<T> MerImmut for T where
    T: Mer + Clone
[src]

fn set(&self, pos: usize, val: u8) -> Self[src]

fn set_slice(&self, pos: usize, nbases: usize, bits: u64) -> Self[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]