|
|
@@ -1,5 +1,5 @@
|
|
|
use anyhow::Result;
|
|
|
-use std::{fmt, collections::{HashMap, VecDeque, hash_map::Iter}};
|
|
|
+use std::{fmt, collections::{HashMap, VecDeque}};
|
|
|
use log::info;
|
|
|
use minimap2::Mapping;
|
|
|
|
|
|
@@ -159,7 +159,7 @@ impl Genome {
|
|
|
chromosomes: HashMap::new(),
|
|
|
}
|
|
|
}
|
|
|
- pub fn iter(&self) -> Iter<'_, String, Chromosome>{
|
|
|
+ pub fn iter(&self) -> std::collections::hash_map::Iter<'_, String, Chromosome>{
|
|
|
self.chromosomes.iter()
|
|
|
}
|
|
|
pub fn add_contig(&mut self, id: String, mappings: Vec<Mapping>) -> Result<()> {
|
|
|
@@ -269,6 +269,12 @@ pub struct Chromosome {
|
|
|
contigs: Vec<ContigsRefRes>,
|
|
|
}
|
|
|
|
|
|
+impl Chromosome {
|
|
|
+ pub fn iter(&self) -> std::slice::Iter<'_, ContigsRefRes> {
|
|
|
+ self.contigs.iter()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
fn group_mappings(mappings: &mut Vec<Mapping>) -> Result<Vec<Vec<Mapping>>> {
|
|
|
// sort alignments by query_start
|
|
|
mappings.sort_by(|a, b| a.query_start.cmp(&b.query_start));
|