pub fn expand_iupac(code: &u8) -> &[u8] {
    match *code {
        b'a' => b"a",
        b'c' => b"c",
        b'g' => b"g",
        b't' => b"tu",
        b'u' => b"tu",
        b'r' => b"ag",
        b'y' => b"ctu",
        b's' => b"gc",
        b'w' => b"atu",
        b'k' => b"gtu",
        b'm' => b"ac",
        b'b' => b"cgtu",
        b'd' => b"agtu",
        b'h' => b"actu",
        b'v' => b"acg",
        b'n' => b"acgtu",
        _ => {
            warn!(
                "Invalid IUPAC code '{}' encountered!",
                String::from_utf8_lossy(&[*code][..])
            );
            std::slice::from_ref(code)
        }
    }
}
/// Returns a slice containing all of [agctu] which match a given IUPAC code.
/// Input and output must be lowercase.
// Based on the table at https://www.bioinformatics.org/sms/iupac.html
Returns a slice containing all of [agctu] which match a given IUPAC code.
Input and output must be lowercase.
Returns a slice containing all of [ agctu ] which match a given IUPAC code . Input and output must be lowercase .
pub fn expand_iupac(code: &u8) -> &[u8] {
    match *code {
        b'a' => b"a",
        b'c' => b"c",
        b'g' => b"g",
        b't' => b"tu",
        b'u' => b"tu",
        b'r' => b"ag",
        b'y' => b"ctu",
        b's' => b"gc",
        b'w' => b"atu",
        b'k' => b"gtu",
        b'm' => b"ac",
        b'b' => b"cgtu",
        b'd' => b"agtu",
        b'h' => b"actu",
        b'v' => b"acg",
        b'n' => b"acgtu",
        _ => {
            warn!(
                "Invalid IUPAC code '{}' encountered!",
                String::from_utf8_lossy(&[*code][..])
            );
            std::slice::from_ref(code)
        }
    }
}
pub fn expand_iupac ( code : & u8 ) -> & [ u8 ] { match * code { b'a' => b" " , b'c' => b" " , b'g' => b" " , b't' => b" " , b'u' => b" " , b'r' => b" " , b'y' => b" " , b's' => b" " , b'w' => b" " , b'k' => b" " , b'm' => b" " , b'b' => b" " , b'd' => b" " , b'h' => b" " , b'v' => b" " , b'n' => b" " , _ => { warn ! ( " " String from_utf8_lossy ( [ code ] [ ] ) ) ; std :: slice :: from_ref ( code ) } } }
Returns a slice containing all of [agctu] which match a given IUPAC code.
Returns a slice containing all of [ agctu ] which match a given IUPAC code .
code
&u8
code
&u8