From db03b422ed2ce58a27077380bff7023301f975a5 Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Fri, 17 Nov 2023 08:30:29 -0800 Subject: [PATCH] Perform the new stitching in the denovo pipeline One thing to make sure is that we are passing `str` instead of `Bio.Seq` to the stitcher. --- micall/core/denovo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/micall/core/denovo.py b/micall/core/denovo.py index bed1f62a5..ade45360e 100644 --- a/micall/core/denovo.py +++ b/micall/core/denovo.py @@ -19,7 +19,7 @@ from Bio.SeqRecord import SeqRecord from micall.core.project_config import ProjectConfig -from micall.core.contig_stitcher import GenotypedContig +from micall.core.contig_stitcher import GenotypedContig, stitch_consensus IVA = "iva" DEFAULT_DATABASE = os.path.join(os.path.dirname(__file__), @@ -49,9 +49,9 @@ def read_assembled_contigs(group_refs, genotypes, contigs_fasta_path: str) -> ty ref_seq = None yield GenotypedContig(name=record.name, - seq=seq, + seq=str(seq), ref_name=ref_name, - ref_seq=ref_seq, + ref_seq=str(ref_seq), match_fraction=match_fraction) @@ -84,6 +84,7 @@ def write_contig_refs(contigs_fasta_path, group_refs=group_refs) contigs = list(read_assembled_contigs(group_refs, genotypes, contigs_fasta_path)) + contigs = list(stitch_consensus(contigs)) for contig in contigs: writer.writerow(dict(ref=contig.ref_name,