From f296517716a4e7702bdc2050fbfcc1e9b88c422d Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Tue, 3 Sep 2019 21:46:39 +0200 Subject: [PATCH] Various display improvements --- python/obitools3/commands/grep.pyx | 7 ++++--- python/obitools3/commands/import.pyx | 1 + python/obitools3/commands/uniq.pyx | 5 +++-- src/build_reference_db.c | 2 +- src/obi_ecopcr.c | 7 ++++++- src/obi_ecotag.c | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/python/obitools3/commands/grep.pyx b/python/obitools3/commands/grep.pyx index 78bb516..beb92bd 100644 --- a/python/obitools3/commands/grep.pyx +++ b/python/obitools3/commands/grep.pyx @@ -34,10 +34,11 @@ def addOptions(parser): metavar="", default=None, type=str, - help="Python boolean expression to be evaluated in the " + help="Warning: use bytes for character strings (b'text' instead of 'text'). " + "Python boolean expression to be evaluated in the " "sequence/line context. The attribute name can be " - "used in the expression as a variable name." - "An extra variable named 'sequence' or 'line' refers" + "used in the expression as a variable name. " + "An extra variable named 'sequence' or 'line' refers " "to the sequence or line object itself. " "Several -p options can be used on the same " "commande line.") diff --git a/python/obitools3/commands/import.pyx b/python/obitools3/commands/import.pyx index 895df19..3de61dd 100755 --- a/python/obitools3/commands/import.pyx +++ b/python/obitools3/commands/import.pyx @@ -289,6 +289,7 @@ def run(config): if pb is not None: pb(i, force=True) print("", file=sys.stderr) + logger("info", "Imported %d entries", i) # Save command config in View and DMS comments command_line = " ".join(sys.argv[1:]) diff --git a/python/obitools3/commands/uniq.pyx b/python/obitools3/commands/uniq.pyx index d093cb7..5bad7a2 100644 --- a/python/obitools3/commands/uniq.pyx +++ b/python/obitools3/commands/uniq.pyx @@ -374,7 +374,8 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li if MERGED_COLUMN in o_view: o_merged_col = o_view[MERGED_COLUMN] - print("\n") # TODO because in the middle of progress bar. Better solution? + pb(len(view), force=True) + print("") logger("info", "Second browsing through the input") # Initialize the progress bar pb = ProgressBar(len(uniques), seconde=5) @@ -487,7 +488,7 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li o_view.delete_column(QUALITY_COLUMN) if taxonomy is not None: - print("\n") # TODO because in the middle of progress bar. Better solution? + print("") # TODO because in the middle of progress bar. Better solution? logger("info", "Merging taxonomy classification") merge_taxonomy_classification(o_view, taxonomy) diff --git a/src/build_reference_db.c b/src/build_reference_db.c index 1948270..7a048c0 100755 --- a/src/build_reference_db.c +++ b/src/build_reference_db.c @@ -849,7 +849,7 @@ int build_reference_db(const char* dms_name, free(matrix_view_name); free(matrix_with_lca_view_name); - fprintf(stderr,"\rDone : 100 %% "); + fprintf(stderr,"\rDone : 100 %% \n"); return 0; } diff --git a/src/obi_ecopcr.c b/src/obi_ecopcr.c index 7e5097c..0b6d2fb 100755 --- a/src/obi_ecopcr.c +++ b/src/obi_ecopcr.c @@ -424,7 +424,12 @@ static int print_seq(Obiview_p i_view, Obiview_p o_view, tm1=nparam_CalcTwoTM(tparm,oligo1,primer1,o1->patlen) - 273.15; tm2=nparam_CalcTwoTM(tparm,oligo2,primer2,o2->patlen) - 273.15; - tm = (tm1 < tm2) ? tm1:tm2; + //tm = (tm1 < tm2) ? tm1:tm2; + + if isnan(tm1) + tm1 = OBIFloat_NA; + if isnan(tm2) + tm2 = OBIFloat_NA; // Get the taxon structure main_taxon = obi_taxo_get_taxon_with_taxid(taxonomy, taxid); diff --git a/src/obi_ecotag.c b/src/obi_ecotag.c index 47c4aa7..ef14e0d 100755 --- a/src/obi_ecotag.c +++ b/src/obi_ecotag.c @@ -655,7 +655,7 @@ int obi_ecotag(const char* dms_name, obi_close_dms(ref_dms, false); obi_close_dms(taxo_dms, false); - fprintf(stderr,"\rDone : 100 %% "); + fprintf(stderr,"\rDone : 100 %% \n"); return 0; }