From 2723558fa28d8a72f8c0cadd4f5f75e1ad6e2e9c Mon Sep 17 00:00:00 2001 From: Alexey Gurevich Date: Fri, 8 Sep 2023 10:44:27 +0200 Subject: [PATCH] metaquast: cosmetic-feature: --no-krona option added (workaround for #216, #237, #246, #251) --- manual.html | 9 +++++++-- quast_libs/html_saver/html_saver.py | 9 +++++---- quast_libs/options_parser.py | 6 +++++- quast_libs/qconfig.py | 5 ++++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/manual.html b/manual.html index 358bd79d70..a729ea6690 100644 --- a/manual.html +++ b/manual.html @@ -781,7 +781,12 @@

2.3 Command line options

--no-plots
-Do not draw plots. +Do not draw static plots (in the PDF format by default). + +
+--no-krona +
+Do not draw Krona pie charts. Note: these plots are created only in the MetaQUAST de novo evaluation mode (without reference genomes).
--no-html @@ -1393,7 +1398,7 @@

3.3 MetaQUAST output

Note that values for some metrics like # contigs may not sum up, because one contig may be aligned to multiple reference genomes. You may read an extended discussion and explanation of this effect in the case of # misassemblies in the corresponding GitHub issue.

-

Krona charts
+

Krona charts
Krona pie charts show assemblies and dataset taxonomic profiles. Relative species abundance is calculated based on the total aligned length of contigs aligned to corresponding reference genome. Charts are created for each assembly and one additional chart is created for all assemblies altogether.
Note: these plots are created only in de novo evaluation mode (MetaQUAST without reference genomes).

diff --git a/quast_libs/html_saver/html_saver.py b/quast_libs/html_saver/html_saver.py index 1ef5eca459..b6f5901729 100644 --- a/quast_libs/html_saver/html_saver.py +++ b/quast_libs/html_saver/html_saver.py @@ -250,11 +250,12 @@ def create_meta_report(results_dirpath, json_texts): if not os.path.isfile(html_fpath): init(html_fpath, is_meta=True) - from quast_libs import search_references_meta - taxons_for_krona = search_references_meta.taxons_for_krona meta_log = get_logger(qconfig.LOGGER_META_NAME) - if taxons_for_krona: - create_krona_charts(taxons_for_krona, meta_log, results_dirpath, json_texts) + if qconfig.draw_krona: + from quast_libs import search_references_meta + taxons_for_krona = search_references_meta.taxons_for_krona + if taxons_for_krona: + create_krona_charts(taxons_for_krona, meta_log, results_dirpath, json_texts) # reading html template file with open(html_fpath) as f_html: diff --git a/quast_libs/options_parser.py b/quast_libs/options_parser.py index b40b3d021d..8c9dbe203b 100644 --- a/quast_libs/options_parser.py +++ b/quast_libs/options_parser.py @@ -654,7 +654,7 @@ def parse_options(logger, quast_args): action='callback', callback=set_multiple_variables, callback_kwargs={'store_true_values': ['no_gc', 'no_sv', 'no_read_stats'], - 'store_false_values': ['show_snps', 'draw_plots', 'html_report', 'create_icarus_html', 'analyze_gaps']}, + 'store_false_values': ['show_snps', 'draw_plots', 'draw_krona', 'html_report', 'create_icarus_html', 'analyze_gaps']}, default=False) ), # (['--no-gzip'], dict( @@ -679,6 +679,10 @@ def parse_options(logger, quast_args): dest='draw_plots', action='store_false') ), + (['--no-krona'], dict( + dest='draw_krona', + action='store_false') + ), (['--no-html'], dict( dest='html_report', action='callback', diff --git a/quast_libs/qconfig.py b/quast_libs/qconfig.py index 1e7270cbd1..12551405ee 100644 --- a/quast_libs/qconfig.py +++ b/quast_libs/qconfig.py @@ -59,6 +59,7 @@ split_scaffolds = False draw_plots = True draw_circos = False +draw_krona = True html_report = True save_json = False metagenemark = False @@ -516,7 +517,9 @@ def usage(show_hidden=False, mode=None, short=True, stream=sys.stdout): stream.write("\n") stream.write("Speedup options:\n") stream.write(" --no-check Do not check and correct input fasta files. Use at your own risk (see manual)\n") - stream.write(" --no-plots Do not draw plots\n") + stream.write(" --no-plots Do not draw static plots\n") + if mode == 'meta': + stream.write(" --no-krona Do not draw Krona pie charts (in the without references mode)\n") stream.write(" --no-html Do not build html reports and Icarus viewers\n") stream.write(" --no-icarus Do not build Icarus viewers\n") stream.write(" --no-snps Do not report SNPs (may significantly reduce memory consumption on large genomes)\n")