More flexible OG identifier handling in preguidance.py

This commit is contained in:
Auden Cote-L'Heureux 2024-01-12 13:25:53 -05:00 committed by GitHub
parent 9f2d34e056
commit ccb70d9b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: