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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//! AHo numbering via direct position mapping from IMGT alignment
//!
//! Derived from the ANARCI `number_aho` scheme (see `anarci_source_files/schemes.py`,
//! `number_aho` + `_number_regions`) and validated against the consensus fixtures in
//! `fixtures/validation/ab_*_aho.csv`.
//!
//! AHo spans positions 1-149. Unlike Kabat/Chothia/Martin it gaps its CDRs symmetrically
//! around a centre, with chain-specific CDR1 deletion orders. The rule windows follow
//! ANARCI's region boundaries exactly (wide, framework-anchored on both sides) so that the
//! residue count fed to each CDR renumbering is stable regardless of interior gap placement:
//! - FR1 indel on 8
//! - CDR1 insertions on 36 (chain-specific deletion order: VH / VK / VL)
//! - CDR2 insertions on 63
//! - FR3 indel on 85 (deletions move onto 86 then 85)
//! - CDR3 insertions on 123 (symmetric deletion around 123/124)
//!
//! Light chains additionally carry one extra C-terminal position (AHo 149) that has no IMGT
//! state (light chains end at IMGT 127 -> AHo 148); that residue is appended in
//! `Annotator::number`, matching ANARCI's `number_aho` tail rule.
//!
//! Per the project decision, each chain has its own rule table rather than extending
//! `NumberingRule` with a per-chain deletion order.
use crate;
use crateInsertion;
/// AHo regions, tiling all 149 positions.
/// Unverified, unlike the other schemes, and the sources conflict. Honegger & Plueckthun give
/// CDR-H1 27-42 / CDR-H2 57-76 and CDR-L1 24-42 / CDR-L2 58-72, both with CDR3 107-138. The CDR3
/// start below (109) matches neither, so check this table against the Honegger paper before relying
/// on AHo segmentation.
pub const AHO_REGIONS: RegionDefinition = RegionDefinition ;
/// FR1 rule for heavy and lambda: IMGT 1-10 -> AHo 1-10 with the scheme indel on 8. Heavy and
/// lambda AHo reserve position 8 as an empty gap (IMGT 8 shifts to AHo 9), so the count-based
/// deletion order drops 8 first. Kappa does NOT gap 8 (its FR1 is a true 1:1), so it uses
/// `fr(1,10)` instead.
const AHO_FR1_INDEL8: NumberingRule = variable;
/// CDR2 rule shared by all antibody chains: IMGT 56-75 -> AHo 58-77, insertions on 63,
/// deletions symmetric around 63.
const AHO_CDR2: NumberingRule = variable;
/// FR3 rule shared by all chains: IMGT 76-91 -> AHo 78-93, deletions onto 86 then 85,
/// insertions on 85.
const AHO_FR3: NumberingRule = variable;
/// CDR3 deletion order shared by all chains (ANARCI `number_aho` CDR3 ordered_deletions,
/// AHo numbering). Deletions grow symmetrically outward from 123/124.
const AHO_CDR3_DELETIONS: & = &;
/// CDR3 rule shared by all chains: IMGT 105-117 -> AHo 107-138, insertions on 123.
const AHO_CDR3: NumberingRule = variable;
// =============================================================================
// AHo Heavy Chain Numbering Rules
// =============================================================================
/// AHo heavy chain numbering rules
pub const AHO_HEAVY_RULES: & = &;
// =============================================================================
// AHo Kappa Chain Numbering Rules
// =============================================================================
/// AHo kappa chain numbering rules (VK CDR1 deletion order: two-residue gap at 27/28).
///
/// Kappa FR1 is a true 1:1 map (no gap at AHo 8), so it uses `fr` rather than the indel-on-8
/// rule used by heavy/lambda; this also keeps N-terminally truncated kappa sequences correct.
pub const AHO_KAPPA_RULES: & = &;
// =============================================================================
// AHo Lambda Chain Numbering Rules
// =============================================================================
/// AHo lambda chain numbering rules (VL CDR1 deletion order).
pub const AHO_LAMBDA_RULES: & = &;