|
|
@@ -988,6 +988,18 @@ pub enum PileBase {
|
|
|
Skip,
|
|
|
}
|
|
|
|
|
|
+impl From<u8> for PileBase {
|
|
|
+ fn from(b: u8) -> Self {
|
|
|
+ match b {
|
|
|
+ b'A' | b'a' => PileBase::A,
|
|
|
+ b'C' | b'c' => PileBase::C,
|
|
|
+ b'G' | b'g' => PileBase::G,
|
|
|
+ b'T' | b't' => PileBase::T,
|
|
|
+ _ => PileBase::N,
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/// Decode one HTSlib 4-bit nucleotide (0=A,1=C,2=G,3=T,4=N, …) to `PileBase`
|
|
|
#[inline]
|
|
|
fn decode(n: u8) -> PileBase {
|