Module bioutils::utils::check[][src]

Trait for checking specific criteria for a u8 of biological file origin. Types include sequence (nucleotide/amino acid) and quality (phred33/64/solexa, phred33 being all printable ascii). See below examples for included functions. Note that quality alphabets overlap, and one quality line may be valid phred33,64, solexa, or any combination. Check with the manufacturer for which quality encoding your data has. If unsure, most data generated beyond 2016 is kept in phred33 encoding. Additional functionality for common checks including has_n, has_gap, is_homopolymer, etc.

Examples

use bioutils::charsets::*;
use bioutils::utils::*;
use bioutils::utils::check::Check;

let dna = b"ACTG";
let rna = b"ACUG";
let homopolymerN = b"NNNN";
let homopolymerA = b"AAAA";
let gapna = b"AC-G";
let nna = b"ACnG";
let quality = b"@ABC";

assert!(homopolymerN.is_homopolymer());
assert!(homopolymerA.is_homopolymer_not_n());
assert!(homopolymerN.is_homopolymer_n());

assert!(gapna.has_gap());
assert!(nna.has_n());
assert!(dna.is_iupac());
assert!(rna.is_basic_rna());

assert!(quality.is_phred33());
assert!(quality.is_phred64());
assert!(quality.is_solexa());

Traits

Check