Browse Source

chromosome

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

+ 4 - 1
src/lib.rs

@@ -1,5 +1,5 @@
 use anyhow::Result;
-use std::{fmt, collections::{HashMap, VecDeque}};
+use std::{fmt, collections::{HashMap, VecDeque, hash_map::Iter}};
 use log::info;
 use minimap2::Mapping;
 
@@ -159,6 +159,9 @@ impl Genome {
             chromosomes: HashMap::new(),
         }
     }
+    pub fn iter(&self) -> Iter<'_, String, Chromosome>{
+        self.chromosomes.iter()
+    }
     pub fn add_contig(&mut self, id: String, mappings: Vec<Mapping>) -> Result<()> {
         let mut new_contig = Contig { id, mappings };
         // get the category of Mapping