Struct BioAlphabet
pub struct BioAlphabet { /* private fields */ }Expand description
A biological alphabet with a descriptive kind and symbol set.
Implementations§
§impl BioAlphabet
impl BioAlphabet
pub const fn new(kind: AlphabetKind, symbols: AlphabetSymbolSet) -> BioAlphabet
pub const fn new(kind: AlphabetKind, symbols: AlphabetSymbolSet) -> BioAlphabet
Creates an alphabet from a kind and symbol set.
pub fn dna() -> BioAlphabet
pub fn dna() -> BioAlphabet
Returns the simple DNA alphabet A, C, G, T.
pub fn rna() -> BioAlphabet
pub fn rna() -> BioAlphabet
Returns the simple RNA alphabet A, C, G, U.
pub fn protein() -> BioAlphabet
pub fn protein() -> BioAlphabet
Returns the common protein alphabet.
pub fn dna_with_ambiguity() -> BioAlphabet
pub fn dna_with_ambiguity() -> BioAlphabet
Returns a DNA alphabet including common ambiguity symbols.
pub fn rna_with_ambiguity() -> BioAlphabet
pub fn rna_with_ambiguity() -> BioAlphabet
Returns an RNA alphabet including common ambiguity symbols.
pub fn protein_with_ambiguity() -> BioAlphabet
pub fn protein_with_ambiguity() -> BioAlphabet
Returns a protein alphabet including common ambiguity symbols.
pub fn custom(
kind: impl Into<String>,
symbols: impl AsRef<str>,
) -> Result<BioAlphabet, AlphabetError>
pub fn custom( kind: impl Into<String>, symbols: impl AsRef<str>, ) -> Result<BioAlphabet, AlphabetError>
Creates a custom alphabet.
§Errors
Returns AlphabetError::EmptySymbolSet when no symbols are supplied.
pub const fn kind(&self) -> &AlphabetKind
pub const fn kind(&self) -> &AlphabetKind
Returns the descriptive alphabet kind.
pub const fn symbols(&self) -> &AlphabetSymbolSet
pub const fn symbols(&self) -> &AlphabetSymbolSet
Returns the alphabet symbols.
pub fn contains(&self, symbol: char) -> bool
pub fn contains(&self, symbol: char) -> bool
Returns true when the symbol is present in the alphabet.
pub 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§
§impl Clone for BioAlphabet
impl Clone for BioAlphabet
§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 more§impl Debug for BioAlphabet
impl Debug for BioAlphabet
§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