export: fixed progress bar bug

This commit is contained in:
cmercier
2020-04-17 15:09:10 +02:00
parent 4d36538c6e
commit da8de52ba4

View File

@ -60,11 +60,21 @@ def run(config):
if (output[2] == Nuc_Seq) and (iview.type != b"NUC_SEQS_VIEW") : # Nuc_Seq_Stored? TODO if (output[2] == Nuc_Seq) and (iview.type != b"NUC_SEQS_VIEW") : # Nuc_Seq_Stored? TODO
raise Exception("Error: the view to export in fasta or fastq format is not a NUC_SEQS view") raise Exception("Error: the view to export in fasta or fastq format is not a NUC_SEQS view")
if config['obi']['only'] is not None:
withoutskip = min(input[4], config['obi']['only'])
else:
withoutskip = input[4]
if config['obi']['skip'] is not None:
skip = min(input[4], config['obi']['skip'])
else:
skip = 0
# Initialize the progress bar # Initialize the progress bar
if config['obi']['noprogressbar']: if config['obi']['noprogressbar']:
pb = None pb = None
else: else:
pb = ProgressBar(len(iview), config, seconde=5) pb = ProgressBar(withoutskip - skip, config, seconde=5)
i=0 i=0
for seq in iview : for seq in iview :