sigalign_core/results/
mod.rs1use serde::{Deserialize, Serialize};
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
46#[cfg_attr(feature = "short_key", serde(rename = "QryAln"))]
47pub struct QueryAlignment(
48 pub Vec<TargetAlignment>
49);
50
51#[derive(Debug, Clone)]
52#[derive(Serialize, Deserialize)]
53#[cfg_attr(feature = "short_key", serde(rename = "TgtAln"))]
54pub struct TargetAlignment {
55 #[cfg_attr(feature = "short_key", serde(rename = "idx"))]
56 pub index: u32,
57 #[cfg_attr(feature = "short_key", serde(rename = "aln"))]
58 pub alignments: Vec<Alignment>,
59}
60
61#[derive(Debug, PartialEq, Eq, Hash, Clone)]
62#[derive(Serialize, Deserialize)]
63#[cfg_attr(feature = "short_key", serde(rename = "Aln"))]
64pub struct Alignment {
65 #[cfg_attr(feature = "short_key", serde(rename = "pen"))]
66 pub penalty: u32,
67 #[cfg_attr(feature = "short_key", serde(rename = "len"))]
68 pub length: u32,
69 #[cfg_attr(feature = "short_key", serde(rename = "pos"))]
70 pub position: AlignmentPosition,
71 #[cfg_attr(feature = "short_key", serde(rename = "ops"))]
72 pub operations: Vec<AlignmentOperations>,
73}
74
75#[derive(Debug, PartialEq, Eq, Hash, Clone)]
76#[derive(Serialize, Deserialize)]
77#[cfg_attr(feature = "short_key", serde(rename = "Pos"))]
78pub struct AlignmentPosition {
79 #[cfg_attr(feature = "short_key", serde(rename = "qry"))]
80 pub query: (u32, u32),
81 #[cfg_attr(feature = "short_key", serde(rename = "tgt"))]
82 pub target: (u32, u32),
83}
84
85#[derive(Debug, PartialEq, Eq, Hash, Clone)]
86#[derive(Serialize, Deserialize)]
87#[cfg_attr(feature = "short_key", serde(rename = "Ops"))]
88pub struct AlignmentOperations {
89 #[cfg_attr(feature = "short_key", serde(rename = "op"))]
90 pub operation: AlignmentOperation,
91 #[cfg_attr(feature = "short_key", serde(rename = "n"))]
92 pub count: u32,
93}
94
95#[derive(Debug, PartialEq, Eq, Hash, Clone)]
96#[derive(Serialize, Deserialize)]
97pub enum AlignmentOperation {
98 #[cfg_attr(feature = "short_key", serde(rename = "M"))]
99 Match,
100 #[cfg_attr(feature = "short_key", serde(rename = "S"))]
101 Subst,
102 #[cfg_attr(feature = "short_key", serde(rename = "D"))]
103 Deletion,
104 #[cfg_attr(feature = "short_key", serde(rename = "I"))]
105 Insertion,
106}
107
108mod to_json;
109
110mod count_alignments;
112mod deduplicate;