a-slide / pycoQC

pycoQC computes metrics and generates Interactive QC plots from the sequencing summary report generated by Oxford Nanopore technologies basecaller (Albacore/Guppy)
https://a-slide.github.io/pycoQC/
GNU General Public License v3.0
271 stars 41 forks source link

Bug fix for Fast5_to_seq_summary for directories with 1 fast5 file #137

Open godotgildor opened 2 years ago

godotgildor commented 2 years ago

Currently, the code looks at the enumerate index i to see if a fast5 file was found in the given directory. However, if a directory does not have any files in it, then the enumeration loop won't get started and the i variable will actually be unbound, so the code as written would raise an UnboundLocalError. If there is a single fast5 file in the directory, then i will be valid, but it will be ==0, causing the current code to error saying that no fast5 files were found.

I've updated the logic to use a simple flag to indicate when we have actually inserted a fast5 file into the Queue during this loop.