From 255d4330b8be2653935175d590af3cf183a06520 Mon Sep 17 00:00:00 2001 From: Chris Rosenthal Date: Wed, 28 Aug 2024 11:04:22 -0700 Subject: [PATCH] py3 update --- deenurp/subcommands/fill_lonely.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deenurp/subcommands/fill_lonely.py b/deenurp/subcommands/fill_lonely.py index 308d18a..e9bf0ff 100644 --- a/deenurp/subcommands/fill_lonely.py +++ b/deenurp/subcommands/fill_lonely.py @@ -5,6 +5,7 @@ import argparse import copy import csv +import io import logging import shutil import sys @@ -64,7 +65,7 @@ def fill_lonely_worker( util.ntf(suffix='.fast.tre') as tree_fp: wrap.esl_sfetch(full_fasta, other_sequence_ids, tf, fa_idx) tf.seek(0) - sequences = SeqIO.parse(tf, 'fasta') + sequences = SeqIO.parse(io.TextIOWrapper(tf, encoding='utf8'), 'fasta') # Align sys.stderr.write( @@ -75,7 +76,7 @@ def fill_lonely_worker( # Run FastTree sys.stderr.write('Node {0}: FastTree {1} sequences\r'.format( node_id, len(other_sequence_ids))) - wrap.fasttree(aligned, tree_fp, gtr=True) + wrap.fasttree(aligned, tree_fp.name, gtr=True) tree_fp.close() # Select reps