Thomas 2 years ago
parent
commit
5915622954
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib.rs

+ 1 - 1
src/lib.rs

@@ -673,7 +673,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 < start {
-            let fv = self.fa.view(chr_index, end + 1, start).expect("Cannot get .fa view");
+            let fv = self.fa.view(chr_index, end + 1, start - 2).expect("Cannot get .fa view");
             revcomp(&fv.to_string().to_uppercase())
         } else {
             let fv = self.fa.view(chr_index, start - 1, end + 1).expect("Cannot get .fa view");