Function rustybam::paf::cigar_from_str
source · [−]pub fn cigar_from_str(text: &str) -> Result<CigarString, Error>
Expand description
Create a CigarString from given str.
Example
use rustybam::paf;
use rust_htslib::bam::record::*;
use rust_htslib::bam::record::CigarString;
use rust_htslib::bam::record::Cigar::*;
use std::convert::TryFrom;
use std::str::FromStr;
let cigars = vec!["10M4D100I1102=", "100000M20=5P10X4M"];
for cigar_str in cigars{
let my_parse = paf::cigar_from_str(cigar_str).expect("Unable to parse cigar");
let hts_parse = CigarString::try_from(cigar_str).expect("Unable to parse cigar");
assert_eq!(my_parse, hts_parse);
}