Browse Source

bit_score

Thomas 1 year ago
parent
commit
7e7d10a058
1 changed files with 14 additions and 8 deletions
  1. 14 8
      src/lib.rs

+ 14 - 8
src/lib.rs

@@ -237,10 +237,11 @@ impl BlastResult {
     pub fn to_bed(&self) -> String {
         let strand = if self.s_start <= self.s_end { "+" } else { "-" };
         let info = format!(
-            "{}:{}-{}",
+            "{}:{}-{}|{}",
             self.subject_id,
             self.s_start.to_formatted_string(&Locale::en),
-            self.s_end.to_formatted_string(&Locale::en)
+            self.s_end.to_formatted_string(&Locale::en),
+            self.bit_score,
         );
         [
             self.query_id.to_string(),
@@ -392,16 +393,21 @@ mod tests {
             .build();
 
         let fa = "test_data/419b7353-bc8c-4ffe-8ad6-0bbfac8c0cfa.fasta";
+        let fa = "/data/longreads_basic_pipe/LEVASSEUR/diag/inv10/spades/transcripts_node2.fasta";
 
         let res = Blast::init(fa)?
             .run()?
             .keep_best()
-            .results
-            .context("No results")?;
-        println!("{res:#?}");
-
-        assert_eq!(res[0].q_end, 2838);
-        assert_eq!(res[1].q_start, 2935);
+            .to_bed()?;
+        println!("{res}");
+            // .save_file("tlx1_on_hs1.bed")?;
+        //     .results
+        //     .context("No results")?;
+        // 
+        // println!("{res:#?}");
+        //
+        // assert_eq!(res[0].q_end, 2838);
+        // assert_eq!(res[1].q_start, 2935);
 
         Ok(())
     }