55
66//! Types for representing pairwise sequence alignments
77
8+ #[ cfg( feature = "serde" ) ]
9+ use serde:: { Deserialize , Serialize } ;
10+
811pub type TextSlice < ' a > = & ' a [ u8 ] ;
912
1013/// Alignment operations supported are match, substitution, insertion, deletion
@@ -15,7 +18,8 @@ pub type TextSlice<'a> = &'a [u8];
1518/// value associated with the clipping operations are the lengths clipped. In case
1619/// of standard modes like Global, Semi-Global and Local alignment, the clip operations
1720/// are filtered out
18- #[ derive( Eq , PartialEq , Debug , Copy , Clone , Serialize , Deserialize ) ]
21+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
22+ #[ derive( Eq , PartialEq , Debug , Copy , Clone ) ]
1923pub enum AlignmentOperation {
2024 Match ,
2125 Subst ,
@@ -33,7 +37,8 @@ pub enum AlignmentOperation {
3337/// appropriately set.
3438///
3539/// The default alignment mode is Global.
36- #[ derive( Debug , PartialEq , Eq , Copy , Clone , Serialize , Deserialize ) ]
40+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
41+ #[ derive( Debug , PartialEq , Eq , Copy , Clone ) ]
3742pub enum AlignmentMode {
3843 Local ,
3944 Semiglobal ,
@@ -53,7 +58,8 @@ impl Default for AlignmentMode {
5358/// lengths of sequences x and y, and the alignment edit operations. The start position
5459/// and end position of the alignment does not include the clipped regions. The length
5560/// of clipped regions are already encapsulated in the Alignment Operation.
56- #[ derive( Debug , Eq , PartialEq , Clone , Serialize , Deserialize , Default ) ]
61+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
62+ #[ derive( Debug , Eq , PartialEq , Clone , Default ) ]
5763pub struct Alignment {
5864 /// Smith-Waterman alignment score
5965 pub score : i32 ,
0 commit comments