Adding check to 4_InFrameStopCodonEstimator.py

This commit is contained in:
Auden Cote-L'Heureux 2024-02-16 14:06:06 -05:00 committed by GitHub
parent 7ca7e378bc
commit 384dd72125
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,7 +275,6 @@ def prep_translations(args):
inFasta = [i for i in SeqIO.parse(args.input_file,'fasta')] inFasta = [i for i in SeqIO.parse(args.input_file,'fasta')]
prot_dict = {} prot_dict = {}
for i in intsv: for i in intsv:
# print i # print i
prot_dict.setdefault(i.split('\t')[0],[]) prot_dict.setdefault(i.split('\t')[0],[])
@ -294,6 +293,10 @@ def prep_translations(args):
else: else:
prot_dict[i.split('\t')[0]].append(int(i.split('\t')[7])-4) prot_dict[i.split('\t')[0]].append(int(i.split('\t')[7])-4)
if len(list(prot_dict.keys())) < 50:
print('\nStop codon estimation CANCELLED for taxon ' + args.input_file[:10] + ' because its file contains fewer than 50 sequences. This check occurred in script 4.\n')
exit()
#------------- Prep translation with 'TAA' as the only Stop -------------# #------------- Prep translation with 'TAA' as the only Stop -------------#