# Path: kleborate/__main__.py
# def main():
#     args = parse_arguments()
#     check_inputs_and_programs(args)
#     data_folder = get_data_path()
#     if args.force_index:
#         rebuild_blast_indices(data_folder)
#     kaptive_py, kaptive_k_db, kaptive_o_db = get_kaptive_paths()
# 
#     stdout_header, full_header, res_headers = get_output_headers(args, data_folder)
#     output_headers(stdout_header, full_header, args.outfile)
# 
#     for contigs in args.assemblies:
#         with tempfile.TemporaryDirectory() as tmp_dir:
#             contigs = gunzip_contigs_if_necessary(contigs, tmp_dir)
# 
#             # All results are stored in a dictionary where the key is the column name and the value
#             # is the result. The results are outputted in order of the header rows. This means that
#             # the column orders can be easily changed by modifying the get_output_headers function.
# 
#             results = {'strain': get_strain_name(contigs)}
#             results.update(get_species_results(contigs, data_folder))
#             kp_complex = is_kp_complex(results)
#             results.update(get_contig_stat_results(contigs, kp_complex))
# 
#             results.update(get_chromosome_mlst_results(data_folder, contigs, kp_complex, args))
#             results.update(get_all_virulence_results(data_folder, contigs, args))
#             results.update(get_rmpa2_results(data_folder, contigs, args))
#             results.update(get_wzi_and_k_locus_results(data_folder, contigs, args))
#             results.update(get_resistance_results(data_folder, contigs, args, res_headers,
#                                                   kp_complex))
#             results.update(get_summary_results(results, res_headers, args))
#             results.update(get_kaptive_results('K', kaptive_py, kaptive_k_db, contigs, args))
#             results.update(get_kaptive_results('O', kaptive_py, kaptive_o_db, contigs, args))
# 
#             output_results(stdout_header, full_header, args.outfile, results)


from kleborate.__main__ import main
#!/usr/bin/env python3
"""
Convenience wrapper for running Kleborate directly from source tree.

Copyright 2020 Kat Holt
Copyright 2020 Ryan Wick (rrwick@gmail.com)
https://github.com/katholt/Kleborate/

This file is part of Kleborate. Kleborate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version. Kleborate is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details. You should have received a copy of the GNU General Public License along with Kleborate. If
not, see <http://www.gnu.org/licenses/>.
"""



if __name__ == '__main__':

# Path: kleborate/__main__.py
# def main():
#     args = parse_arguments()
#     check_inputs_and_programs(args)
#     data_folder = get_data_path()
#     if args.force_index:
#         rebuild_blast_indices(data_folder)
#     kaptive_py, kaptive_k_db, kaptive_o_db = get_kaptive_paths()
# 
#     stdout_header, full_header, res_headers = get_output_headers(args, data_folder)
#     output_headers(stdout_header, full_header, args.outfile)
# 
#     for contigs in args.assemblies:
#         with tempfile.TemporaryDirectory() as tmp_dir:
#             contigs = gunzip_contigs_if_necessary(contigs, tmp_dir)
# 
#             # All results are stored in a dictionary where the key is the column name and the value
#             # is the result. The results are outputted in order of the header rows. This means that
#             # the column orders can be easily changed by modifying the get_output_headers function.
# 
#             results = {'strain': get_strain_name(contigs)}
#             results.update(get_species_results(contigs, data_folder))
#             kp_complex = is_kp_complex(results)
#             results.update(get_contig_stat_results(contigs, kp_complex))
# 
#             results.update(get_chromosome_mlst_results(data_folder, contigs, kp_complex, args))
#             results.update(get_all_virulence_results(data_folder, contigs, args))
#             results.update(get_rmpa2_results(data_folder, contigs, args))
#             results.update(get_wzi_and_k_locus_results(data_folder, contigs, args))
#             results.update(get_resistance_results(data_folder, contigs, args, res_headers,
#                                                   kp_complex))
#             results.update(get_summary_results(results, res_headers, args))
#             results.update(get_kaptive_results('K', kaptive_py, kaptive_k_db, contigs, args))
#             results.update(get_kaptive_results('O', kaptive_py, kaptive_o_db, contigs, args))
# 
#             output_results(stdout_header, full_header, args.outfile, results)


# Path: kleborate-runner.py
from kleborate.__main__ import main

#!/usr/bin/env python3
"""
Convenience wrapper for running Kleborate directly from source tree.

Copyright 2020 Kat Holt
Copyright 2020 Ryan Wick (rrwick@gmail.com)
https://github.com/katholt/Kleborate/

This file is part of Kleborate. Kleborate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version. Kleborate is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details. You should have received a copy of the GNU General Public License along with Kleborate. If
not, see <http://www.gnu.org/licenses/>.
"""



if __name__ == '__main__':

    main()