nf-core / ampliseq

Amplicon sequencing analysis workflow using DADA2 and QIIME2
https://nf-co.re/ampliseq
MIT License
182 stars 115 forks source link

Parser error for single-end data #572

Closed lch14forever closed 1 year ago

lch14forever commented 1 year ago

Description of the bug

Thank you for developing this nice workflow!

I am getting an error during parsing:

No such file: home

 -- Check script '/home/chenhao/.nextflow/assets/nf-core/ampliseq/./workflows/../subworkflows/local/parse_input.nf' at line: 143 or see '.nextflow.log' file for more details

I found that my parsed input list in ch_reads looks like this:

[[id:S1, single_end:true, run:1], /home/chenhao/test/S1_R1_001.fastq.gz]
[[id:S2, single_end:true, run:1], /home/chenhao/test/S2_R1_001.fastq.gz]

I think L146-L147 of parse_input.nf could be changed to

        ch_reads
            .branch {
                failed: it[0].single_end ? it[1].size() < 1.KB : it[1][0].size() < 1.KB || it[1][1].size() < 1.KB
                passed: it[0].single_end ? it[1].size() >= 1.KB : it[1][0].size() >= 1.KB && it[1][1].size() >= 1.KB
            }

Command used and terminal output

No response

Relevant files

No response

System information

No response

d4straub commented 1 year ago

Hi there, thanks for the report! I was able to reproduce the error. That change from it[0].single_end ? it[1][0].size() to it[0].single_end ? it[1].size() indeed works. Weirdly, a second such test in cutadapt_workflow.nf does not contain that error but works fine.

d4straub commented 1 year ago

I found it only appears when a single end file is empty. I fixed it in the PR above, it will be in dev branch soon, it will be in the next release. Unfortunately that means for now you have to take care to not supply empty (<1KB) single end read files to avoid the error.