From 6ae894c27364f82fb83a8cfb65183f3a39355270 Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Thu, 2 Jan 2025 10:36:37 -0800 Subject: [PATCH] Perform referenceless contig stitching in sample.py --- micall/drivers/sample.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/micall/drivers/sample.py b/micall/drivers/sample.py index 5f6771c86..03a1179f5 100644 --- a/micall/drivers/sample.py +++ b/micall/drivers/sample.py @@ -21,6 +21,7 @@ from micall.utils.driver_utils import makedirs from micall.utils.fasta_to_csv import fasta_to_csv from micall.utils.referencefull_contig_stitcher import referencefull_contig_stitcher +from micall.utils.referenceless_contig_stitcher import referenceless_contig_stitcher from contextlib import contextmanager logger = logging.getLogger(__name__) @@ -426,10 +427,14 @@ def run_denovo(self, excluded_seeds): merged_contigs_csv, ) + with open(self.unstitched_contigs_fasta, 'r') as unstitched_contigs_fasta, \ + open(self.stitched_contigs_fasta, 'w') as stitched_contigs_fasta: + referenceless_contig_stitcher(unstitched_contigs_fasta, stitched_contigs_fasta) + with open(self.unstitched_contigs_csv, 'w') as unstitched_contigs_csv, \ open(self.merged_contigs_csv, 'r') as merged_contigs_csv, \ open(self.blast_csv, 'w') as blast_csv: - fasta_to_csv(Path(self.unstitched_contigs_fasta), + fasta_to_csv(Path(self.stitched_contigs_fasta), unstitched_contigs_csv, merged_contigs_csv, blast_csv=blast_csv,