diff --git a/python/obitools3/commands/align.pyx b/python/obitools3/commands/align.pyx index d465ece..8f2396d 100644 --- a/python/obitools3/commands/align.pyx +++ b/python/obitools3/commands/align.pyx @@ -255,8 +255,8 @@ def run(config): # Save command config in output DMS comments o_dms.record_command_line(command_line) - print("\n") - print(repr(o_dms[final_o_view_name])) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_dms[final_o_view_name]), file=sys.stderr) # If the two input DMS are different, delete the temporary input view in the first input DMS if i_dms_2 and i_dms != i_dms_2: @@ -269,4 +269,6 @@ def run(config): o_dms.close() i_dms.close() + + logger("info", "Done.") \ No newline at end of file diff --git a/python/obitools3/commands/alignpairedend.pyx b/python/obitools3/commands/alignpairedend.pyx index 0f8f95b..fd5d826 100755 --- a/python/obitools3/commands/alignpairedend.pyx +++ b/python/obitools3/commands/alignpairedend.pyx @@ -226,6 +226,9 @@ def run(config): i+=1 + pb(i, force=True) + print("", file=sys.stderr) + if kmer_ali : aligner.free() @@ -234,11 +237,13 @@ def run(config): view.write_config(config, "alignpairedend", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) output[0].record_command_line(command_line) - print("\n") - print(repr(view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(view), file=sys.stderr) input[0].close() if two_views: rinput[0].close() output[0].close() + logger("info", "Done.") + \ No newline at end of file diff --git a/python/obitools3/commands/annotate.pyx b/python/obitools3/commands/annotate.pyx index 57850ec..f93960a 100755 --- a/python/obitools3/commands/annotate.pyx +++ b/python/obitools3/commands/annotate.pyx @@ -356,6 +356,9 @@ def run(config): except Exception, e: raise RollbackException("obi annotate error, rollbacking view: "+str(e), o_view) + + pb(i, force=True) + print("", file=sys.stderr) # Save command config in View and DMS comments command_line = " ".join(sys.argv[1:]) @@ -367,12 +370,13 @@ def run(config): o_view.write_config(config, "annotate", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) output[0].record_command_line(command_line) - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_view), file=sys.stderr) # If the input and the output DMS are different, delete the temporary imported view used to create the final view if i_dms != o_dms: View.delete_view(o_dms, imported_view_name) o_dms.close() i_dms.close() - + + logger("info", "Done.") diff --git a/python/obitools3/commands/build_ref_db.pyx b/python/obitools3/commands/build_ref_db.pyx index 2cf103f..6e541a2 100755 --- a/python/obitools3/commands/build_ref_db.pyx +++ b/python/obitools3/commands/build_ref_db.pyx @@ -91,8 +91,8 @@ def run(config): # Save command config in DMS comments o_dms.record_command_line(command_line) - print("\n") - print(repr(o_dms[final_o_view_name])) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_dms[final_o_view_name]), file=sys.stderr) # If the input and the output DMS are different, delete the temporary result view in the input DMS if i_dms != o_dms: @@ -101,3 +101,5 @@ def run(config): i_dms.close() + logger("info", "Done.") + diff --git a/python/obitools3/commands/clean.pyx b/python/obitools3/commands/clean.pyx index dedc33d..9c22761 100755 --- a/python/obitools3/commands/clean.pyx +++ b/python/obitools3/commands/clean.pyx @@ -111,8 +111,8 @@ def run(config): # Save command config in DMS comments o_dms.record_command_line(command_line) - print("\n") - print(repr(o_dms[final_o_view_name])) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_dms[final_o_view_name]), file=sys.stderr) # If the input and the output DMS are different, delete the temporary result view in the input DMS if i_dms != o_dms: @@ -120,3 +120,5 @@ def run(config): o_dms.close() i_dms.close() + + logger("info", "Done.") \ No newline at end of file diff --git a/python/obitools3/commands/ecopcr.pyx b/python/obitools3/commands/ecopcr.pyx index 547ff96..0e93562 100755 --- a/python/obitools3/commands/ecopcr.pyx +++ b/python/obitools3/commands/ecopcr.pyx @@ -194,8 +194,9 @@ def run(config): free(restrict_to_taxids_p) free(ignore_taxids_p) - print("\n") - print(repr(o_dms[o_view_name])) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_dms[o_view_name]), file=sys.stderr) o_dms.close() + logger("info", "Done.") diff --git a/python/obitools3/commands/ecotag.pyx b/python/obitools3/commands/ecotag.pyx index e00c711..3417bd9 100755 --- a/python/obitools3/commands/ecotag.pyx +++ b/python/obitools3/commands/ecotag.pyx @@ -115,8 +115,8 @@ def run(config): # Save command config in DMS comments o_dms.record_command_line(command_line) - print("\n") - print(repr(o_dms[final_o_view_name])) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_dms[final_o_view_name]), file=sys.stderr) # If the input and the output DMS are different, delete the temporary result view in the input DMS if i_dms != o_dms: @@ -124,3 +124,6 @@ def run(config): o_dms.close() i_dms.close() + + logger("info", "Done.") + diff --git a/python/obitools3/commands/export.pyx b/python/obitools3/commands/export.pyx index c4da6d4..387e159 100755 --- a/python/obitools3/commands/export.pyx +++ b/python/obitools3/commands/export.pyx @@ -9,6 +9,7 @@ from obitools3.dms.obiseq import Nuc_Seq from obitools3.apps.optiongroups import addMinimalInputOption, \ addExportOutputOption +import sys __title__="Export a view to a different file format" @@ -56,10 +57,13 @@ def run(config): break i+=1 + pb(i, force=True) + print("", file=sys.stderr) + # TODO save command in input dms? output_object.close() iview.close() input[0].close() - logger("info", "obi export: Done") + logger("info", "Done.") diff --git a/python/obitools3/commands/grep.pyx b/python/obitools3/commands/grep.pyx index 785999c..9e65efe 100755 --- a/python/obitools3/commands/grep.pyx +++ b/python/obitools3/commands/grep.pyx @@ -314,6 +314,9 @@ def run(config): if good : selection.append(i) + pb(i, force=True) + print("", file=sys.stderr) + # Create output view with the line selection try: o_view = selection.materialize(o_view_name) @@ -337,11 +340,13 @@ def run(config): View.import_view(i_dms.full_path[:-7], o_dms.full_path[:-7], o_view_name, o_view_name_final) o_view = o_dms[o_view_name_final] - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_view), file=sys.stderr) # If the input and the output DMS are different, delete the temporary imported view used to create the final view if i_dms != o_dms: View.delete_view(i_dms, o_view_name) o_dms.close() i_dms.close() + + logger("info", "Done.") diff --git a/python/obitools3/commands/head.pyx b/python/obitools3/commands/head.pyx index 5fb9fdf..27cd46c 100755 --- a/python/obitools3/commands/head.pyx +++ b/python/obitools3/commands/head.pyx @@ -72,7 +72,10 @@ def run(config): for i in range(n): pb(i) selection.append(i) - + + pb(i, force=True) + print("", file=sys.stderr) + # Create output view with the line selection try: o_view = selection.materialize(o_view_name) @@ -91,8 +94,8 @@ def run(config): View.import_view(i_dms.full_path[:-7], o_dms.full_path[:-7], o_view_name, o_view_name_final) o_view = o_dms[o_view_name_final] - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(view), file=sys.stderr) # If the input and the output DMS are different, delete the temporary imported view used to create the final view if i_dms != o_dms: @@ -100,3 +103,4 @@ def run(config): o_dms.close() i_dms.close() + logger("info", "Done.") diff --git a/python/obitools3/commands/ngsfilter.pyx b/python/obitools3/commands/ngsfilter.pyx index 429e679..9375d9a 100755 --- a/python/obitools3/commands/ngsfilter.pyx +++ b/python/obitools3/commands/ngsfilter.pyx @@ -581,6 +581,9 @@ def run(config): except Exception, e: raise RollbackException("obi ngsfilter error, rollbacking views: "+str(e), o_view, unidentified) + pb(i, force=True) + print("", file=sys.stderr) + # Save command config in View and DMS comments command_line = " ".join(sys.argv[1:]) o_view.write_config(config, "ngsfilter", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) @@ -589,8 +592,8 @@ def run(config): unidentified.comments["info"] = "View containing sequences categorized as unidentified by the ngsfilter command" output[0].record_command_line(command_line) - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_view), file=sys.stderr) input[0].close() output[0].close() @@ -598,3 +601,4 @@ def run(config): unidentified_input[0].close() aligner.free() + logger("info", "Done.") diff --git a/python/obitools3/commands/sort.pyx b/python/obitools3/commands/sort.pyx index 29323f6..7569847 100755 --- a/python/obitools3/commands/sort.pyx +++ b/python/obitools3/commands/sort.pyx @@ -109,6 +109,9 @@ def run(config): for k in keys: # TODO order? selection.sort(key=lambda line_idx: line_cmp(i_view[line_idx], k, pb(line_idx)), reverse=config['sort']['reverse']) + pb(len(i_view), force=True) + print("", file=sys.stderr) + # Create output view with the sorted line selection try: o_view = selection.materialize(o_view_name) @@ -129,11 +132,13 @@ def run(config): View.import_view(i_dms.full_path[:-7], o_dms.full_path[:-7], o_view_name, o_view_name_final) o_view = o_dms[o_view_name_final] - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_view), file=sys.stderr) # If the input and the output DMS are different, delete the temporary imported view used to create the final view if i_dms != o_dms: View.delete_view(i_dms, o_view_name) o_dms.close() i_dms.close() + + logger("info", "Done.") diff --git a/python/obitools3/commands/stats.pyx b/python/obitools3/commands/stats.pyx index 4a51d69..07c8edf 100755 --- a/python/obitools3/commands/stats.pyx +++ b/python/obitools3/commands/stats.pyx @@ -11,6 +11,7 @@ from obitools3.dms.capi.obiview cimport COUNT_COLUMN from functools import reduce import math import time +import sys __title__="Compute basic statistics for attribute values." @@ -199,6 +200,9 @@ def run(config): values[var][category]=[] values[var][category].append(v) + pb(i, force=True) + print("", file=sys.stderr) + mini, lmini = minimum(values, config['stats']) maxi, lmaxi = maximum(values, config['stats']) avg, lavg = mean(values, config['stats']) @@ -258,5 +262,4 @@ def run(config): input[0].close() - - + logger("info", "Done.") diff --git a/python/obitools3/commands/tail.pyx b/python/obitools3/commands/tail.pyx index 1792ddf..c1d2d28 100755 --- a/python/obitools3/commands/tail.pyx +++ b/python/obitools3/commands/tail.pyx @@ -73,6 +73,9 @@ def run(config): pb(i) selection.append(i) + pb(i, force=True) + print("", file=sys.stderr) + # Save command config in View comments command_line = " ".join(sys.argv[1:]) comments = View.get_config_dict(config, "tail", command_line, input_dms_name=[i_dms.name], input_view_name=[i_view.name]) @@ -95,8 +98,8 @@ def run(config): View.import_view(i_dms.full_path[:-7], o_dms.full_path[:-7], o_view_name, o_view_name_final) o_view = o_dms[o_view_name_final] - print("\n") - print(repr(o_view)) + #print("\n\nOutput view:\n````````````", file=sys.stderr) + #print(repr(o_view), file=sys.stderr) # If the input and the output DMS are different, delete the temporary imported view used to create the final view if i_dms != o_dms: @@ -104,3 +107,4 @@ def run(config): o_dms.close() i_dms.close() + logger("info", "Done.") diff --git a/python/obitools3/parsers/embl.pyx b/python/obitools3/parsers/embl.pyx index 0116f60..070c911 100755 --- a/python/obitools3/parsers/embl.pyx +++ b/python/obitools3/parsers/embl.pyx @@ -115,9 +115,7 @@ def emblIterator_file(lineiterator, line = next(iterator) else: line = firstline - - DONECOUNT=0 - + while True: if ionly >= 0 and read >= ionly-1: @@ -154,11 +152,7 @@ def emblIterator_file(lineiterator, break seq = emblParser(entry) - - if DONECOUNT%10000 == 0: - print(DONECOUNT, "\n") - DONECOUNT+=1 - + yield seq read+=1