jdidion / atropos

An NGS read trimming tool that is specific, sensitive, and speedy. (production)
Other
120 stars 15 forks source link

progress bar error #41

Closed cokelaer closed 6 years ago

cokelaer commented 6 years ago

With the latest version of atropos, the --progress bar option raises an error:

File "...atropos/io/progress.py", line 145, in __next__
    self.update(self.value + value[0])
TypeError: unsupported operand type(s) for +: 'int' and 'dict'

There are also lots of ERROR message, which should be ignored according to the documentation but that looks suspicious to me (maybe unrelated)

2017-09-21 02:16:50,970 ERROR: Waiting on Worker process 0 to terminate for 60.0 seconds
2017-09-21 02:16:55,860 ERROR: Worker process 5 waiting on batch for 60.0 seconds
2017-09-21 02:16:55,861 ERROR: Worker process 1 waiting on batch for 60.0 seconds
2017-09-21 02:16:55,862 ERROR: Worker process 6 waiting on batch for 60.0 seconds
2017-09-21 02:16:55,863 ERROR: Worker process 3 waiting on batch for 60.0 seconds
jdidion commented 6 years ago

Thanks Thomas. Can you provide the command you used to call atropos?

As far as the error messages, you can configure a longer timeout using the '--process-timeout' option. I've thought about reporting these as warnings rather than errors - I'll revisit that for v1.2.

cokelaer commented 6 years ago

A typical command is:

atropos trim  -b file:adapters_PCRFree_fwd.fa -B file:adapter_PCRFree_fwd.fa -pe1 input_R1_.fastq.gz -pe2 input_R2_.fastq.gz  -T 4 --progress bar -o test1.fastq.gz -p test2.fastq.gz 

This command was working with version 1.0.23 but fails with 1.1.5 and 1.1.10. If I remove the --progress bar it works fine.

cokelaer commented 6 years ago

I've tried version 1.1.14 (source) and got the same error. In io/progress.py around line 148, the update tries to add self.value (an integer) with value[0] which content is a dictionary:

{'size': 1000, 'index': 108, 'source': 0}

I think you probably just need to replace

self.update(self.value + value[0])

with

self.update(self.value + value[0]["index"])
jdidion commented 6 years ago

Thanks - 'size' is actually the key needed there. This will be fixed in 1.1.15.