tsalign 2.1.2__tar.gz → 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {tsalign-2.1.2 → tsalign-4.0.0}/Cargo.lock +8 -8
  2. {tsalign-2.1.2 → tsalign-4.0.0}/Cargo.toml +5 -1
  3. {tsalign-2.1.2 → tsalign-4.0.0}/PKG-INFO +3 -3
  4. {tsalign-2.1.2/python_bindings → tsalign-4.0.0}/README.md +2 -2
  5. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/Cargo.toml +1 -1
  6. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/Cargo.toml +3 -3
  7. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_geometry.rs +30 -0
  8. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result/alignment/stream.rs +38 -19
  9. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs +210 -178
  10. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result.rs +34 -14
  11. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs +75 -12
  12. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/gap_affine_edit_distance.rs +8 -0
  13. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type.rs +79 -26
  14. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/context.rs +173 -78
  15. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs +37 -29
  16. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/identifier.rs +91 -74
  17. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch.rs +19 -15
  18. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch_alignment.rs +8 -3
  19. tsalign-4.0.0/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/allow_ts_14_out_of_range.rs +279 -0
  20. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/descendant.rs +6 -6
  21. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/template_switch_min_length.rs +71 -75
  22. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies.rs +1 -0
  23. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance.rs +69 -68
  24. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner.rs +37 -9
  25. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/config/io.rs +10 -10
  26. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/config.rs +44 -44
  27. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/tests.rs +21 -8
  28. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/Cargo.toml +2 -2
  29. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/error.rs +2 -2
  30. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/plain_text/mutlipair_alignment_renderer.rs +2 -1
  31. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/plain_text/parse_template_switches.rs +23 -25
  32. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/plain_text.rs +26 -23
  33. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg.rs +56 -54
  34. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/complement.rs +21 -21
  35. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/inner.rs +45 -45
  36. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/source.rs +99 -91
  37. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/template_switch.rs +5 -5
  38. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement.rs +10 -12
  39. {tsalign-2.1.2 → tsalign-4.0.0}/python/tsalign/_types.py +6 -6
  40. {tsalign-2.1.2 → tsalign-4.0.0}/python_bindings/Cargo.toml +3 -3
  41. {tsalign-2.1.2 → tsalign-4.0.0/python_bindings}/README.md +2 -2
  42. {tsalign-2.1.2 → tsalign-4.0.0}/python_bindings/src/lib.rs +11 -1
  43. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/Cargo.toml +2 -2
  44. tsalign-2.1.2/lib_tsshow/src/plain_text/alignment_stream.rs +0 -229
  45. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/clippy.toml +0 -0
  46. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/closed_lists.rs +0 -0
  47. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/comparator.rs +0 -0
  48. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/cost.rs +0 -0
  49. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/lib.rs +0 -0
  50. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/open_lists/linear_heap.rs +0 -0
  51. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/open_lists.rs +0 -0
  52. {tsalign-2.1.2 → tsalign-4.0.0}/generic_a_star/src/reset.rs +0 -0
  53. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result/a_star_sequences.rs +0 -0
  54. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result/alignment/iter.rs +0 -0
  55. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/alignment_result/alignment.rs +0 -0
  56. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type/equal_cost_range.rs +0 -0
  57. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds.rs +0 -0
  58. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/chaining.rs +0 -0
  59. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/node_ord.rs +0 -0
  60. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/primary_match.rs +0 -0
  61. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/primary_range.rs +0 -0
  62. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/secondary_deletion.rs +0 -0
  63. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/shortcut.rs +0 -0
  64. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/template_switch_count.rs +0 -0
  65. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/template_switch_total_length.rs +0 -0
  66. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/a_star_aligner/tests.rs +0 -0
  67. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/alignment_configuration.rs +0 -0
  68. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/alignment_matrix/index/iterators.rs +0 -0
  69. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/alignment_matrix/index.rs +0 -0
  70. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/alignment_matrix.rs +0 -0
  71. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs/cost_function/io.rs +0 -0
  72. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs/cost_function.rs +0 -0
  73. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs/gap_affine/io/tests.rs +0 -0
  74. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs/gap_affine/io.rs +0 -0
  75. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs/gap_affine.rs +0 -0
  76. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/costs.rs +0 -0
  77. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/error.rs +0 -0
  78. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/io.rs +0 -0
  79. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsalign/src/lib.rs +0 -0
  80. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/lib.rs +0 -0
  81. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/plain_text/mutlipair_alignment_renderer/tests.rs +0 -0
  82. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/arrows.rs +0 -0
  83. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/font/sans_serif_mono.rs +0 -0
  84. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/font/typewriter.rs +0 -0
  85. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/font.rs +0 -0
  86. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/indexed_str.rs +0 -0
  87. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/labelled_sequence.rs +0 -0
  88. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/svg/numbers.rs +0 -0
  89. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/character.rs +0 -0
  90. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/index_types.rs +0 -0
  91. {tsalign-2.1.2 → tsalign-4.0.0}/lib_tsshow/src/ts_arrangement/row.rs +0 -0
  92. {tsalign-2.1.2 → tsalign-4.0.0}/pyproject.toml +0 -0
  93. {tsalign-2.1.2 → tsalign-4.0.0}/python/tsalign/__init__.py +0 -0
  94. {tsalign-2.1.2 → tsalign-4.0.0}/python/tsalign/py.typed +0 -0
  95. {tsalign-2.1.2 → tsalign-4.0.0}/python_bindings/.gitignore +0 -0
  96. {tsalign-2.1.2 → tsalign-4.0.0}/python_bindings/BUILD.md +0 -0
  97. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/chain/context.rs +0 -0
  98. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/chain/display.rs +0 -0
  99. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/chain/node/display.rs +0 -0
  100. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/chain/node.rs +0 -0
  101. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/chain.rs +0 -0
  102. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/lib.rs +0 -0
  103. {tsalign-2.1.2 → tsalign-4.0.0}/seed_chain/src/seed.rs +0 -0
@@ -417,7 +417,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
417
417
 
418
418
  [[package]]
419
419
  name = "generic_a_star"
420
- version = "2.1.2"
420
+ version = "4.0.0"
421
421
  dependencies = [
422
422
  "binary-heap-plus",
423
423
  "compare",
@@ -548,7 +548,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
548
548
 
549
549
  [[package]]
550
550
  name = "lib_ts_chainalign"
551
- version = "2.1.2"
551
+ version = "4.0.0"
552
552
  dependencies = [
553
553
  "binary-heap-plus",
554
554
  "bincode",
@@ -568,7 +568,7 @@ dependencies = [
568
568
 
569
569
  [[package]]
570
570
  name = "lib_tsalign"
571
- version = "2.1.2"
571
+ version = "4.0.0"
572
572
  dependencies = [
573
573
  "binary-heap-plus",
574
574
  "compact-genome",
@@ -589,7 +589,7 @@ dependencies = [
589
589
 
590
590
  [[package]]
591
591
  name = "lib_tsshow"
592
- version = "2.1.2"
592
+ version = "4.0.0"
593
593
  dependencies = [
594
594
  "ena",
595
595
  "itertools",
@@ -804,7 +804,7 @@ dependencies = [
804
804
 
805
805
  [[package]]
806
806
  name = "py_lib_tsalign"
807
- version = "2.1.2"
807
+ version = "4.0.0"
808
808
  dependencies = [
809
809
  "compact-genome",
810
810
  "lib_tsalign",
@@ -1008,7 +1008,7 @@ dependencies = [
1008
1008
 
1009
1009
  [[package]]
1010
1010
  name = "seed_chain"
1011
- version = "2.1.2"
1011
+ version = "4.0.0"
1012
1012
  dependencies = [
1013
1013
  "compact-genome",
1014
1014
  "generic_a_star",
@@ -1360,7 +1360,7 @@ checksum = "2b939c825d0c4295ac520f7b479927c1e5b458c9107a9d6f5ba65bc867bb93a5"
1360
1360
 
1361
1361
  [[package]]
1362
1362
  name = "tsalign"
1363
- version = "2.1.2"
1363
+ version = "4.0.0"
1364
1364
  dependencies = [
1365
1365
  "anyhow",
1366
1366
  "bincode",
@@ -1381,7 +1381,7 @@ dependencies = [
1381
1381
 
1382
1382
  [[package]]
1383
1383
  name = "tsalign-tests"
1384
- version = "2.1.2"
1384
+ version = "4.0.0"
1385
1385
  dependencies = [
1386
1386
  "anyhow",
1387
1387
  "clap",
@@ -18,5 +18,9 @@ num-traits = "0.2.19"
18
18
  rustc-hash = "2.1.1"
19
19
  binary-heap-plus = "0.5.0"
20
20
 
21
+ [profile.dev]
22
+ debug = 1 # or "line-tables-only" instead of full debug info
23
+ split-debuginfo = "unpacked" # Keeps symbols out of the main object file
24
+
21
25
  [profile.release]
22
- debug = true
26
+ debug = 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tsalign
3
- Version: 2.1.2
3
+ Version: 4.0.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -104,9 +104,9 @@ from tsalign import align, TemplateSwitchEntranceOp, TemplateSwitchExitOp
104
104
  result = align(reference, query)
105
105
  for count, op in result.alignments():
106
106
  if isinstance(op, TemplateSwitchEntranceOp):
107
- print(f"Template switch: {op.direction}, primary={op.primary}, offset={op.first_offset}")
107
+ print(f"Template switch: {op.direction}, descendant={op.descendant}, offset={op.first_offset}")
108
108
  elif isinstance(op, TemplateSwitchExitOp):
109
- print(f"Exit, anti-primary gap: {op.anti_primary_gap}")
109
+ print(f"Exit, anti-descendant gap: {op.anti_descendant_gap}")
110
110
  else:
111
111
  # SimpleAlignmentOp — a basic edit in the primary or secondary track
112
112
  print(f"{count}x {op.kind}")
@@ -95,9 +95,9 @@ from tsalign import align, TemplateSwitchEntranceOp, TemplateSwitchExitOp
95
95
  result = align(reference, query)
96
96
  for count, op in result.alignments():
97
97
  if isinstance(op, TemplateSwitchEntranceOp):
98
- print(f"Template switch: {op.direction}, primary={op.primary}, offset={op.first_offset}")
98
+ print(f"Template switch: {op.direction}, descendant={op.descendant}, offset={op.first_offset}")
99
99
  elif isinstance(op, TemplateSwitchExitOp):
100
- print(f"Exit, anti-primary gap: {op.anti_primary_gap}")
100
+ print(f"Exit, anti-descendant gap: {op.anti_descendant_gap}")
101
101
  else:
102
102
  # SimpleAlignmentOp — a basic edit in the primary or secondary track
103
103
  print(f"{count}x {op.kind}")
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "generic_a_star"
3
3
  description = "A generic implementation of the A* algorithm"
4
- version = "2.1.2"
4
+ version = "4.0.0"
5
5
  edition.workspace = true
6
6
  rust-version.workspace = true
7
7
  license.workspace = true
@@ -2,7 +2,7 @@
2
2
  name = "lib_tsalign"
3
3
  description = "A sequence-to-sequence aligner that accounts for template switches"
4
4
  authors = ["Sebastian Schmidt <sebastian.schmidt@helsinki.fi>"]
5
- version = "2.1.2"
5
+ version = "4.0.0"
6
6
  license.workspace = true
7
7
  edition.workspace = true
8
8
  rust-version.workspace = true
@@ -26,9 +26,9 @@ thiserror = "2.0.3"
26
26
  num-traits.workspace = true
27
27
  serde = { workspace = true, features = ["derive"], optional = true }
28
28
  noisy_float = { version = "0.2.0" }
29
- generic_a_star = { version = "2.1.2", path = "../generic_a_star" }
29
+ generic_a_star = { version = "4.0.0", path = "../generic_a_star" }
30
30
  log.workspace = true
31
31
  rustc-hash = "2.1.1"
32
- seed_chain = { version = "2.1.2", path = "../seed_chain" }
32
+ seed_chain = { version = "4.0.0", path = "../seed_chain" }
33
33
  extend_map = "0.14.3"
34
34
  template-switch-error-free-inners = "0.1.1"
@@ -17,6 +17,18 @@ pub struct AlignmentCoordinates {
17
17
  }
18
18
 
19
19
  impl AlignmentRange {
20
+ pub fn new(
21
+ reference_offset: usize,
22
+ query_offset: usize,
23
+ reference_limit: usize,
24
+ query_limit: usize,
25
+ ) -> Self {
26
+ Self {
27
+ offset: AlignmentCoordinates::new(reference_offset, query_offset),
28
+ limit: AlignmentCoordinates::new(reference_limit, query_limit),
29
+ }
30
+ }
31
+
20
32
  pub fn new_complete(reference: usize, query: usize) -> Self {
21
33
  Self {
22
34
  offset: AlignmentCoordinates::new_zero(),
@@ -102,6 +114,16 @@ impl AlignmentRange {
102
114
  ),
103
115
  ))
104
116
  }
117
+
118
+ #[must_use]
119
+ pub fn with_offset(&self, offset: AlignmentCoordinates) -> Self {
120
+ Self::new_offset_limit(offset, self.limit)
121
+ }
122
+
123
+ #[must_use]
124
+ pub fn with_limit(&self, limit: AlignmentCoordinates) -> Self {
125
+ Self::new_offset_limit(self.offset, limit)
126
+ }
105
127
  }
106
128
 
107
129
  impl AlignmentCoordinates {
@@ -112,6 +134,14 @@ impl AlignmentCoordinates {
112
134
  pub fn new_zero() -> Self {
113
135
  Self::new(0, 0)
114
136
  }
137
+
138
+ pub fn reference(&self) -> usize {
139
+ self.reference
140
+ }
141
+
142
+ pub fn query(&self) -> usize {
143
+ self.query
144
+ }
115
145
  }
116
146
 
117
147
  impl Display for AlignmentRange {
@@ -2,7 +2,7 @@ use std::{collections::VecDeque, iter};
2
2
 
3
3
  use crate::a_star_aligner::{
4
4
  alignment_result::alignment::Alignment,
5
- template_switch_distance::{AlignmentType, TemplateSwitchPrimary},
5
+ template_switch_distance::{AlignmentType, TemplateSwitchDescendant},
6
6
  };
7
7
 
8
8
  #[derive(Debug, Clone)]
@@ -20,7 +20,7 @@ pub struct AlignmentStream {
20
20
  pub struct AlignmentStreamCoordinates {
21
21
  reference: usize,
22
22
  query: usize,
23
- template_switch_primary: Option<TemplateSwitchPrimary>,
23
+ template_switch_descendant: Option<TemplateSwitchDescendant>,
24
24
  }
25
25
 
26
26
  impl AlignmentStream {
@@ -176,8 +176,9 @@ impl AlignmentStream {
176
176
  AlignmentType::TemplateSwitchEntrance { .. }
177
177
  | AlignmentType::TemplateSwitchExit { .. }
178
178
  | AlignmentType::Root
179
+ | AlignmentType::AlternativeStart { .. }
179
180
  | AlignmentType::SecondaryRoot
180
- | AlignmentType::PrimaryReentry => 0,
181
+ | AlignmentType::PrimaryReentry { .. } => 0,
181
182
  AlignmentType::PrimaryShortcut { .. } => {
182
183
  unreachable!("Shortcut alignments are not supported for show")
183
184
  }
@@ -190,7 +191,7 @@ impl AlignmentStreamCoordinates {
190
191
  Self {
191
192
  reference: reference_offset,
192
193
  query: query_offset,
193
- template_switch_primary: None,
194
+ template_switch_descendant: None,
194
195
  }
195
196
  }
196
197
 
@@ -210,42 +211,60 @@ impl AlignmentStreamCoordinates {
210
211
  | AlignmentType::PrimaryMatch
211
212
  | AlignmentType::PrimaryFlankSubstitution
212
213
  | AlignmentType::PrimaryFlankMatch => (1, 1),
213
- AlignmentType::TemplateSwitchEntrance { primary, .. } => {
214
+ AlignmentType::TemplateSwitchEntrance { descendant, .. } => {
214
215
  assert!(
215
- self.template_switch_primary.is_none(),
216
+ self.template_switch_descendant.is_none(),
216
217
  "Encountered template switch entrance within template switch"
217
218
  );
218
- self.template_switch_primary = Some(primary);
219
+ self.template_switch_descendant = Some(descendant);
219
220
  (0, 0)
220
221
  }
221
222
  AlignmentType::SecondaryInsertion
222
223
  | AlignmentType::SecondarySubstitution
223
- | AlignmentType::SecondaryMatch => match self.template_switch_primary.unwrap() {
224
- TemplateSwitchPrimary::Reference => (1, 0),
225
- TemplateSwitchPrimary::Query => (0, 1),
224
+ | AlignmentType::SecondaryMatch => match self.template_switch_descendant.unwrap() {
225
+ TemplateSwitchDescendant::Reference => (1, 0),
226
+ TemplateSwitchDescendant::Query => (0, 1),
226
227
  },
227
- AlignmentType::TemplateSwitchExit { anti_primary_gap } => {
228
- let Some(template_switch_primary) = self.template_switch_primary.take() else {
228
+ AlignmentType::TemplateSwitchExit {
229
+ anti_descendant_gap,
230
+ } => {
231
+ let Some(template_switch_descendant) = self.template_switch_descendant.take()
232
+ else {
229
233
  panic!(
230
234
  "Encountered template switch exit without first encountering a template switch entrance"
231
235
  )
232
236
  };
233
- match template_switch_primary {
234
- TemplateSwitchPrimary::Reference => {
237
+ match template_switch_descendant {
238
+ TemplateSwitchDescendant::Reference => {
235
239
  self.query =
236
- usize::try_from(self.query as isize + anti_primary_gap).unwrap()
240
+ usize::try_from(self.query as isize + anti_descendant_gap).unwrap()
237
241
  }
238
- TemplateSwitchPrimary::Query => {
242
+ TemplateSwitchDescendant::Query => {
239
243
  self.reference =
240
- usize::try_from(self.reference as isize + anti_primary_gap).unwrap()
244
+ usize::try_from(self.reference as isize + anti_descendant_gap).unwrap()
241
245
  }
242
246
  }
243
247
  (0, 0)
244
248
  }
249
+ AlignmentType::AlternativeStart {
250
+ reference_index,
251
+ query_index,
252
+ } => {
253
+ assert_eq!(self.reference, reference_index);
254
+ assert_eq!(self.query, query_index);
255
+ (0, 0)
256
+ }
257
+ AlignmentType::PrimaryReentry {
258
+ reference_index,
259
+ query_index,
260
+ } => {
261
+ assert_eq!(self.reference, reference_index);
262
+ assert_eq!(self.query, query_index);
263
+ (0, 0)
264
+ }
245
265
  AlignmentType::SecondaryDeletion
246
266
  | AlignmentType::Root
247
- | AlignmentType::SecondaryRoot
248
- | AlignmentType::PrimaryReentry => (0, 0),
267
+ | AlignmentType::SecondaryRoot => (0, 0),
249
268
  AlignmentType::PrimaryShortcut { .. } => {
250
269
  unreachable!("Shortcut alignments are not supported for show")
251
270
  }