jdidion / atropos

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

atropos qc not handling single-end reads ? #97

Closed aathbt closed 4 years ago

aathbt commented 4 years ago

Hello,

I've been using atropos on paired-end reads for a few months now without any trouble. A few days ago, I had to process single-end reads and it seems that the qc command cannot handle single-end fastq files.

This is the error log I obtained :

=======
Atropos
=======

Atropos version: 1.1.24
Python version: 3.6.9
Command line parameters: qc -se SRR6475693.fastq

Sample ID: SRR6475693
Input format: FASTQ, Read 0, w/ Qualities
Input files:
    /media/Data/X/RNAseq_analysis_pipeline_SE/Data/SRR6475693.fastq

Start time: 2020-04-29T14:11:04.151707
Wallclock time: 313.58 s (80 us/read; 0.75 M reads/minute)
CPU time (main process): 313.58 s

------------------
Pre-trimming stats
------------------

Source
~~~~~~
Read 1: /media/Data/X/RNAseq_analysis_pipeline_SE/Data/SRR6475693.fastq

                     Read1      Read2
----------------------------------- ---------- ----------
2020-04-29 14:16:17,775 ERROR: Error executing command: qc
Traceback (most recent call last):
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/__init__.py", line 217, in execute_cli
        retcode, summary = command.execute(args)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/__init__.py", line 74, in execute
        self.generate_reports(summary, options)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/__init__.py", line 154, in generate_reports
        generator.generate_reports(summary)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/reports.py", line 65, in generate_reports
        self.generate_text_report(fmt, summary, outfile, **kwargs)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/legacy_report.py", line 225, in generate_text_report
        generate_report(summary, out)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/legacy_report.py", line 241, in generate_report
        print_pre_trim_report(summary, outfile)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/legacy_report.py", line 667, in print_pre_trim_report
        print_stats_report(data, outfile)
    File "/home/X/.local/lib/python3.6/site-packages/atropos/commands/legacy_report.py", line 779, in print_stats_report
        data['read2']['counts'])
KeyError: 'read2'

It seems to be looking fora a read2 dict key, that obviously can't exist because these are not paired-end data...

Notes :

Hope you can help me with that ! Thanks in advance !

jdidion commented 4 years ago

Thanks for catching this. I'll fix it and put out a new version this week.

jdidion commented 4 years ago

Fixed in 1.1.26

aathbt commented 4 years ago

Just tested it, it works great now ! Thank you very much !