Skip to content
Snippets Groups Projects
Commit 73c72ea6 authored by mrethore's avatar mrethore
Browse files

Integron Fender Dependancies Testing & Minor Changes

parent e813e6cc
No related branches found
No related tags found
1 merge request!4Global Refactor
...@@ -114,9 +114,7 @@ from module.utils import ( ...@@ -114,9 +114,7 @@ from module.utils import (
get_chromosome_mlst_results, get_chromosome_mlst_results,
get_tox_results, get_tox_results,
get_chromosome_mlst_header, get_chromosome_mlst_header,
get_tox_header, get_tox_header,
get_virulence,
get_virulence_extended,
delete_virulence_extended, delete_virulence_extended,
is_non_zero_file, is_non_zero_file,
armfinder_to_table, armfinder_to_table,
...@@ -134,19 +132,26 @@ def test_multiple_dependancies(dependancies:List[str]): ...@@ -134,19 +132,26 @@ def test_multiple_dependancies(dependancies:List[str]):
print(f'/!\ Warning /!\ : {dependancy} missing in path!') print(f'/!\ Warning /!\ : {dependancy} missing in path!')
sys.exit(-1) sys.exit(-1)
def test_required_dependancy(args): def test_required_dependancy(args):
diphtoscan_dependancies = ["mash",'amrfinder','hmmsearch', 'makeblastdb','blastn', 'blastp'] diphtoscan_dependancies = ["mash",'amrfinder','hmmsearch', 'makeblastdb','blastn', 'blastp']
joly_tree_path = "diphtoscan/script/JolyTree/JolyTree.sh" joly_tree_path = "diphtoscan/script/JolyTree/JolyTree.sh"
joly_tree_dependancies = ["gawk",'fastme','REQ'] joly_tree_dependancies = ["gawk",'fastme','REQ']
integron_fender_dependancies = ['hmmsearch', 'cmsearch', 'prodigal']
if args.assemblies == None: #TODO :Ensure that dependencies are not required to update the database
return args
print("Dependency testing") subprocess.run(["echo", "Dependency testing"])
test_multiple_dependancies(diphtoscan_dependancies) test_multiple_dependancies(diphtoscan_dependancies)
if args.integron: if args.integron:
rc = test_unique_dependency("integron_finder") rc = test_unique_dependency("integron_finder")
test_multiple_dependancies(integron_fender_dependancies)
if rc == 0: if rc == 0:
args.integron = True args.integron = True
else: else:
print('/!\ Warning /!\ : integron_finder missing in path! Integron analysis not carried out.') print('/!\\ Warning /!\\ : integron_finder missing in path! Integron analysis not carried out.')
args.integron = False args.integron = False
if args.tree: if args.tree:
...@@ -154,13 +159,12 @@ def test_required_dependancy(args): ...@@ -154,13 +159,12 @@ def test_required_dependancy(args):
test_multiple_dependancies(joly_tree_dependancies) test_multiple_dependancies(joly_tree_dependancies)
args.tree = True args.tree = True
else: else:
print('/!\ Warning /!\ : JolyTree.sh missing in /diphtoscan/script/JolyTree/ ! Joly_tree representation not carried out.') print('/!\\ Warning /!\\ : JolyTree.sh missing in /diphtoscan/script/JolyTree/ ! Joly_tree representation not carried out.')
args.tree = False args.tree = False
print('\n') print('\n')
return args return args
def parse_arguments(): def parse_arguments():
parser = argparse.ArgumentParser(description='diphtOscan: a tool for characterising ' parser = argparse.ArgumentParser(description='diphtOscan: a tool for characterising '
'virulence and resistance in Corynebacterium', 'virulence and resistance in Corynebacterium',
...@@ -231,7 +235,6 @@ def parse_arguments(): ...@@ -231,7 +235,6 @@ def parse_arguments():
args.path = os.path.dirname(os.path.abspath(__file__)) args.path = os.path.dirname(os.path.abspath(__file__))
args = test_required_dependancy(args) args = test_required_dependancy(args)
return args return args
...@@ -245,9 +248,19 @@ if __name__ == "__main__": ...@@ -245,9 +248,19 @@ if __name__ == "__main__":
update_database(args,MLST_db,TOX_db) update_database(args,MLST_db,TOX_db)
if args.assemblies == None:
sys.exit(0)
resistance_db = find_resistance_db(args) resistance_db = find_resistance_db(args)
prediction_db = args.path +"/data/virulence" prediction_db = args.path +"/data/virulence"
try:
os.makedirs(args.outdir)
print("Directory '%s' created successfully \n" %args.outdir)
except OSError :
print("Directory '%s' can not be created \n" %args.outdir)
sys.exit(0)
dict_results = {} dict_results = {}
data_resistance = pd.DataFrame() data_resistance = pd.DataFrame()
for genome in args.assemblies : for genome in args.assemblies :
......
...@@ -20,9 +20,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple): ...@@ -20,9 +20,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple):
print ('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh') print ('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh')
os.system('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh') os.system('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh')
print(" ... done \n\n\n") print(" ... done \n\n\n")
try:
os.makedirs(arguments.outdir) \ No newline at end of file
print("Directory '%s' created successfully \n" %arguments.outdir)
except OSError :
print("Directory '%s' can not be created \n" %arguments.outdir)
sys.exit(0)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment