pub struct SeqCol {
pub names: Vec<String>,
pub lengths: Vec<u64>,
pub sequences: Vec<String>,
pub sorted_name_length_pairs: Option<Vec<String>>,
}Expand description
A Level 2 sequence collection: the full attribute arrays.
Fields§
§names: Vec<String>Sequence names (e.g. “chr1”, “chr2”, …).
lengths: Vec<u64>Sequence lengths.
sequences: Vec<String>GA4GH sha512t24u digests of each sequence.
sorted_name_length_pairs: Option<Vec<String>>Optional: sorted name-length pairs digest.
Implementations§
Source§impl SeqCol
impl SeqCol
Sourcepub fn validate(&self) -> Result<(), SeqColError>
pub fn validate(&self) -> Result<(), SeqColError>
Validate that all arrays have the same length.
Sourcepub fn digest(&self) -> String
pub fn digest(&self) -> String
Compute the Level 0 digest (the single digest for the entire collection).
This is computed from the inherent attributes (names, lengths, sequences) by computing per-attribute digests, building a JSON object of those digests, canonicalizing it with JCS, and hashing with sha512t24u.
Sourcepub fn to_level1(&self) -> SeqColLevel1
pub fn to_level1(&self) -> SeqColLevel1
Compute Level 1: per-attribute digests.
Sourcepub fn sorted_name_length_pairs(&self) -> Vec<String>
pub fn sorted_name_length_pairs(&self) -> Vec<String>
Compute sorted name-length pairs as an array of strings.
Each element is the sha512t24u of name:length, sorted lexicographically.
Sourcepub fn name_length_pairs(&self) -> Vec<String>
pub fn name_length_pairs(&self) -> Vec<String>
Compute name-length pairs (unsorted) as an array of digests.