|
|
@@ -433,6 +433,12 @@ impl Genome {
|
|
|
Ok(())
|
|
|
}
|
|
|
|
|
|
+ pub fn write_contigs_sequences(&self, dir: &str) {
|
|
|
+ self.iter().for_each(|(_, chr)| {
|
|
|
+ chr.iter().for_each(|c| c.write_fasta(&format!("{dir}/{}.fasta", c.id)))
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
pub fn stats(&self) {
|
|
|
for (k, v) in self.chromosomes.iter() {
|
|
|
info!("{}:{}", k, v.contigs.len());
|
|
|
@@ -600,6 +606,9 @@ impl Contig {
|
|
|
self.contig_ref.desc()
|
|
|
}
|
|
|
|
|
|
+ pub fn write_fasta(&self, fasta_path: &str) {
|
|
|
+ write_fasta(fasta_path, &vec![(self.id.clone(), self.sequence.clone())]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
fn group_mappings(mappings: &mut Vec<Mapping>) -> Result<Vec<Vec<Mapping>>> {
|