diff --git a/aux_scripts/calculate_ai.py b/aux_scripts/calculate_ai.py index 2757391..0e9c580 100755 --- a/aux_scripts/calculate_ai.py +++ b/aux_scripts/calculate_ai.py @@ -40,6 +40,8 @@ def main(): egp_taxid.add(2787823) egp_taxid.add(2787854) + forbidden_chars = ["|", "@"] + #Setting up NCBI Taxonomy ncbi = NCBITaxa() number_of_lost_taxids = 0 @@ -64,6 +66,8 @@ def main(): skip += 1 else: gene = elements[0] + if any(char in gene for char in forbidden_chars): + sys.exit("[x] Query Ids should not contain | or @ characters") list_genes.append(gene) hit = elements[1] iden = elements[2] diff --git a/avp b/avp index 1f81089..7d91b46 100755 --- a/avp +++ b/avp @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -#v1.0.3 +#v1.0.4 from depot.interface import main diff --git a/depot/evaluate.py b/depot/evaluate.py index a03e059..17bed77 100644 --- a/depot/evaluate.py +++ b/depot/evaluate.py @@ -126,7 +126,6 @@ def main(): con = open(con_path,'w') FNULL = open(os.devnull, 'w') - all_trees_path = os.path.join(out_path,gene + ".trees") if fastml: # Constaint file for FastTree diff --git a/depot/interface.py b/depot/interface.py index cbc55be..a52b43c 100644 --- a/depot/interface.py +++ b/depot/interface.py @@ -23,7 +23,7 @@ from docopt import docopt def main(): - args = docopt(__doc__,version='1.0.3', options_first=True) + args = docopt(__doc__,version='1.0.4', options_first=True) if args[''] == 'prepare': import depot.prepare as prepare prepare.main() diff --git a/depot/prepare.py b/depot/prepare.py index 239e789..5b18bec 100755 --- a/depot/prepare.py +++ b/depot/prepare.py @@ -113,6 +113,8 @@ def main(): selection = selection.replace("ahs","float(row[i_ahs])>"+str(ahs_cutoff)) selection = selection.replace("outg_pct","float(row[i_pct])>"+str(pct_cutoff)) + forbidden_chars = ["|", "@"] + if trim: check_programs("trimal") trim_folder = os.path.join(output_dir,"trim") @@ -127,7 +129,7 @@ def main(): elif data_type == "DNA": dbtype = "nucl" else: - sys.exit("data_type should be either AA or DNA") + sys.exit("[x] data_type should be either AA or DNA") #Setting up NCBI Taxonomy ncbi = NCBITaxa() @@ -185,6 +187,8 @@ def main(): if('#' not in line): L_hitqline = line.rstrip('\n').split('\t') query_id = L_hitqline[0] + if any(char in query_id for char in forbidden_chars): + sys.exit("[x] Query Ids should not contain | or @ characters") if query_id in queries_info.keys(): # Queries that pass the initial selection if(len(query_dict_set[query_id]) <= queries_info[query_id]["pos"]): query_hit_id = L_hitqline[1]