From ccb70d9b46fb04d517ac9aa8906683a7cd1e22d6 Mon Sep 17 00:00:00 2001 From: Auden Cote-L'Heureux <52716489+AudenCote@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:25:53 -0500 Subject: [PATCH] More flexible OG identifier handling in preguidance.py --- PTL2/Scripts/preguidance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PTL2/Scripts/preguidance.py b/PTL2/Scripts/preguidance.py index 1ef3136..41d4c7b 100644 --- a/PTL2/Scripts/preguidance.py +++ b/PTL2/Scripts/preguidance.py @@ -52,7 +52,7 @@ def run(params): with open(params.output + '/Output/Pre-Guidance/' + og + '_preguidance.fasta', 'w') as preguidance_file: for taxon_file in aa_files: recs = [] - for rec in sorted([rec for rec in SeqIO.parse(params.data + '/' + taxon_file, 'fasta') if rec.id[-10:] == og and rec.id not in blacklist_seqs and params.og_identifier in rec.id], key=lambda x: -len(x.seq)): + for rec in sorted([rec for rec in SeqIO.parse(params.data + '/' + taxon_file, 'fasta') if rec.id[-10:] == og and rec.id not in blacklist_seqs and rec.id[-10:].startswith(params.og_identifier)], key=lambda x: -len(x.seq)): if(rec.id == rec.description): recs.append(rec) else: