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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright (c) 2026 Alejandro Gonzales-Irribarren <alejandrxgzi@gmail.com>
// Distributed under the terms of the Apache License, Version 2.0.
use crate::;
/// A parsed chain record with zero-copy references into shared storage.
///
/// Represents a chain alignment between two sequences (reference and query) with
/// metadata and alignment blocks. Uses zero-copy references to avoid allocations
/// when parsing large files.
///
/// # Fields
///
/// * `score` - Alignment score
/// * `reference_name` - Reference sequence name (zero-copy reference)
/// * `reference_size` - Reference sequence length
/// * `reference_strand` - Reference strand orientation
/// * `reference_start` - Reference start coordinate
/// * `reference_end` - Reference end coordinate
/// * `query_name` - Query sequence name (zero-copy reference)
/// * `query_size` - Query sequence length
/// * `query_strand` - Query strand orientation
/// * `query_start` - Query start coordinate
/// * `query_end` - Query end coordinate
/// * `id` - Chain identifier
/// * `blocks` - Alignment blocks (zero-copy slice)
///
/// # Examples
///
/// ```ignore
/// use chaintools::{Chain, Strand, ByteSlice};
///
/// // Create a chain with zero-copy references
/// let chain = Chain {
/// score: 100,
/// reference_name: ByteSlice::from(b"chr1"),
/// reference_size: 1000,
/// reference_strand: Strand::Plus,
/// reference_start: 0,
/// reference_end: 100,
/// query_name: ByteSlice::from(b"chr2"),
/// query_size: 1000,
/// query_strand: Strand::Plus,
/// query_start: 0,
/// query_end: 100,
/// id: 1,
/// blocks: BlockSlice::empty(),
/// };
/// ```
/// Strand of an alignment reference/query.
///
/// Represents the orientation of a sequence in the alignment.
/// Plus indicates forward orientation, Minus indicates reverse complement.
///
/// # Examples
///
/// ```
/// use chaintools::Strand;
///
/// let forward = Strand::Plus;
/// let reverse = Strand::Minus;
///
/// assert!(forward != reverse);
/// ```