From 384dd721255af7b900225fb3eedf2c51163da179 Mon Sep 17 00:00:00 2001 From: Auden Cote-L'Heureux <52716489+AudenCote@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:06:06 -0500 Subject: [PATCH] Adding check to 4_InFrameStopCodonEstimator.py --- PTL1/Transcriptomes/Scripts/4_InFrameStopCodonEstimator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PTL1/Transcriptomes/Scripts/4_InFrameStopCodonEstimator.py b/PTL1/Transcriptomes/Scripts/4_InFrameStopCodonEstimator.py index ae21d52..fa2b260 100644 --- a/PTL1/Transcriptomes/Scripts/4_InFrameStopCodonEstimator.py +++ b/PTL1/Transcriptomes/Scripts/4_InFrameStopCodonEstimator.py @@ -275,7 +275,6 @@ def prep_translations(args): inFasta = [i for i in SeqIO.parse(args.input_file,'fasta')] prot_dict = {} - for i in intsv: # print i prot_dict.setdefault(i.split('\t')[0],[]) @@ -294,6 +293,10 @@ def prep_translations(args): else: 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 -------------#