Thomas 1 year ago
parent
commit
103ddcae94
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/lib.rs

+ 15 - 0
src/lib.rs

@@ -203,6 +203,21 @@ impl TryFrom<String> for BlastResult {
     }
 }
 
+impl BlastResult {
+    pub fn swap_query_subject(&self) -> BlastResult {
+        let s = self.clone();
+        BlastResult {
+            query_id: s.subject_id.to_string(),
+            q_start: s.s_start,
+            q_end: s.s_end,
+            subject_id: s.query_id,
+            s_start: s.q_start,
+            s_end: s.q_end,
+            ..s
+        }
+    }
+}
+
 #[derive(Debug)]
 struct BlastPile {
     x: usize,