Thomas 2 жил өмнө
parent
commit
1b19b90cbc
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/lib.rs

+ 2 - 2
src/lib.rs

@@ -413,7 +413,7 @@ impl Sam {
         } else {
             let len = ref_range.len(); 
             ref_range.start = ref_pos as usize;
-            ref_range.end = (ref_pos as usize + len) - 1;
+            ref_range.end = (ref_pos as usize + len);
             query_range.end = query_range.end +1;
         }
 
@@ -678,7 +678,7 @@ impl Fasta {
     }
     fn get_sequence (&self, contig: &str, start: usize, end: usize) -> String { // end is included
         let chr_index = self.fa.fai().tid(contig).expect("Cannot find chr in index");
-        if (end as i64 - start as i64) < (0 as i64) {
+        if end < start {
             let fv = self.fa.view(chr_index, end, start + 1).expect("Cannot get .fa view");
             revcomp(&fv.to_string().to_uppercase())
         } else {