[−][src]Struct debruijn::dna_string::DnaString
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 len(&self) -> usize
[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
.
fn set_slice_mut(&mut self, _: usize, _: usize, _: u64)
[src]
fn rc(&self) -> DnaString
[src]
ⓘ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 new(len: usize) -> Self
[src]
fn max_len() -> usize
[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(&self) -> 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 cmp(&self, other: &DnaString) -> Ordering
[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]
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?
ⓘImportant traits for DnaStringIter<'a>fn into_iter(self) -> DnaStringIter<'a>
[src]
impl Eq for DnaString
[src]
impl PartialOrd<DnaString> for DnaString
[src]
fn partial_cmp(&self, other: &DnaString) -> Option<Ordering>
[src]
fn lt(&self, other: &DnaString) -> bool
[src]
fn le(&self, other: &DnaString) -> bool
[src]
fn gt(&self, other: &DnaString) -> bool
[src]
fn ge(&self, other: &DnaString) -> bool
[src]
impl Debug for DnaString
[src]
impl Hash for DnaString
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Serialize for DnaString
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for DnaString
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> MerImmut for T where
T: Mer + Clone,
[src]
T: Mer + Clone,
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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,