BCCDC-PHL / auto-cpo

Automation of Genomic Analyses for Carbapenemase-Producing Organisms (CPOs)
GNU General Public License v3.0
0 stars 0 forks source link

`estimate_read_length` may fail #7

Closed dfornika closed 1 year ago

dfornika commented 1 year ago

The auto_cpo.fastq.estimate_read_length method may fail with the following error:

Traceback (most recent call last):
  File "auto-cpo/bin/auto-cpo", line 33, in <module>
    sys.exit(load_entry_point('auto-cpo', 'console_scripts', 'auto-cpo')())
  File "auto-cpo/auto_cpo/__main__.py", line 60, in main
    core.analyze_run(config, run, "short")
  File "auto-cpo/auto_cpo/core.py", line 206, in analyze_run
    read_length = fastq.estimate_read_length(fastq.get_first_n_reads(first_fastq, 100))
  File "auto-cpo/auto_cpo/fastq.py", line 17, in get_first_n_reads
    header = next(f).strip()
StopIteration

https://github.com/BCCDC-PHL/auto-cpo/blob/3a7485c5be1281f23bbb9dc97955fb91dcaf34d8/auto_cpo/fastq.py#L33-L53

dfornika commented 1 year ago

The sample that caused this failure has fewer than 100 reads in its R1 fastq file.