pub struct BioAlphabet { /* private fields */ }Expand description
A biological alphabet with a descriptive kind and symbol set.
Implementations§
Source§impl BioAlphabet
impl BioAlphabet
Sourcepub const fn new(kind: AlphabetKind, symbols: AlphabetSymbolSet) -> Self
pub const fn new(kind: AlphabetKind, symbols: AlphabetSymbolSet) -> Self
Creates an alphabet from a kind and symbol set.
Sourcepub fn dna_with_ambiguity() -> Self
pub fn dna_with_ambiguity() -> Self
Returns a DNA alphabet including common ambiguity symbols.
Sourcepub fn rna_with_ambiguity() -> Self
pub fn rna_with_ambiguity() -> Self
Returns an RNA alphabet including common ambiguity symbols.
Sourcepub fn protein_with_ambiguity() -> Self
pub fn protein_with_ambiguity() -> Self
Returns a protein alphabet including common ambiguity symbols.
Sourcepub fn custom(
kind: impl Into<String>,
symbols: impl AsRef<str>,
) -> Result<Self, AlphabetError>
pub fn custom( kind: impl Into<String>, symbols: impl AsRef<str>, ) -> Result<Self, AlphabetError>
Creates a custom alphabet.
§Errors
Returns AlphabetError::EmptySymbolSet when no symbols are supplied.
Sourcepub const fn kind(&self) -> &AlphabetKind
pub const fn kind(&self) -> &AlphabetKind
Returns the descriptive alphabet kind.
Sourcepub const fn symbols(&self) -> &AlphabetSymbolSet
pub const fn symbols(&self) -> &AlphabetSymbolSet
Returns the alphabet symbols.
Sourcepub fn contains(&self, symbol: char) -> bool
pub fn contains(&self, symbol: char) -> bool
Returns true when the symbol is present in the alphabet.
Sourcepub fn contains_all(&self, text: impl AsRef<str>) -> bool
pub fn contains_all(&self, text: impl AsRef<str>) -> bool
Returns true when every character in the supplied text is present in the alphabet.
Trait Implementations§
Source§impl Clone for BioAlphabet
impl Clone for BioAlphabet
Source§fn clone(&self) -> BioAlphabet
fn clone(&self) -> BioAlphabet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BioAlphabet
impl Debug for BioAlphabet
Source§impl PartialEq for BioAlphabet
impl PartialEq for BioAlphabet
impl Eq for BioAlphabet
impl StructuralPartialEq for BioAlphabet
Auto Trait Implementations§
impl Freeze for BioAlphabet
impl RefUnwindSafe for BioAlphabet
impl Send for BioAlphabet
impl Sync for BioAlphabet
impl Unpin for BioAlphabet
impl UnsafeUnpin for BioAlphabet
impl UnwindSafe for BioAlphabet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more