[][src]Struct needletail::kmer::CanonicalKmers

pub struct CanonicalKmers<'a> { /* fields omitted */ }

A kmer-izer for a nucleotide acid sequences to return canonical kmers.

Iterator returns the position of the kmer, a slice to the original data, and an boolean indicating if the kmer returned is the original or the reverse complement.

Methods

impl<'a> CanonicalKmers<'a>[src]

pub fn new(buffer: &'a [u8], rc_buffer: &'a [u8], k: u8) -> Self[src]

Creates a new iterator.

It's generally more useful to use this directly from a sequences (e.g. seq.canonical_kmers. Requires a reference to the reverse complement of the sequence it's created on, e.g.

use needletail::Sequence;
use needletail::kmer::CanonicalKmers;

let seq = b"ACGT";
let rc = seq.reverse_complement();
let c_iter = CanonicalKmers::new(seq, &rc, 3);
for (pos, kmer, canonical) in c_iter {
   // process data in here
}

Trait Implementations

impl<'a> Iterator for CanonicalKmers<'a>[src]

type Item = (usize, &'a [u8], bool)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> Send for CanonicalKmers<'a>

impl<'a> Unpin for CanonicalKmers<'a>

impl<'a> Sync for CanonicalKmers<'a>

impl<'a> RefUnwindSafe for CanonicalKmers<'a>

impl<'a> UnwindSafe for CanonicalKmers<'a>

Blanket Implementations

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From<T> for T[src]

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.

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

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

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