noodles_cram/data_container/compression_header/
preservation_map.rs

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
//! CRAM data container preservation map.

mod builder;
pub(crate) mod key;
pub(crate) mod substitution_matrix;
pub mod tag_sets;

pub(crate) use {
    builder::Builder, key::Key, substitution_matrix::SubstitutionMatrix, tag_sets::TagSets,
};

#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct PreservationMap {
    read_names_included: bool,
    ap_data_series_delta: bool,
    is_reference_required: bool,
    substitution_matrix: SubstitutionMatrix,
    tag_sets: TagSets,
}

impl PreservationMap {
    pub fn new(
        read_names_included: bool,
        ap_data_series_delta: bool,
        is_reference_required: bool,
        substitution_matrix: SubstitutionMatrix,
        tag_sets: TagSets,
    ) -> Self {
        Self {
            read_names_included,
            ap_data_series_delta,
            is_reference_required,
            substitution_matrix,
            tag_sets,
        }
    }

    pub fn read_names_included(&self) -> bool {
        self.read_names_included
    }

    pub fn ap_data_series_delta(&self) -> bool {
        self.ap_data_series_delta
    }

    pub fn is_reference_required(&self) -> bool {
        self.is_reference_required
    }

    pub fn substitution_matrix(&self) -> &SubstitutionMatrix {
        &self.substitution_matrix
    }

    pub fn tag_sets(&self) -> &TagSets {
        &self.tag_sets
    }
}