1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#![warn(missing_docs)]
use rust_htslib::bam::record::Aux;
#[derive(Debug)]
pub struct ReadGroupId(pub String);
impl Default for ReadGroupId {
fn default() -> Self {
Self(String::from("A"))
}
}
#[derive(Debug)]
pub struct SampleName(pub String);
impl Default for SampleName {
fn default() -> Self {
Self(String::from("Sample1"))
}
}
#[derive(Clone, Debug)]
pub enum AuxType {
Integer(i64),
String(String),
Float(f64),
Char(u8),
}
impl<'a> From<&'a AuxType> for Aux<'a> {
fn from(aux_type: &'a AuxType) -> Self {
match aux_type {
AuxType::Integer(x) => Aux::Integer(*x),
AuxType::String(x) => Aux::String((*x).as_bytes()),
AuxType::Float(x) => Aux::Float(*x),
AuxType::Char(x) => Aux::Char(*x),
}
}
}
#[derive(Clone, Debug)]
pub enum Strand {
Plus,
Minus,
}